Memory & Graph
Knowledge that
outlives the session.
An unlimited semantic knowledge base in SQLite, built on the mem0 / Memora model: hybrid search, append-only versioning, secret detection and a real-world entity graph — right next to the facts.
What is stored
Self-contained facts, scoped
Each record is a self-contained fact (50–500 chars) with scope isolation — agent (shared knowledge), user (about the client), run (session episode). Confidence, importance, tags, typed edges and a full change journal on top.
| Field | Purpose |
|---|---|
| content | the fact text |
| scope | agent · user · run |
| confidence | 0.0–1.0 tie-breaker |
| importance | weight, grows via memory_boost |
| status | active · superseded · archived |
Principles
Five ideas from mem0 / Memora
Append-only
Facts are never overwritten. A new version is a new record plus a supersedes edge; contradictions stay visible through contradicts. Read modes: active, latest, full_history.
Absorb, not create
Secrets rejected → batch consolidation → hash dedup → cosine candidates → classification into one of 5 outcomes: duplicate · supersede · contradict · related · new. With dry_run.
Hybrid search
score = 0.7·cosine + 0.3·BM25, then linear freshness decay — 1% per day. ~2ms median latency in benchmarks.
Digest before start
The top agent gets a deterministic digest in its system prompt: relevant memories + open TODOs + recent records, with real ids for verification.
Optional rerank
[memory] rerank = true: a second LLM pass re-orders the expanded result set (top_k×3) by relevance.
Embeddings with fallback
Auto mode: OpenAI-compatible /embeddings when a key exists, otherwise offline TF-IDF (512-dim, no network). Vectors of different models never mix.
Three tiers
Profile, skills, archive
A ~2 KB stable profile frozen into the system prompt for prefix-cache hits. Small, always present.
Procedural knowledge discovered from experience (create_from_experience), injected on demand via the skill tool.
The unlimited SQLite knowledge base on this page — hybrid search, graph, versioning.
Entity graph
person ↔ company ↔ location
Alongside facts, the store maintains a real-world entity graph: nodes (person, company, project, technology, role, location, event, product) deduplicated by name+type, typed edges (works_at, leads, founded…) and multi-hop BFS up to 4 hops — "who leads X", "who works at companies in Kazan". Entities attach automatically during absorb.
memory_graph add · query · list
Agent tools
Six tools, one store
Ingest facts through the 5-outcome pipeline; autosave of discovered contacts happens without the model.
Hybrid vector + BM25 search with scopes, filters and freshness decay.
Build the pre-run digest (relevant + TODOs + recent).
Raise importance of facts that keep proving useful.
Create typed edges between records.
Add/query/list entities and relations.
Housekeeping
Distill, GC — nothing deleted
CLI memory search / list / get / stats / rebuild / distill / nuke. Distillation compresses run-facts into durable knowledge. GC archives expired and stale run-facts and compacts overgrown scope groups — nothing is ever destroyed.
parallel-research memory search "fintech leads Kazan"
parallel-research memory stats
parallel-research memory distill
parallel-research memory gc --dry-run