🦀 🏠 - Cognitive agent memory with Hebbian learning, a three-tier architecture and knowledge graphs, running…
Shodh-Memory
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Persistent cognitive memory for AI agents and robots — with no LLM in the loop. Remembers what matters, forgets what doesn't, gets smarter with use.
---
AI agents forget everything between sessions. Robots lose context between missions. They repeat mistakes, miss patterns, and treat every interaction like the first one.
Shodh-Memory fixes this. It's persistent memory that actually learns — memories you use often become easier to find, old irrelevant context fades automatically, and recalling one thing brings back related things. Works for chat agents (MCP/HTTP), robots (Zenoh/ROS2), and edge devices. No API keys. No cloud. No external databases. **No LLM in the loop.** One binary.
Why Not Just Use mem0 / Cognee / Zep?
| | **Shodh** | **mem0** | **Cognee** | **Zep** |
|---|---|---|---|---|
| LLM calls to store a memory | **0** | 2+ per add | 3+ per cognify | 2+ per episode |
| External services needed | **None** | OpenAI + vector DB | OpenAI + Neo4j + vector DB | OpenAI + Neo4j |
| Time to store a memory | **55ms** | ~20 seconds | seconds | seconds |
| Learns from usage | **Yes** (Hebbian) | No | No | No |
| Forgets irrelevant data | **Yes** (decay) | No | No | Temporal only |
| Runs fully offline | **Yes** | No | No | No |
| Robotics / ROS2 native | **Yes** (Zenoh) | No | No | No |
| Binary size | **~17MB** | pip install + API keys | pip install + API keys + Neo4j | Cloud only |
Every other memory system delegates intelligence to LLM API calls — that's why they're slow, expensive, and can't work offline.
No LLM in the Loop
Storing a memory makes **zero LLM calls**. Recalling makes **zero LLM calls**. Entity extraction, relation typing, knowledge-graph construction, causal tracing, ranking, decay, consolidation — all of it runs locally as algorithms, not API round-trips:
- **Local embeddings** — MiniLM (22MB, INT8) via ONNX Runtime, on-device semantic search
- **Local reranking** — a cross-encoder (ms-marco-MiniLM-L6, 23 MB int8, ONNX) reads the query and each of the top 30 candidates together, where the embedder sees them apart. On by default in the server: +16.5pp precision@1 and +8.7pp recall@10 on LoCoMo (1,531 held-out questions). It is a 22M-parameter ranking model, not an LLM, and it runs on CPU
- **Local NER** — GLiNER bi-edge-v2 span typer (ONNX, schema-driven: 141 fine / 18 coarse entity types), auto-downloaded on first run from the pinned release, with a rule-based fallback
- **Typed relation extraction without an LLM** — directed lexical cues + exemplar-matched semantic typing build a typed knowledge graph (LocatedIn, WorksAt, Causes…) from plain text
- **Causal lineage** — "what was the root cause of X?" is answered by walking typed causal edges backward through the graph, not by asking a model
- **Mathematical memory dynamics** — Hebbian strengthening, exponential→power-law decay, spreading activation, long-term potentiation
What that buys you: **fully offline** operation, **millisecond** latency instead of multi-second API calls, **zero inference cost** at any scale, **deterministic, testable** behavior, and **data that never leaves the machine**. Your agent's LLM does the reasoning — its memory doesn't need one.
Get Started
Unified CLI
One binary, all functionality. No Docker, no API keys, no external dependencies.
Claude Code
Step 1 gives Claude persistent memory tools. Step 2 installs Claude Code hooks that automatically capture context from every session — memories surface without you having to ask.
Or with Docker (for production / shared servers)
Direct server mode (systemd / MCP / REST)
For Linux users who want the Rust HTTP server supervised separately from MCP