memory: one search across facts, raw history and sketches
Compression removes messages from the model's window, not from the
conversation: every compression path now writes the turns it demotes into
`memory_chunks` — verbatim, append-only, with the turn range, timestamps and
breadcrumb keys (the summarizer's `KEYS:` line plus a deterministic extractor,
which also covers the hard-truncate fallback that never sees a summarizer).

`memory_search` is the single read path over the three stores: curated facts
first, then raw excerpts by relevance, then the current session's sketches.
Every hit carries provenance (source, session, turn range, timestamp), and a
raw excerpt that a newer curated fact overrides is labelled outdated rather
than hidden — "we changed our mind, the old value was X" is often the
question. The agent also gets up to two relevant excerpts injected per turn
once the context holds a summary, deduped across turns.

Fixes found by running the pilot against a real database:
- `search_facts` returns ISO-string timestamps while chunks return datetimes;
  the freshness comparison raised TypeError and took the whole search down.
- an existing `memory_chunks` table created without pgvector never gained the
  `embedding` column (CREATE TABLE IF NOT EXISTS does not alter), and the
  INSERT failed on it; the DDL now adds the column, and a database without
  pgvector writes text-only rows found through FTS.
1 parent d6e82a9 commit 23e710723d85fe33f2da49f2eccf34951b404abb
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 20 hours ago
Showing 42 changed files
View
docs/agent.md
View
docs/config.md
View
docs/mechanics.md
View
docs/memory.md
View
docs/navi_code.md
View
docs/profiles.md
View
docs/sessions.md
View
docs/store.md
View
docs/tools.md
View
navi/core/agent.py
View
navi/core/compressor.py
View
navi/core/container.py
View
navi/core/context_builder.py
View
navi/core/orchestrator.py
View
navi/core/pg_session_store.py
View
navi/core/registry.py
View
navi/memory/_chunks.py 0 → 100644
View
navi/memory/_ddl.py
View
navi/memory/breadcrumbs.py 0 → 100644
View
navi/memory/search.py 0 → 100644
View
navi/memory/store.py
View
navi/profiles/assistant/config.json
View
navi/profiles/designer_3d/config.json
View
navi/profiles/developer/config.json
View
navi/profiles/discuss/config.json
View
navi/profiles/modeler_3d/config.json
View
navi/profiles/navi_code/config.json
View
navi/profiles/server_admin/config.json
View
navi/settings_model.py
View
navi/store/__init__.py
View
navi/tools/__init__.py
View
navi/tools/memory_search.py 0 → 100644
View
navi/workers/base.py
View
navi/workers/compressor.py
View
tests/unit/core/test_agent.py
View
tests/unit/core/test_compression_breadcrumbs.py 0 → 100644
View
tests/unit/core/test_memory_recall.py 0 → 100644
View
tests/unit/memory/test_breadcrumbs.py 0 → 100644
View
tests/unit/memory/test_chunks.py 0 → 100644
View
tests/unit/memory/test_memory_ddl.py
View
tests/unit/memory/test_memory_search.py 0 → 100644
View
tests/unit/tools/test_memory_search_tool.py 0 → 100644