|
Add long-term user memory system
Architecture: - navi/memory/store.py: MemoryStore backed by SQLite (memory_facts, memory_summary, session_memory_state tables in navi.db) - navi/memory/extractor.py: LLM-based fact extraction from sessions + summary regeneration (triggered after session goes idle >30 min) - Fact upsert uses UNIQUE(category, key) — same key always overwrites, no duplicates or stale contradictions - Keyword search across category + key + value (LIKE-based, no extra deps) Context injection: - Memory summary injected as an ephemeral system message on every LLM call via Agent._with_memory() — never persisted to session.context Tools (all profiles): - memory_search(query): keyword search against fact DB; persona instructs model to call it at session start and before personal-context questions - memory_forget(key, category?): delete a specific fact on user request Extraction trigger: - On new session creation, fire-and-forget background task checks all sessions idle >30 min with unprocessed messages → runs extraction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
|---|
|
|
| navi/api/deps.py |
|---|
| navi/api/routes/sessions.py |
|---|
| navi/api/websocket.py |
|---|
| navi/core/agent.py |
|---|
| navi/core/registry.py |
|---|
| navi/memory/__init__.py 0 → 100644 |
|---|
| navi/memory/extractor.py 0 → 100644 |
|---|
| navi/memory/store.py 0 → 100644 |
|---|
| navi/profiles/secretary.py |
|---|
| navi/profiles/server_admin.py |
|---|
| navi/profiles/smart_home.py |
|---|
| navi/tools/__init__.py |
|---|
| navi/tools/memory_forget.py 0 → 100644 |
|---|
| navi/tools/memory_search.py 0 → 100644 |
|---|
| persona.txt |
|---|