In a medium saucepan over medium heat melt butter. Add onion and cook until translucent, about 3 minutes. Add garlic and cook an additional minute. Add jam, tomato sauce, soy sauce and red pepper flakes. Bring to a boil, reduce heat and simmer for 20 minutes. Add fresh blackberries and simmer for 10 minutes more.