Repository navigation
Closed
Labels
enhancementNew feature or requestepic:memory-engineEpic: Memory engine core capabilitiesnext-upNext in queue for implementationpriority:highFix in next releasescope:coreCore engine worktype:featureNew feature
Milestone
Description
Motivation
Inspired by GBrain's self-wiring graph — every put_page extracts entity refs via pure pattern matching (zero LLM calls) and creates typed edges. This produces +31.4 P@5 improvement over vector-only RAG.
Uteke currently stores relationships in a JSON metadata blob (graph.rs), which is:
- Manual (user must specify relationships)
- O(n) scan for incoming edges (
get_relatedloops all memories) - No auto-extraction from content
Proposal
Auto-extract entity references on every remember() call using pure string parsing — no LLM.
Edge Table (new SQLite table)
CREATE TABLE IF NOT EXISTS memory_edges (
id INTEGER PRIMARY KEY AUTOINCREMENT,
source_id TEXT NOT NULL,
target_id TEXT NOT NULL,
edge_type TEXT NOT NULL,
created_at TEXT NOT NULL,
FOREIGN KEY (source_id) REFERENCES memories(id),
FOREIGN KEY (target_id) REFERENCES memories(id)
);
CREATE INDEX idx_edges_source ON memory_edges(source_id);
CREATE INDEX idx_edges_target ON memory_edges(target_id);
CREATE INDEX idx_edges_type ON memory_edges(edge_type);Extraction Patterns (zero LLM)
| Pattern | Edge Type | Example |
|---|---|---|
[[memory-slug]] |
references |
[[rust-async]] → references |
@tag-name |
tagged_as |
@security → tagged_as |
^memory-id |
supersedes |
^abc123 → supersedes |
>uuid |
replies_to |
>def456 → replies_to |
Existing metadata.relationships |
(as-is) | Backward compatible |
New CLI Commands
uteke edges <memory-id> # list all edges (outgoing + incoming)
uteke edges <memory-id> --deep # multi-hop traversal (BFS, configurable depth)
uteke graph # show graph summary (node count, edge count, density)Migration from Current System
- Existing
metadata.relationshipsJSON field → auto-migrate tomemory_edgestable graph.rsparse_relationships()→ deprecate, use table queriesget_related()→ rewrite as SQL JOIN (currently O(n) scan)recall_related()→ use table-based BFS (faster, no metadata parsing)
Scope
- Add
memory_edgesSQLite table + migration (schema v5) - Implement pattern-based entity extraction in
remember()flow - Rewrite
get_related()to use SQL instead of JSON scan - Rewrite
recall_related()BFS to use edge table - Add
uteke edgesCLI subcommand - Add
uteke graphCLI subcommand (summary stats) - Migration script:
metadata.relationships→memory_edgesrows - Tests: extraction patterns, traversal, deduplication, cycle detection
Non-Goals
- LLM-based entity extraction (out of scope — pure pattern matching only)
- External knowledge graph formats (RDF, etc.)
- Graph visualization (separate issue)
References
- GBrain: https://github.com/garrytan/gbrain (self-wiring graph, zero LLM)
- Current:
crates/uteke-core/src/graph.rs(185 LOC, JSON-based) - Related closed: 🔗 Feature: Relationship graph layer between memories #246 (relationship graph layer), feat: SQLite graph storage — optional knowledge graph mode #317 (SQLite graph storage)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestepic:memory-engineEpic: Memory engine core capabilitiesnext-upNext in queue for implementationpriority:highFix in next releasescope:coreCore engine worktype:featureNew feature
Activity
feat: auto-wired memory edges (#346) (#375)
feat: graph-augmented RAG reranking (#378) (#379)
feat: auto-wired memory edges (#346) (#375)
feat: graph-augmented RAG reranking (#378) (#379)