How Lodis works
Lodis gives your AI agents a memory that's yours, not the tool's.
39 MCP tools463 tests passingMIT open source
Or in Claude: memory_tutorial() — this same content, chapter by chapter.
overview
What Lodis is
Lodis gives your AI agents a memory that's yours, not the tool's.
The problem
Every AI tool you use — Claude, ChatGPT, Cursor, Windsurf — keeps its own separate memory of you. Switch tools and you start over. Cancel a subscription and your context disappears. Your agents don't know each other exists.
What Lodis does
Lodis is an open-source MCP server plus a local web dashboard. Any MCP-compatible tool connects to the same memory layer. You own the database. You browse, search, confirm, and correct what your agents know through a real UI — not chat commands.
Why it matters for you
You get one memory that follows you across every tool. It runs locally (SQLite at ~/.lodis/lodis.db). It's MIT-licensed. And because it's an MCP server, every agent you add inherits the same context automatically.
# In Claude, Cursor, Windsurf — all pointing at the same memory
npx lodis init
# → registers lodis as an MCP server for every MCP-compatible clientTools in this chapter
memory_tutorial— This tool. Teaches you (or an agent) how Lodis works, chapter by chapter.
write
Writing memories
Every write runs dedup detection, entity extraction, and confidence scoring.
How writes work
Call memory_write with a short fact. Lodis runs hybrid search to check for similar memories, extracts entities in the background via LLM, and stores the result with an initial confidence score based on source type (stated 0.90, observed 0.75, inferred 0.65).
memory_write({
content: "I work at Mill as a principal engineer",
source_type: "stated"
})Dedup in the loop
If a similar memory already exists (RRF > 0.7 plus entity match), Lodis returns similar_found with five resolution options: update, correct, add_detail, keep_both, skip. The agent decides in real time — no silent duplicates, no silent overwrites.
Entity extraction
Entities are classified into 13 types: person, organization, place, project, preference, event, goal, fact, lesson, routine, skill, resource, decision. Connections between entities (works_at, involves, located_at) are created automatically.
Tools in this chapter
memory_write— Create a memory. Returns the memory plus dedup hits if any.memory_update— Modify content, detail, or metadata of an existing memory.
search
Searching memories
Hybrid search via Reciprocal Rank Fusion — keyword and semantic together.
Three search modes
memory_search returns ranked memories. memory_context returns a token-budget-aware pack for building a response. memory_briefing returns a pre-computed entity profile (24h cache) — best for 'tell me about Sarah' questions.
memory_search({ query: "Lodis" })
memory_context({ query: "what am I working on?", token_budget: 6000 })
memory_briefing({ entity_name: "Mill" })How hybrid ranking works
Every search runs two queries in parallel: FTS5 keyword search and sqlite-vec cosine similarity over 384-dim embeddings. Results merge via Reciprocal Rank Fusion (k=60), then get boosted by confidence and recency. Graph expansion adds up to 3 hops for related memories.
Close the loop
memory_context returns rate_with_this_id plus suggestedFollowUps and a saturation signal. After the agent answers, it calls memory_rate_context with referenced (IDs cited) and noise (IDs filtered). Ratings drive the +0.02 used-bump on confidence and feed optional utility ranking — so Lodis learns which memories were actually useful, not just retrieved.
Tools in this chapter
memory_search— Hybrid ranked search with domain, confidence, and entity filters.memory_context— Token-budget-aware retrieval. Returns a retrievalId plus saturation and suggested follow-ups.memory_briefing— Entity profile summary with 24h cache — best for people/projects/places.memory_rate_context— Rate a prior memory_context retrieval. Reports referenced and noise IDs — closes the loop.
trust
Trust and confidence
Every memory has a confidence score that changes with use, confirmation, and time.
The confidence engine
Confidence starts based on source type, then updates on every interaction. Confirm a memory and it jumps to 0.99. Flag a mistake and it drops 0.15. Use it in a response and it gains 0.02. Memories decay 0.01 per 30 days unless pinned — stale facts sink, fresh ones float.
Corrections and mistakes
When you correct a memory, Lodis uses the LLM to do a semantic diff — the new content replaces the old, confidence resets to 0.50, and the history is logged. Flagging a mistake keeps the memory but degrades confidence. Both actions leave an audit trail.
memory_confirm({ memory_id: "abc123" }) // → confidence 0.99
memory_flag_mistake({ memory_id: "abc123" }) // → confidence -0.15
memory_correct({ memory_id: "abc123", new_content: "..." })Tools in this chapter
memory_confirm— Mark a memory as verified. Confidence → 0.99.memory_correct— LLM-powered semantic diff correction. Confidence resets to 0.50.memory_flag_mistake— Degrade a memory's confidence without deleting it.memory_pin— Pin as canonical — immune to decay, boosted in search.
permissions
Agent permissions
Agent-centric scoping — Open or Isolated, plus sensitive-domain guardrails.
Open or Isolated
Every agent has a mode. Open (the default) inherits every domain. Isolated starts with a wildcard deny and only reads the domains you allowlist via chips. Switching modes is one toggle on the /agents page.
Presets
Three one-click presets: Work (code + task domains only), Personal (journal + people only), Lockdown (read-nothing baseline). Presets apply atomically via libsql client.batch — prior rules survive if any insert fails.
Sensitive domains
Mark any domain sensitive in the dashboard and it lands in the sensitive_domains table. The first time a new agent tries to write there, memory_write auto-inserts a block row plus an audit event — no silent leaks. Granting allow-access later requires a confirmation modal.
# dashboard → /agents → domain → mark sensitive
# next time a new agent writes there:
# → agent_permissions row inserted (can_write=0)
# → memory_events row logs the auto-blockThe MCP primitive
memory_set_permissions still exists as the low-level tool for advanced users — grant or revoke read/write per (agent, domain) without the UI. Use it from scripts, or when the dashboard isn't running.
Tools in this chapter
memory_set_permissions— Per-agent read/write access control by domain. The low-level primitive behind the /agents UI.memory_list_domains— List every domain with memory counts — useful before applying a preset.