Show HN: Mengram – AI agent memory with facts, events, and evolving workflows (github.com)

2 points by mengram-ai ↗ HN
Hi HN, I built Mengram because every AI memory tool I tried only stored facts. My agents kept making the same mistakes — forgetting what happened, losing workflows.

  Mengram stores 3 types: semantic (facts), episodic (events/decisions), and procedural (workflows). The key difference: procedures evolve when they fail.                                                                                                                                
                                                                                                                                                                                                                                                                                          
  Week 1: deploy → build → push (fails: forgot migrations)                                                                                                                                                                                                                                
  Week 2: deploy v2 → build → migrate → push (fails: OOM)                                                                                                                                                                                                                                 
  Week 3: deploy v3 → build → migrate → check memory → push                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                          
  This happens automatically from conversations — report a failure, the procedure evolves.                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                          
  Stack: Python, PostgreSQL + pgvector, FastAPI. Free cloud API, self-hostable, SDKs for Python/JS, integrations with LangChain, CrewAI, MCP.                                                                                                                                             
                                                                                                                                                                                                                                                                                        
  Honest limitations: extraction quality depends on LLM, procedural evolution needs clear failure descriptions, no real-time streaming yet.

  Would love feedback on the memory model — is 3 types the right abstraction, or too complex?

1 comment

[ 0.31 ms ] story [ 32.6 ms ] thread
Hi HN, I'm Ali. I've been building Mengram for the past year.

  The problem: Every AI memory tool stores facts — "user likes dark mode." But when my agents failed at a task, they'd fail the exact same way next time. They had no memory of what happened or how to do things better.                                                               
                                                                                                                                                                                                                                                                                          
  What Mengram does: It stores 3 types of memory, modeled after how human cognition works:                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                          
  - Semantic — facts and preferences (like Mem0, Zep)                                                                                                                                                                                                                                     
  - Episodic — events, decisions, outcomes (what happened and when)                                                                                                                                                                                                                       
  - Procedural — learned workflows that evolve when they fail                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                          
  The procedural part is what I'm most excited about. When an agent reports a failure, Mengram automatically evolves the procedure — adds a new step, changes the order, removes what didn't work. Your agent literally gets better at its job over time.
                                                                                                                                                                                                                                                                                          
  Example: Week 1, "Deploy" = build → push → deploy. Agent forgets migrations, DB crashes. Week 2, Mengram evolves it to build → run migrations → push → deploy. Agent hits OOM. Week 3, adds memory check step. This happens automatically.                                              
                                                                                                                                                                                                                                                                                          
  Technical details:                                                                                                                                                                                                                                                                      
  - Python & JS SDKs: pip install mengram-ai                                                                                                                                                                                                                                              
  - Free cloud API (no...