Memory & Graphify
ADA's memory system combines ReasoningBank (SQLite), Smart Retrieval (BM25+RRF+MMR), Graphify (knowledge graph), and optional Obsidian integration.
ReasoningBank Architecture (post-refactor)
Four problems solved in the v2 refactor:
P1 — Observable recall
Probe Ollama before retrieve, signal degraded mode to stderr, expose via bankHealth()
P2 — Acronym tokenizer
ACRONYMS_KEEP preserves ts, db, ui, api — NORMALIZE_MAP expands them before indexing
P3 — Content-only relevance
contentRelevance() scores query↔content only (no recency/verdict contamination)
P4 — Dedup at store
Jaccard ≥0.5 triggers last-write-wins; opposite polarity = WARNING, no auto-archive
Scope System
// scope: global — injected unconditionally if on-topic
{ scope: 'global', content: 'Always use uuid PK on every table' }
// scope: domain — gated on contentRelevance > 0 threshold
{ scope: 'domain', content: 'NestJS: inject ConfigService, not process.env' }
// buildRecallBlockAsync — main entry point
const block = await buildRecallBlockAsync(query, { limit: 5 })
// → probes Ollama, retrieves, applies scope gating, caps LESSON_LIMIT=4Graphify — Knowledge Graph
Graphify (ADR-014) models tasks, files, agents, and outcomes as a property graph in SQLite. Edges represent causal and dependency relationships.
// graph-builder.js — node types
{ type: 'task', id, title, status, cost, agentsInvolved[] }
{ type: 'file', id, path, language }
{ type: 'agent', id, name, tier, p_win }
// edges
{ from, to, relation: 'modified' | 'depends_on' | 'produced_by' | 'linked' }
// query neighbors
const neighbors = graph.neighbors(nodeId, { depth: 2, types: ['file', 'task'] })Obsidian Integration
ADA can write insights and run summaries directly to an Obsidian vault. Configure via Settings → Obsidian.
# ~/.ada.json
{
"obsidian": {
"vaultPath": "/Users/you/ObsidianVault",
"enabled": true,
"noteDir": "ada-runs", // subfolder in vault
"frontmatter": true // add YAML frontmatter
}
}
# Test the connection
ada obsidian test
# → Vault found: /Users/you/ObsidianVault ✓
# → Write permission: OK ✓
# Manual sync
ada obsidian sync --run <runId>The Memory view in ada-ui renders a 3D force-directed graph (WebGL) of all Graphify nodes. Fallback to a 2D list on screens <1024px or when WebGL is unavailable.