Actually, you can say "you know something FROM memory". The difference is that when you say you know "by heart" it means you're in complete mastery of it. When you say "from memory" you specify that you didn't read it off of a sheet of paper or a study guide; you memorized it. Knowing something "from memory" wouldn't sound as secure as knowing it "by heart", I guess.