Project Memory

Not a markdown file. Not a vector database. A persistent knowledge base with typed facts, semantic search, episodic narratives, a knowledge graph with directional edges, working memory pinning, and automatic compaction — all surviving across sessions.

Semantic recall uses the configured Ollama embedding endpoint when reachable. Builds compiled with local-embeddings can also load a local ONNX sentence-transformer model; without either backend, memory falls back to FTS5 keyword search.

Architecture

Agent Tools

ToolPurpose
memory_recall(query)Semantic search — returns ranked facts by relevance × confidence
memory_query()Load all active facts (expensive — prefer memory_recall)
memory_store(section, content)Persist a new fact
memory_supersede(fact_id, content)Atomically replace a fact with an updated version
memory_archive(fact_ids)Archive stale facts (removed from active context)
memory_episodes(query)Search session narratives for episodic context
memory_focus(fact_ids)Pin facts to working memory (survives compaction)
memory_release()Clear working memory buffer
memory_connect(source, target, relation)Create a typed edge in the knowledge graph
memory_compact()Trigger context compaction to free context window
memory_search_archive(query)Search archived (superseded/stale) facts — not injected into context but still queryable
memory_ingest_lifecycle()Batch-import recent design-tree decisions and resolved questions into the memory store

Lifecycle

  1. Store — agent discovers something important, stores a fact
  2. Recall — on future turns, agent searches for relevant facts by query
  3. Supersede — when understanding changes, old fact is replaced atomically
  4. Connect — relationships between facts are recorded as graph edges
  5. Archive — stale facts are moved to archive (still searchable, not injected)
  6. Compact — when context fills, older conversation is summarized; pinned facts survive

Auto-Ingestion

Two automatic memory flows run without explicit tool calls:

Operator Commands

/memory       # Show memory stats: facts, episodes, working memory
/compact      # Trigger context compaction manually
/note [text]  # Quick-capture a note (persists across sessions)
/notes        # Show pending notes

Storage

Facts are stored as one JSON object per line in the project's memory directory. This file is git-tracked with merge=union in .gitattributes, allowing multiple branches to add facts without merge conflicts. SQLite databases are gitignored and rebuilt from the JSONL source of truth.

Embedding Backends

BackendHow it is selectedFallback
Ollama embeddingsConfigured profile or OMEGON_EMBED_URL / OMEGON_EMBED_MODELFalls through if the endpoint probe fails
Local ONNXBinary built with local-embeddings and model files at ~/.config/omegon/models/all-MiniLM-L6-v2/Falls through if files are missing or model load fails
FTS5Always availableKeyword recall only

The local ONNX path expects model.onnx and tokenizer.json. Override the model name with OMEGON_EMBED_LOCAL_MODEL or the exact directory with OMEGON_EMBED_MODEL_DIR.