A quarantine for extracted facts beside operator agents whose state is never saved

OpenJarvis

Stanford's local-first personal AI framework, whose memory is a JSONL fact store with trust tiers, an FTS5 document store, a connector index and Markdown files.

LicenceApache-2.0; frontend/src-tauri/Cargo.toml declares MIT
Size181,047 lines of Python in src, 27,743 of Rust and 26,630 of TypeScript; the memory is memory/ (978), tools/storage/context.py (245), tools/storage/sqlite.py (165) over a Rust sqlite.rs, connectors/store.py (585) and connectors/hybrid_search.py
Activity1,407 commits on main from 12 March to 1 December 2026, 235 of them by a bot; 150 contributors listed; latest desktop release v1.0.5 on 11 November 2026
Tests8,303 Python and 440 Rust test functions; CI builds the Rust extension and runs tests/ on Python 3.11 and 3.12; none run for this reading

Carries 3 of 7 rubric mechanisms. Most systems here carry none or one (41%), and a dash means the mechanism was not found at this commit — not that the system needed it. Each mark is one LLM reviewer's reading of the code at this commit rather than a run of it — known limits.

  • Tombstone
  • Trust state
  • Bi-temporal
  • Scope enforced
  • Mutation audit
  • Human review
  • Negative evals

1. Executive Summary

OpenJarvis is Stanford's local-first personal AI framework: model engines, agents, tools, connectors and a learning loop on the user's own machine. Its memory is four separate stores, and the most careful of them is a JSONL file of facts extracted from conversations, each with a trust tier. Notable: a fact whose text matches an injection pattern is quarantined, kept out of every fact read, and released only by a person at the CLI. Weak: the agents meant to remember between scheduled runs do not. They call the memory and session stores with arguments those stores reject, and the errors are swallowed.

The fact store is small and well built. It locks across processes, rewrites atomically, fails closed on an unknown tier, and has tests that require a hostile fact to be absent from a prompt that holds a clean one. It is off by default (src/openjarvis/core/config.py:972-974).

The rest is uneven:

  • Operator continuity is dead on the shipped stores. operative and monitor_operative write store(key, value), and every registered backend takes keyword-only arguments after the content (src/openjarvis/agents/operative.py:320, src/openjarvis/tools/storage/sqlite.py:77-83). The read half does work, as a word search, and puts unrelated documents under "Previous State".
  • A person's decision is not durable. A fact promoted to trusted drops back to untrusted when the extractor produces it again and the scanner flags it again (src/openjarvis/memory/store.py:319-326).
  • The documented memory is not the default one. The showcase page says Jarvis writes MEMORY.md by itself. The tool that does is in no shipped preset, and the hook that would prompt for it has no caller.

Licence. LICENSE and pyproject.toml are Apache-2.0, and frontend/src-tauri/Cargo.toml:6 declares MIT for the desktop shell with no MIT text in the tree.

Three marks: trust_state, human_review and negative_eval, all on the fact store. Section 9 gives the reason for each of the four withheld.

2. Mental Model

A memory is a string a model thought worth keeping. After a chat turn the extractor gets the user's and assistant's text and returns a JSON array of short facts, "stable over time and useful in future conversations" (src/openjarvis/memory/extractor.py:22-30). When the model answers in prose, each line becomes a fact (:130-143).

A fact has one of four tiers (src/openjarvis/memory/store.py:79-90):

  • auto: extracted, and its text matched no pattern. Recalled at once.
  • untrusted: its text matched a pattern. Stored, listed and never recalled.
  • trusted: a person promoted it from untrusted.
  • blank: written before tiers existed. Recalled.

Any other value is withheld. The tier answers could this text be an attack, and a false fact in plain words is auto.

Transitions are few. A flagged re-derivation downgrades a recallable copy of the same text. A clean one never promotes. Only jarvis memory trust <n> promotes, and it checks that the text at that position is still the text it showed (:354-365). A fact leaves by FIFO eviction past 1,000 or by clear, which removes everything. Nothing supersedes, contradicts, expires or corrects: "lives in Oslo" and "lives in Bergen" are two facts, both injected.

