Overview
ntrp’s memory system stores knowledge as a graph of facts, observations, and dreams. Unlike simple chat history, this is structured long-term memory that grows, consolidates, and surfaces relevant context automatically.Data model
Facts
Atomic pieces of information extracted from conversations and sources.“Alice joined the backend team in March 2025”Each fact has:
- Vector embedding for semantic search
- Timestamps (
created_at,happened_at) - Access tracking with decay (less-accessed facts fade)
- Entity references (people, projects, places)
Observations
Higher-level patterns synthesized from multiple facts.“Alice transitioned from mobile to backend development, taking on infrastructure responsibilities”Observations track their source facts and maintain a change history as new evidence arrives.
Dreams
Cross-domain insights that connect seemingly unrelated facts.“Pattern: work stress correlates with reduced exercise frequency”Generated during daily consolidation by clustering facts across domains.
Write path
When ntrp learns something new:- Extract — fact is created from conversation or source data
- Embed — vector encoding for similarity search
- Link — entities extracted and connected in the knowledge graph
- Queue — fact queued for consolidation
Consolidation
A background loop runs every 30 seconds:- Per-fact — search for similar observations, decide whether to update existing or create new
- Temporal pass — find trends and transitions across an entity’s facts
- Observation merge — deduplicate similar observations (cosine > 0.90)
- Fact merge — deduplicate near-identical facts
- Dream pass — cluster facts, discover cross-domain patterns
Retrieval
When you ask ntrp something, it retrieves context in two phases:- Observations — vector + full-text hybrid search, top 5 results
- Facts — vector + FTS + entity expansion + temporal context, reranked
Commands
| Command | Description |
|---|---|
/memory | Open the memory viewer |
/purge confirm | Delete all memory data |
Tools
The agent uses these tools to interact with memory:- remember — store a fact (requires approval)
- recall — semantic search across facts and observations
- forget — delete facts matching a query