Make AI Agents learn, reinforce, forget, and generalize like a human brain
English | ็ฎไฝไธญๆ
Most AI memory systems only solve storage. DNA Memory is about how agents actually learn and evolve.
It is not just a memory store. It is a memory evolution system with:
- 3-layer memory architecture
- reinforcement and decay
- reflection (
reflect) - promotion to long-term memory (
promote) - duplicate cleanup (
dedupe) - FTS5-powered recall search
- background daemon maintenance
| Capability | Mem0 | Zep | LangChain Memory | DNA Memory |
|---|---|---|---|---|
| Basic storage | โ | โ | โ | โ |
| Vector / semantic retrieval | โ | โ | โ | |
| Multi-layer architecture | โ | โ | โ working / short / long | |
| Active forgetting | โ | โ | โ | โ |
| Reflection loop | โ | โ | โ | โ |
| Pattern extraction | โ | โ | โ | โ |
| Long-term promotion | โ | โ | โ | โ |
| Local-first / minimal core deps | โ | โ | โ | โ |
| Built for agent workflows | โ |
Positioning in one sentence:
DNA Memory helps AI agents not only remember, but also reinforce, forget, summarize, and evolve like a real cognitive system.
# 1) Clone into your OpenClaw skills directory
git clone https://github.com/AIPMAndy/dna-memory.git ~/.openclaw/skills/dna-memory
# 2) Remember one preference
python3 ~/.openclaw/skills/dna-memory/scripts/evolve.py remember "The user prefers concise and direct responses" -t preference -i 0.9
# 3) Recall related memories
python3 ~/.openclaw/skills/dna-memory/scripts/evolve.py recall "concise direct"
# 4) Inspect stats
python3 ~/.openclaw/skills/dna-memory/scripts/evolve.py statsWhy it is practical:
- core features run on Python + SQLite
- no external database required
- local-first by default
- ideal for personal assistants, local agents, and autonomous workflows
Working Memory
โ filter
Short-term Memory
โ consolidate / promote
Long-term Memory
| Layer | Role | Typical content |
|---|---|---|
| Working | temporary session context | current task state, fresh facts |
| Short-term | recent important information | preferences, lessons, recent errors |
| Long-term | stable knowledge and patterns | rules, skills, persistent preferences |
- used often โ higher weight
- unused for a long time โ decay
- low-weight memories โ removable
- stable high-value memories โ promoted to long-term memory
reflect does two things:
- extracts recurring patterns from recent high-weight memories
- promotes stable short-term memories into long-term memory
Current recall supports:
- multi-keyword AND search
- type filters like
type:error/type:skill - SQLite FTS5 full-text search
- automatic fallback to LIKE search if FTS5 is unavailable
Examples:
python3 scripts/evolve.py recall "feishu api"
python3 scripts/evolve.py recall "type:error github"
python3 scripts/evolve.py recall "user preference concise"The daemon can automatically run:
reflectdecay- throttled maintenance so the same batch is not repeatedly summarized
It can also be registered with macOS launchd for auto-start on boot.
dna-memory/
โโโ scripts/
โ โโโ evolve.py # core CLI: remember / recall / stats / reflect / dedupe ...
โ โโโ dna_memory_daemon.py # background maintenance daemon
โ โโโ semantic_search.py # experimental semantic search module
โ โโโ analyze.py
โ โโโ api.py
โ โโโ autocollect.py
โ โโโ backup.py
โ โโโ cli.py
โ โโโ detailed_stats.py
โ โโโ knowme_link.py
โ โโโ reminder.py
โ โโโ trigger.py
โ โโโ visualize.py
โโโ memory/
โ โโโ memory.db # SQLite primary store (memories + operations)
โ โโโ working.json # working memory
โโโ assets/
โ โโโ config.json # daemon / decay config
โโโ README.md
โโโ README_EN.md
โโโ SKILL.md
Note:
memory/*.dbshould not be committed. The repo now ignores real memory database files by default.
python3 scripts/evolve.py remember "Andy prefers concise and direct responses" -t preference -i 0.95python3 scripts/evolve.py recall "concise response"
python3 scripts/evolve.py recall "type:skill feishu"python3 scripts/evolve.py statspython3 scripts/evolve.py reflectpython3 scripts/evolve.py promote --id 12python3 scripts/evolve.py dedupe# start
python3 scripts/dna_memory_daemon.py start
# check status
python3 scripts/dna_memory_daemon.py status
# stop
python3 scripts/dna_memory_daemon.py stop- remember user preferences
- develop a stable collaboration style over time
- learn from mistakes instead of repeating them
- turn finished tasks into reusable skills
- store failure cases as error memories
- extract patterns from long-running work
- accumulate user profiles
- track behavioral patterns
- build long-term personalization
- works well with OpenClaw, self-improving-agent, and custom agent stacks
- turns operational experience into reusable memory assets
Receive task
โ
Recall related memories
โ
Execute
โ
Remember new preferences / skills / errors
โ
Reflect recurring patterns
โ
Promote into long-term memory
This workflow is especially useful when:
- the user corrects the agent
- a new preference is learned
- an API/tool fails
- a long task finishes
- a repeatable pattern appears
- SQLite single-store refactor
- remember / recall / reflect / promote / dedupe CLI
- daemon for automatic reflect / decay
- FTS5-based recall search
- launchd auto-start setup
- better Chinese tokenization and ranking
- real embedding-based semantic retrieval
- stronger memory graph visualization
- more complete import / export / migration tooling
- shared memory spaces for multi-agent systems
Issues and PRs are welcome.
High-impact contribution areas:
- recall ranking quality
- Chinese search experience
- pattern extraction quality
- memory visualization
- embedding provider integrations
Andy / AI้
้ฟAndy
Ex-Tencent / Baidu AI Product Expert โ LLM Unicorn VP โ Startup CEO
Focus areas:
- AI agents
- AI commercialization
- memory systems
- human augmentation
GitHub: https://github.com/AIPMAndy
If this project helps you, give it a โญ Star.