Documents are evidence the user indexed. MEMORY.md and USER.md are authored text the agent may edit when given the tool. A managed agent's summary_memory is its last output.

Diagram — a fact's tier decides recall; a person can release a quarantined fact, and the next extraction that is flagged again takes it back
Diagram source
%% caption: a fact's tier decides recall; a person can release a quarantined fact, and the next extraction that is flagged again takes it back
flowchart TD
  EX["completed exchange<br/>chat or server"]
  EX --> S1{"scan of both<br/>sides of the turn"}
  S1 -->|"high or critical"| DROP["whole exchange<br/>dropped, no row"]
  S1 -->|"clean or medium"| LLM["model returns<br/>fact strings"]
  LLM --> S2{"scan of each<br/>fact's own text"}
  S2 -->|"clean"| AUTO["auto"]
  S2 -->|"any finding"| UN["untrusted<br/>listed, not recalled"]
  UN -->|"person: jarvis<br/>memory trust n"| TR["trusted"]
  TR -->|"same text extracted<br/>and flagged again"| UN
  AUTO -->|"same text<br/>flagged later"| UN
  AUTO --> CTX["prompt: newest first<br/>to a word budget"]
  TR --> CTX
  AUTO --> EV["evicted past 1,000<br/>or cleared with the rest"]

3. Architecture

Four stores sit side by side under ~/.openjarvis and share no identity:

  • Facts: memory_facts.jsonl, rewritten whole on each change under a file lock (src/openjarvis/memory/store.py:93-124, :273-296). Third-party backends register through FactStoreRegistry.
  • Documents: memory.db, an FTS5 table behind SQLiteMemory, whose implementation is the Rust extension (rust/crates/openjarvis-tools/src/storage/sqlite.rs). BM25, FAISS, ColBERT, dense and hybrid backends are alternatives, and all but SQLite live in memory.
  • Connector data: knowledge.db, chunks from mail, chat, calendar, notes and files, with provenance columns and embedding blobs (src/openjarvis/connectors/store.py:29-54).
  • Markdown: SOUL.md, MEMORY.md and USER.md, loaded into the frozen prompt prefix with character caps of 4,000, 2,500 and 1,500 (src/openjarvis/prompt/builder.py:116-137, src/openjarvis/core/config.py:1681-1684).

Conversation history, managed-agent rows and traces are in sessions.db, agents.db and traces.db.

Deployment and ergonomics

The installer sets up uv, a venv, Ollama and a starter model. Everything runs offline with a local model. The document store needs the compiled Rust extension and raises an actionable error without it (src/openjarvis/tools/storage/_stubs.py:17-39). Connector embeddings need a local embedder and fall back to lexical rows. No API key is needed to store anything. The fact file and the Markdown are readable and can be repaired by hand, which is the only way to remove one fact.

4. Essential Implementation Paths

  • Capture. publish_completed_exchange fires after a jarvis chat turn and after each server completion (src/openjarvis/cli/chat_cmd.py:559-564, src/openjarvis/server/routes.py:364-410, :832, :962, :1131). jarvis ask, the SDK, chat channels and managed agents publish nothing.
  • Extraction and gate. MemoryService._process scans the exchange, extracts, scans each fact and stores by tier (src/openjarvis/memory/service.py:212-243).
  • Fact read. load_configured_facts for ask, the SDK and the orchestrator; list_facts for chat and the server, filtered downstream (src/openjarvis/memory/store.py:423-443).
  • Context assembly. inject_context filters by tier, then by score, budgets facts against documents and merges into one leading system message (src/openjarvis/tools/storage/context.py:141-237).
  • Review. jarvis memory list and jarvis memory trust (src/openjarvis/cli/memory_cmd.py:207-269).
  • Documents. jarvis memory index replaces by source; the HTTP route and the memory_index tool append (:92-124, src/openjarvis/server/api_routes.py:336-383, src/openjarvis/tools/storage_tools.py:292-296).
  • Connector ingest. IngestionPipeline.ingest compares chunk hashes and rewrites a changed document (src/openjarvis/connectors/pipeline.py).
  • Connector search. HybridSearch.search for research, KnowledgeStore.retrieve for the tool (src/openjarvis/connectors/hybrid_search.py:327-470, src/openjarvis/connectors/store.py:340-474).
  • Operator state. _recall_state, _auto_persist_state, _load_session and _save_session (src/openjarvis/agents/operative.py:258-325, src/openjarvis/agents/monitor_operative.py:681-755).
  • Managed-agent tick. The executor's own retrieval (src/openjarvis/agents/executor.py:690-742).

