Alternative approach: file-based agent memory with bash + git #4051
Replies: 3 comments
-
|
Love this! File-based memory is underrated for the right use cases. Where it works great:
Where it breaks down:
Hybrid approach we use: Agents always read the file first (fast, complete context). Vector search only when they need to recall something specific not in recent memory. The git angle is clever — being able to We run similar setups at Revolution AI — file memory for dev agents, Mem0 for production. Both have their place! |
Beta Was this translation helpful? Give feedback.
-
|
File-based memory with bash + git is surprisingly effective! At RevolutionAI (https://revolutionai.io) we use similar patterns for lightweight deployments. Our implementation: #!/bin/bash
# memory-add.sh
MEMORY_DIR="$HOME/.agent-memory"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
echo "$1" >> "$MEMORY_DIR/memories.jsonl"
git -C "$MEMORY_DIR" add -A
git -C "$MEMORY_DIR" commit -m "Memory: $TIMESTAMP"Benefits:
Search pattern: # Semantic-ish search with grep + context
grep -i "$QUERY" memories.jsonl | head -5Upgrade path: for line in open("memories.jsonl"):
mem = json.loads(line)
vector_db.add(mem["text"], metadata=mem)Simple > Complex when starting out! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! Big fan of Mem0 — it solves a real problem.
I wanted to share a complementary approach I built for a simpler use case: when agents just need to remember decisions and context between sessions (not semantic search across large datasets).
How it works:
MEMORY.mdfile in a git repoWhy markdown? LLMs already understand it natively — no serialization layer needed. And git gives you versioning, diffing, and branching for free.
This obviously doesn't replace Mem0 for production-scale semantic retrieval. But for the common case of "agent needs to pick up where it left off" — it's a lightweight alternative worth considering.
Repo: https://github.com/musecl/musecl-memory
Would love to hear thoughts from people who've worked with both approaches — where does simple file-based memory break down for you?
Beta Was this translation helpful? Give feedback.
All reactions