Evolving Engram from a memory store into a fully-fledged brain for AI agent persistence.
- Edit by ID with
update— direct targeting, no similarity guessing - Partial content edits:
append,prepend,find+replacemodes - Field-level updates: change
topic,project,source,importance,expires_in_dayswithout touching content - Re-embed on content change, skip for metadata-only changes
edgestable with(source_id, target_id, relation)— six relation types:relates_to,contradicts,supersedes,derived_from,part_of,summarized_byconnect/disconnecttools for creating and removing edgesgraphtool to view a memory's neighborhood at configurable depthrecallwithdepth: 1-3follows edges via BFS to surface connected knowledge- Hierarchical memories via
parent_id(auto-createspart_ofedges) - Edges auto-cleanup on forget/merge
accessCountandimportancefields on Memory model- Scoring: cosine similarity blended with frequency (log-scaled, 15% boost), importance (1-5, 20% boost), recency (exponential decay, 10% boost)
- Recall ranking uses reinforcement signals to fine-tune ordering among close matches
rememberchecks for near-duplicates using both cosine distance (< 0.12 same-project, < 0.05 cross-scope) AND Jaccard term overlap (40%+ shared terms)- Blocks storage with a warning showing the existing memory;
force: trueto override
- FTS5 full-text index on
contentfield - Recall combines FTS5 (any matching term) with vector cosine similarity
- Falls back to FTS5-only if embedding model is unavailable
Episodemodel with title, summary, project, timestampsbegin_episode/end_episode/recall_episode/list_episodestools- Auto-episodes: first
remembercreates one; >30 minute gap or project switch starts a new one
Checkpointmodel with plan, progress, context, statuscheckpoint/resume/list_taskstools- Tasks persist across conversations with active/paused/completed status
timelinetool with chronological view grouped by day/week/monthsince/beforetemporal filters on recall- Calendar-style grouping with project and topic filters
find_clustersuses greedy cosine-distance + Jaccard term overlap clusteringconsolidatecreates a summary memory, deprioritizes originals (importance -> 0), links withsummarized_byedges
- Interactive force-directed graph (SwiftUI Canvas, 60fps)
- Project-colored nodes with inter-project repulsion for visual separation
- FTS5-backed search with prefix matching, highlight mode
- Edge type filtering with color-coded relations
- Time slider with play button to animate graph growth
- Semantic cluster hulls, minimap, detail panel, keyboard shortcuts
- PNG export
confidencefield (0.0-1.0) that increases with confirmation across sessions, decreases with conflicting evidence- Provenance chain tracking which conversations/files/events created or reinforced a memory
- Low-confidence memories flagged for verification
- Register trigger patterns that auto-surface memories when context matches
- Safety triggers ("never force-push to main"), convention triggers ("this project uses tabs")
add_trigger/remove_triggertools
- Typed memories:
fact,code_pattern,error_resolution,decision,preference,procedure - Structured fields per type (e.g., error_resolution has symptom, root_cause, fix, prevention)
- Type-aware retrieval and display formatting
- Verify stored memories against current codebase state (file paths, function signatures, dependency versions)
- Auto-validation on project recall, spot-checking verifiable memories
- Stale memories flagged or auto-expired
- Git integration for detecting significant file changes