5. Memory Data Model

Fact. text, source, created_at, trust (src/openjarvis/memory/store.py:127-135). source is always auto. The event that carries the exchange names its origin, cli.chat or server.chat, and the handler drops it (src/openjarvis/memory/service.py:139-145). A fact therefore names no session, turn, speaker or model, and nothing ties it to the text it came from.

Document. id, content, source, metadata, created_at (sqlite.rs:59-65). The trust filter reads metadata["trust"].

Connector chunk. Twenty-two columns including author, participants, timestamp, thread_id, content_hash, embedding_model_version and deleted_at. Four queries filter on deleted_at IS NULL and nothing in the tree sets it, so a message deleted at its source stays in the index until the connector is disconnected.

Graph. KnowledgeGraphMemory defines entities and relations and registers as a backend, but the package that loads backends does not import it (src/openjarvis/tools/storage/__init__.py:17-23). The four kg_* tools start with no backend, and neither dependency injector gives them one (src/openjarvis/system/builder.py:537-561, src/openjarvis/agents/tool_resolver.py:230-262). Every call answers "No knowledge graph backend available." The knowledge_curator operator names three tools, knowledge_add_entity among them, that do not exist.

Scope. No user, project or agent key exists on a fact or a document. A named persona is a directory, and the tools that edit memory always target the default one, as docs/user-guide/agents.md:83 says.

Time. One record time per row. A connector timestamp is when a message was sent. There is no validity interval.

6. Retrieval Mechanics

Facts are not searched. Every recallable fact is a candidate on every turn, newest first, until a budget of 2,048 whitespace words is spent, or half of it when documents also matched (src/openjarvis/tools/storage/context.py:184-199). A large document may then evict all facts (:205-213). At 1,000 facts of ten words the oldest are never seen, however relevant.

Documents are ORed query words with Porter stemming, BM25 with content at 1.0 and source at 0.5, top 5, no relevance floor by default (sqlite.rs:190-219). A common word in the question is enough for a hit.

Connector search applies person, time and source filters in SQL, runs BM25 and a brute-force cosine scan, fuses by reciprocal rank and attaches the surrounding thread. The filters are arguments the model chooses. It is the strongest retrieval in the tree, and only research agents use it.

The trust filter is on one document read. inject_context drops a document tagged untrusted. The managed-agent executor calls memory_backend.retrieve and format_context itself and does not (src/openjarvis/agents/executor.py:722-742). Neither do the retrieval, memory_search and memory_retrieve tools. This changes nothing at this commit, because no in-tree writer sets a document's tier: the only way to set it is for an HTTP client to label its own upload in the request metadata (src/openjarvis/server/api_routes.py:237-246).

Injection is automatic on chat, ask, SDK and server calls. The block is merged into the first system message and changes with the question's document hits, so a provider's prefix cache breaks from there. The Markdown files sit in a frozen prefix built once per session.

7. Write Mechanics

The whole exchange is dropped on a shell pipe. A comment says a "pasted shell one-liner" is ordinary developer traffic and still extracted (src/openjarvis/memory/service.py:198-205). The scanner rates |, ; or && before rm, curl, bash, sh, python or perl as HIGH, in Python and in Rust (src/openjarvis/security/injection_scanner.py:55-61, rust/crates/openjarvis-security/src/injection.rs:56-63). HIGH is the level that drops. The test that covers this case hands the service a fake scanner that calls the same text medium (tests/memory/test_memory_service.py:171-186). A developer who pastes an install line, or whose assistant answers with one, loses that turn's facts with an info log line.

The gate is eleven regular expressions. Text that instructs without using one of those phrasings is stored auto. The assistant's reply is part of the extraction input, so a web page the assistant quotes is too. The prompt asks the model to ignore what the assistant says about itself, and nothing enforces it.

A promotion does not stick. add treats a flagged duplicate of a recallable fact as a new hostile derivation and sets untrusted. trusted is recallable, and the scanner is deterministic, so the same text is flagged each time. A user whose pipeline must "base64 encode and send" reports trips a medium pattern, promotes the fact, and loses it the next time the subject comes up. The committed test pins the downgrade from auto (tests/memory/test_fact_store.py:415-424) and no case starts from trusted.

One fact cannot be removed. The CLI has list, trust and clear. There is no HTTP route, tool or app view for facts. clear unlinks the file, quarantine included, and the next exchange may extract the same strings as auto.

Operator agents write to nothing. On each tick both agents call:

  • self._memory_backend.store(state_key, summary). SQLiteMemory.store is store(content, *, source, metadata), so the second positional argument is a TypeError, caught and logged at debug.
  • self._session_store.save_message(session_id, {...}). The real method is save_message(session_id, role, content) (src/openjarvis/sessions/session.py:199-207), so this is a TypeError too. Sessions are off by default.
  • _load_session keeps only dict messages, and the store returns SessionMessage objects (src/openjarvis/agents/operative.py:281-288).

monitor_operative adds causality, scratchpad and structured-JSON extraction, all through the same call; its default mode spends a model call per tool result of 50 characters or more and discards the output. The one class whose signature matches is KnowledgeGraphMemory, which is never registered.

Recall is worse than empty. _recall_state calls retrieve("operator:<id>:state"). The Rust store splits that on punctuation and ORs the words. Under Porter stemming operator and operative match "operations", and state matches any use of the word; I confirmed both against an FTS5 table with that tokenizer. The list of results is converted with str() and placed in the system prompt as Previous State, with no tier filter, score floor or word budget.

What a managed agent keeps is summary_memory, its last output to 16,000 characters. The next tick sees its first sentence, to 200 characters. A comment says the full response was removed from the prompt because "cross-tick continuity now lives in the agent's session_store / memory_backend" (src/openjarvis/agents/executor.py:637-663). A failed tick overwrites the summary with ERROR: and the message.

A model that follows the operator prompt does no better. The prompts say to call memory_store with a key. The tool has no key parameter. The content is stored as an unlabelled document, and the agent, seeing the key in the arguments, marks state as saved and skips its own attempt (src/openjarvis/agents/operative.py:193-198).

Operational cost

Fact extraction is one model call per turn on a background thread, and a fact is retrievable when that call returns. The queue holds 256 and drops on overflow. stop waits two seconds and the thread is a daemon (src/openjarvis/memory/service.py:71-94), so leaving a chat right after a turn discards that turn unless the local model answers within two seconds. Every fact write rewrites the file. No background pass rereads the store.

8. Agent Integration

The model has no verb over facts. They appear in its prompt and it cannot list, correct or add to them. Documents are reachable through memory_store, memory_search, memory_retrieve and memory_index, which the operator and monitor presets enable. memory_manage and user_profile_manage read, add, replace or remove lines in the Markdown files and appear in no config, recipe, template or operator in the tree. SessionExpiryHook, which would ask an agent to save memory before a session resets, is constructed only in its test. The nudge_interval setting is read by nothing that nudges.

So on a default install nothing is remembered automatically: [memory] is off, the tools are off, and the Markdown files hold their seeds. The showcase page describes the opposite (docs/showcase/persistent-memory.md), and the user guide says the tools apply "when those are enabled".

The learning loop is separate. jarvis optimize skills turns traces into per-skill overlays, a description and example inputs and outputs, that reach later prompts. It is a command a person runs, and the overlay records its optimizer and trace count.

9. Reliability, Safety, and Trust

The tier guards one door

The gate protects the facts file. memory_store, POST /v1/memory/store, document indexing, connector sync and memory_manage write text that reaches prompts and none of them is scanned on the way in. A hostile mail is indexed as it is. The injected block introduces documents as context "to inform your response" inside the system message.

Fail-open and fail-closed, each on purpose

The scanner failing to load or raising lets facts through as auto, so an outage does not silence memory (src/openjarvis/memory/service.py:169-189). An unknown tier, or metadata that is not a mapping, is withheld. A third-party store that cannot hold a tier is never given a quarantined fact (src/openjarvis/memory/store.py:168-179). The three choices are stated in comments and tested.

Swallowed errors

Every memory failure is designed not to break a reply, and most are logged at debug. That policy is why the operator defect is invisible: the document store raises on every tick and the operator sees a normal run.

Concurrency and privacy

The fact store takes an OS lock around load, modify and replace, and tests it with separate processes. jarvis memory trust compares the text under that lock. The server binds to loopback and requires a bearer key only when one is configured. data_boundary_audit.py reads the config and reports as a failure any setup where memory injection is on and a cloud engine is active (:852-877).

Marks withheld

  • tombstone. The near miss is close. An untrusted row is keyed on its lowered text and a later clean extraction of that text is refused, with a test. It records that a scanner matched, not that anyone rejected the value; no verb lets a person reject one; and it is lost to FIFO eviction and to clear.
  • scope_enforced. Facts and documents have no scope key. The connector source filter is optional and the model fills it in. Sessions are keyed by sender and hold conversation. A managed agent's summary is one column on its own row.
  • audit_log. Stores publish MEMORY_STORE events that nothing subscribes to. The trace records retrievals and not writes. agent_learning_log records query timings.
  • bitemporal. One record time, and no validity field.

10. Tests, Evals, and Benchmarks

The fact store's tests are the best in the memory code: multi-process adds, a clear racing an add, a promotion whose row was replaced, unknown tiers, and an end-to-end case from service to prompt. The negative cases hold a clean fact beside each hostile one, and CI runs them.

The operator tests pass because their fakes have the agents' signature. FakeMemoryBackend.store(key, value) and FakeSessionStore.save_message(session_id, message) (tests/operators/test_operators.py:41-72) match the callers and not the stores, and no test under tests/operators or tests/agents constructs SQLiteMemory or the sessions module. With SQLiteMemory in place of the memory fake, test_run_auto_persists_state would fail.

tests/memory/test_retrieval_quality.py checks keyword hits on a small corpus. No LongMemEval or LoCoMo harness is in the tree. The eval suite loads AMA-Bench, whose protocol there is long-context packing of a trajectory, and LifelongAgentBench. No result file for either is committed.

The paper, arXiv:2605.17172 (16 May 2026), treats Tools & Memory as one editable primitive and measures whole agents on eight benchmarks. I read its abstract and part of its HTML and found no memory or retrieval ablation, no fact extraction and no knowledge graph; the fact store postdates its submission.

Missing before relying on it: an operator tick against the real stores; the real scanner on ordinary shell text; a promotion followed by re-extraction; the document tier through the executor and the tools.

11. For Your Own Build

Steal

  • Filter by tier at the loader and again where the prompt is built, and treat an unknown value as withheld. A caller that skips one filter still meets the other.
  • Promote what was reviewed, not what sits at an index. Pass the text the person saw and refuse if it changed.
  • Never auto-promote. Let a hostile derivation downgrade and let only a person raise.
  • Give a store that cannot keep provenance only the clean records. The base class drops a quarantined fact for a legacy backend.
  • Report memory plus cloud as one finding. Each setting is fine alone and the combination is what sends local memory out.

Avoid

  • Fakes written to the caller's signature. A stub that accepts what the code passes tests nothing about the store. Build the fake from the interface, or use the real store on a temporary path.
  • Swallowing a TypeError as if it were an outage. Best-effort writes should tolerate I/O failures and fail loudly on a call that can never succeed.
  • Using a search index as a key-value store. A key sent to a text search returns something, and the caller cannot tell it from its own state.
  • A stricter rule that outranks a person. A downgrade needs to know that a human already ruled on that exact text.
  • A read filter shipped before its writer. It reads as protection on documents and no document carries the field.

Fit

OpenJarvis suits someone who wants a whole local assistant and treats memory as one of its parts. Switched on, the fact store is adequate for a single person with a few hundred preferences, who accepts that corrections mean editing a file.

The connector index with hybrid search is the part that earns its place: personal data, local, filtered by person and date. Scheduled agents that must remember what they did last time should not be built on it at this commit. Several people behind one server share one memory, and nothing here separates them.

12. Open Questions

  • Has any operator deployment been observed to resume from stored state?
  • Is the default meant to become [memory] enabled = true, and is that when the Markdown files and the fact file will be reconciled?
  • Which component is meant to write a document's tier?
  • How often does the real scanner drop an exchange in developer use?

Appendix: File Index

  • Fact store: src/openjarvis/memory/store.py, service.py, extractor.py
  • Scanner: src/openjarvis/security/injection_scanner.py, rust/crates/openjarvis-security/src/injection.rs
  • Documents: src/openjarvis/tools/storage/sqlite.py, context.py, hybrid.py, knowledge_graph.py, __init__.py, rust/crates/openjarvis-tools/src/storage/sqlite.rs
  • Connector data: src/openjarvis/connectors/store.py, pipeline.py, hybrid_search.py
  • Agents: src/openjarvis/agents/operative.py, monitor_operative.py, executor.py, manager.py, tool_resolver.py
  • Sessions and prompt: src/openjarvis/sessions/session.py, src/openjarvis/prompt/builder.py, src/openjarvis/daemon/session_expiry.py
  • Surfaces: src/openjarvis/cli/memory_cmd.py, chat_cmd.py, ask.py, src/openjarvis/server/routes.py, api_routes.py, src/openjarvis/tools/memory_manage.py, storage_tools.py
  • Tests: tests/memory/test_fact_store.py, test_memory_service.py, test_context.py, tests/cli/test_memory_cmd.py, tests/operators/test_operators.py

Recorded searches

Run from the repository root at the pinned commit with /usr/bin/git grep.

  • No writer of a document's tier. git grep -n -E '"trust"' -- src rust/crates returns the CLI command, the fact loader and the two lines of the context filter.
  • deleted_at is never set. git grep -n -w deleted_at -- src rust/crates returns the schema, the migration, reads and a tool description.
  • No other backend takes a key. git grep -n -A4 -E 'def (store|retrieve)\(' -- src/openjarvis/tools/storage shows keyword-only arguments after the first everywhere but knowledge_graph.py.
  • The graph backend is not imported. git grep -n -E 'openjarvis\.tools\.storage\.knowledge_graph|KnowledgeGraphMemory' -- src returns its own file and two imports of Entity and Relation.
  • Operator tests use no real store. git grep -n -E 'SQLiteMemory|sessions\.session' -- tests/operators tests/agents returns nothing; the same pattern on tests/memory matches.
  • The expiry hook has no caller. git grep -n SessionExpiryHook -- src tests returns the class and its test.
  • nudge_interval drives nothing. git grep -n nudge_interval -- src returns two declarations and two copies.
  • The Markdown tools are in no preset. git grep -n -E 'memory_manage|user_profile_manage' -- configs src/openjarvis/recipes src/openjarvis/templates src/openjarvis/operators src/openjarvis/agents/templates src/openjarvis/cli returns nothing; on src/openjarvis/tools it matches.
  • No caller deletes a document. git grep -n -E '(^|[^_])(backend|mem|memory_backend|_backend)\.(delete|clear)\(' -- src returns nothing.
  • No scope key. git grep -n -E 'user_id|tenant|project_id' -- src/openjarvis/memory src/openjarvis/tools/storage src/openjarvis/connectors/store.py returns nothing; on src/openjarvis/sessions it matches.
  • No subscriber to memory writes. git grep -n -E 'MEMORY_STORE' -- src returns publishers, the enum and a prompt string.
  • No memory benchmark. git grep -n -i -E 'longmemeval|locomo' -- src docs tests README.md returns nothing.
  • No submodules. .gitmodules is absent.

History

2026-12-01 — 3b143af8…. First reading, read at the user's request, from a shallow clone at the head of main, read only. Screened before reading: no auto-run surface; five manifests or lockfiles inside the seven-day cooldown; a Makefile, one build.rs and eight conftest.py files; two floating manifests. A shallow clone dates files to the fetched history, so the cooldown count is an upper bound. The memory, storage, connector store, operator agents and their tests were read; the connectors themselves, the desktop app, the learning trainers and most of the eval suite were not. Nothing was installed, built or run; one FTS5 tokenizer check used a separate script. Three marks: trust_state, human_review, negative_eval.