Skip to main content Switch to mobile version memoraos 0.4.0 Local-first adaptive memory engine for AI agents: hybrid retrieval, temporal facts, evidence-grounded answers, and a reproducible benchmark lab.
pip install memoraos==0.4.0 Copy PIP instructions
The memory engine that knows when a fact was true, shows where it came from, and says "I don't know" when it doesn't.
A local-first, evidence-verifiable temporal memory engine for AI agents. No API key · no cloud · one SQLite file (optionally AES-256-GCM encrypted) · optional Docker image · every claim backed by a reproducible benchmark
Quick start · The evidence · How it works · Dashboard · Examples · Limitations · Full evidence · API
Measured on real data, scored by a mechanical judge (no LLM), regenerated by one command each. Full tables, questions and failures: docs/EVIDENCE.md.
Honest scope. On real prose MemoraOS ties a well-tuned RAG baseline on accuracy (59.4% vs 65.6%, intervals overlap); its edge is change over time, evidence and abstention. The synthetic benchmark is saturated. Details: Limitations and docs/EVIDENCE.md.
Vector search over chat history and documents fails in predictable ways: it returns last year's value next to this year's, mixes up sources that disagree, cannot say what was true on a given date, and answers confidently when memory is silent. MemoraOS treats each of those as a first-class requirement.
pip install memoraos # from PyPI; extras: memoraos[api], memoraos[encryption] To run the benchmarks and tests, install from a checkout instead:
git clone https://github.com/ParthivPandya/MemoraOS.git && cd MemoraOS python -m venv .venv && .venv\Scripts\activate # Linux/macOS: source .venv/bin/activate pip install -e ".[dev,api]" The snippet below uses only real data that ships in this repository: the project's security document and the CPython release history copied from three PEPs.
import json from pathlib import Path from memoraos import MemoryOS memory = MemoryOS.local() # one SQLite file in ./.memoraos: no network, no API key me = "me" # 1. A real document, stored as written memory.remember(Path("docs/SECURITY.md").read_text(encoding="utf-8"), user_id=me, source_type="document", origin="docs/SECURITY.md") # 2. Real dated facts: the CPython release history from PEP 693, 719 and 745 for rec in json.loads(Path("data/python_releases.json").read_text(encoding="utf-8"))["records"]: memory.remember_json({k: rec[k] for k in ("subject", "predicate", "object", "valid_from")}, user_id=me, origin=rec["source"]) for question in ( "Is encryption at rest implemented in code?", "What is the latest version of Python 3.14?", "What was the latest version of Python 3.14 in March 2026?", "What was the latest stable version of Python before October 2024?", "Which Kubernetes version does MemoraOS require?", ): r = memory.recall(question, user_id=me) print(f"{question}\n {r.status} | {r.strategy} | {r.answer}") if r.evidence: e = r.evidence[0] print(f" evidence: {e.kind} | source_type={e.source_type} | reliability={e.source_reliability} | effective={e.effective_at}") Real output of that script, unedited:
Is encryption at rest implemented in code? answered | hybrid | - **Encryption at rest** is opt-in and implemented in code with AES-256-GCM (see [Encryption at rest](#encryption-at-rest)). evidence: passage | source_type=document | reliability=0.7 | effective=None What is the latest version of Python 3.14? answered | exact | 3.14.10 evidence: fact | source_type=structured | reliability=0.85 | effective=2026-10-26T00:00:00.000000Z What was the latest version of Python 3.14 in March 2026? answered | temporal | 3.14.3 evidence: fact | source_type=structured | reliability=0.85 | effective=2026-02-03T00:00:00.000000Z What was the latest stable version of Python before October 2024? answered | temporal | 3.12 (effective 2023-10-02) evidence: fact | source_type=structured | reliability=0.85 | effective=2023-10-02T00:00:00.000000Z Which Kubernetes version does MemoraOS require? insufficient_evidence | vector | The stored memory does not establish an answer to this question. Four things happened there: the same engine answered from a document and from dated facts; it picked a different strategy for each question (hybrid, exact, temporal); every answer carries the evidence that supports it; and the question about something the documents never mention was refused instead of invented. Answers from documents are extractive passages, as written.
Also available: explain(), history(), recall(as_of=...), correct(), forget(), consolidate(), reflect(), evaluate(). Full reference: docs/API.md.
memoraos keys create --tenant default --role admin # prints an API key once memoraos serve # REST API on http://127.0.0.1:8000 (docs at /docs) python -m pytest # 335 tests memoraos ci run contracts/python_releases_and_security.json # Memory CI regression contract python -m benchmarks.public locomo --help # public retrieval runs (download the data first, see docs/PUBLIC_BENCHMARKS.md) docker compose up --build # optional container, see docs/DOCKER.md python -m benchmarks.real_docs # real documentation benchmark python -m benchmarks.real_temporal # real PEP release-date benchmark python -m benchmarks.run # synthetic suite, about 2 minutes python scripts/make_figures.py # regenerate every figure in docs/assets from the reports python examples/temporal_memory/main.py # also: basic_memory, hybrid_rag, multi_agent, research_memory cd apps/dashboard && copy .env.example .env.local && npm install && npm run dev # http://localhost:3000 cd sdk/typescript && npm install && npm test # TypeScript SDK MEMORAOS_USER_ID=user_001 memoraos mcp # MCP server over stdio (client setup: docs/MCP.md) Put the API key printed above into MEMORAOS_API_KEY in apps/dashboard/.env.local. The dashboard keeps it server-side. To fill the dashboard with the same real data used in the screenshots below: python scripts/seed_real.py .
Four benchmarks: two on real data, one on public datasets and one synthetic guard. Each one is a command you can run, and each report lists the questions, the data and the failures. The point of publishing the losing rows is that a number you cannot check is not worth much.
1. Real dated data: change over time
benchmarks/real_temporal.py · 14 real dated release records from PEP 693, 719 and 745 · 21 questions (current, previous, "on this date", and unanswerable), gold answers computed from the real dates.
A retriever sees ten near-identical sentences and cannot know which is current. MemoraOS orders facts by effective date, so the three question types are three different queries over the same facts. Forcing it back to plain retrieval removes the advantage, so the gain comes from the temporal fact engine, not the search primitives. Small set, one fact family, templated sentences: this checks the mechanism on real dates, not general superiority.
2. Real documentation: precision against recall
benchmarks/real_docs.py · the project's own docs (26 files, 126 sections, used as written) · 46 answerable + 18 unanswerable questions, a dev set and a held-out set written before any fix · integrity checks abort the run if a gold answer is missing from the corpus, an "unanswerable" term is present, or a question is quoted in the corpus.
The systems fail in opposite ways: RAG answers almost everything, including questions the documents never address; MemoraOS answers less and is wrong less. Neither dominates, so the position on that curve is a published setting (min_anchor_coverage), not a hidden one. Every answer here is an extractive passage, and five of the 18 unanswerable questions were still wrongly answered (the list).
The benchmark found real bugs. MemoraOS scored 35.7% on the dev set the first time. Diagnosing it with explain() exposed a negation guard that dropped whole sections, answers limited to one sentence, an over-strict attribute guard, a mis-routed temporal cue and mid-sentence chunk overlap, several of them regressions from earlier v0.2 work. Each has a regression test (tests/unit/test_real_text_regressions.py) and the dev score went 35.7% → 64.3% (held-out 50.0% → 50.0%). The temporal benchmark then found two more (a version-qualified subject matching the unqualified subject's facts, and a passage without the named version still answering). A later fix made the stemmer treat rotate and rotates as one word (pip install memoraos users hit it on the first try); on this benchmark it won two answerable questions and lost one, and two unanswerable questions that used to be refused by accident (require did not match required) are now answered. All listed in docs/RETRIEVAL.md.
3. Synthetic suite: a regression guard, saturated
python -m benchmarks.run · 19 generated scenarios × 3 seeds · digest fca60a1fe780.
MemoraOS scores 100% in every scenario, and the RAG baselines score 58-65%. Because the same authors wrote the datasets and the system, a perfect score means the suite no longer discriminates; it still fails loudly when a mechanism regresses, and it is how the temporal, update, contradiction, multi-hop and abstention mechanisms are checked. It is not evidence of general superiority, which is why the two real-data benchmarks above exist. Scenario heatmap, degradation curve and cost chart: REPORT.md.
The accuracy has a price: more work per write and per query, and a larger store on small texts. Absolute timings vary by machine; read the ratios in the report.
4. Public datasets: retrieval only, and plain BM25 is as good
benchmarks/public.py runs the independent LoCoMo and LongMemEval datasets (downloaded locally, not redistributed) through the same retrievers. It scores whether the gold evidence turn or session is in the top-k, with no answer generation, so it is not comparable to published QA scores.
MemoraOS's retriever beats hybrid RAG on LoCoMo (paired, k=5: 35 questions won vs 13 lost, exact sign test p = 0.002) but does not beat plain BM25 on either dataset. The temporal and abstention advantages above do not show up when a benchmark only asks for retrieval. Neural embedders were not run here. Details, caveats and the LoCoMo licence (CC BY-NC 4.0): docs/PUBLIC_BENCHMARKS.md.
Not measured: the optional LLM extractor on a real model, neural embedders on the public sets, rerankers, and every external system (Mem0, Graphiti, Hindsight, Memorilla); a sourced capability comparison is in docs/COMPETITIVE_INTELLIGENCE.md. The default embedder is lexical feature hashing. Method and scoring rules: docs/BENCHMARK_METHODOLOGY.md.
One engine sits behind every interface (Python, REST, MCP, CLI, TypeScript SDK, dashboard). Writes go through redaction, chunking, classification, grounded fact/entity/date extraction, deduplication and cached embedding. Reads go through query analysis, the router, one or more retrieval strategies and the truth engine, and end either in an answer with evidence or in insufficient_evidence. Everything persists in a single SQLite file. Details, schema and risk register: docs/ARCHITECTURE.md.
A deterministic router scores each question, picks the cheapest strategy among the best, and lists fallbacks. The decision is returned on every result (plan, strategies_tried) and explained by explain(recall_id). The figure below was produced by running the real router on a store holding the project's docs and the PEP release data.
Strategies run in order until one produces supported evidence. Feedback-driven learning exists but is off by default and cannot trade accuracy for cost. See docs/ADAPTIVE_ROUTING.md.
Facts carry valid time (when they were true) and system time (when MemoraOS learned them). The figure records the three releases in a deliberately shuffled order and the answers still resolve by valid time; the answers shown were computed by the engine. as_of= reconstructs only what had been recorded by then. Rules for conflicts, version changes and reliability: docs/TEMPORAL_MEMORY.md.
Questions that chain several facts ("which region does the project this person manages run in?") are answered by a bounded, typed path search over stored facts. Every step must be a stored fact with a source memory, followed in the right direction; a missing or contradicted step yields insufficient_evidence or conflict, never a plausible guess. Confidence is the minimum over the steps. See docs/RETRIEVAL.md.
Treat memory like code: write down what it must answer, what it must refuse and what must stay isolated, then run it after every change to extraction, embeddings, routing or configuration. memoraos ci run contract.json --baseline previous.json exits 1 and reports which expectations broke, whether abstention got worse and whether a question that must be refused is now answered. This is the real output of the shipped contract (contracts/python_releases_and_security.json: the PEP release history plus this repository's security document):
Memory CI: suite 'python-releases-and-security-docs' (strict, hashing-v1) 7/7 assertions passed; mean 51 context tokens, 7.2 ms PASS latest-now: What is the latest version of Python 3.14? PASS previous-stable: What was the latest stable version of Python before October 2024? PASS encryption-at-rest: Is encryption at rest implemented in code? PASS refuses-unknown-version: What is the latest version of Python 3.15? PASS other-user-sees-nothing: What is the latest version of Python 3.14? ... 2 more Tested with an injected regression (disabling evidence fusion on a multi-hop contract is reported as a regression). It finds only what you wrote down; automatic triggers on schema or provider changes are not implemented. Guide: docs/MEMORY_CI.md.
Answerability policies (opt-in, not shown to help)
Settings(answerability=...) offers strict (default), balanced, high_recall and extractive_only. A failure analysis showed that 15 of the 22 missed answerable questions were retrieved correctly and then refused by a lexical support check, so section-level and (with a neural embedder) semantic support were added. They improved the design set but did not reliably improve an independent validation set, so the default is unchanged and no improvement is claimed. All numbers, including the one that went the wrong way: docs/NEXT_ANSWERABILITY.md.
Opt-in (install with pip install "memoraos[encryption]"): MemoryOS.local(settings=Settings(encryption_passphrase="...")), or set MEMORAOS_ENCRYPTION_KEY (the only way the CLI takes it). The database is stored as an AES-256-GCM file (scrypt-derived key; layout MOSENC01 | salt | nonce | ciphertext). The working copy lives in memory and every commit atomically rewrites the encrypted file, so write cost grows with database size. Wrong keys and tampered files are rejected. memoraos encrypt / decrypt convert an existing database; they do not touch old plaintext sources/ or .bak files, and there is no key recovery. Needs Python 3.11+. Tests: tests/unit/test_encryption.py. Details: docs/SECURITY.md.
docker compose up --build runs the REST API from a non-root container with the data in a named volume. Everything above works without it. See docs/DOCKER.md.
Episodic (what happened), semantic (facts, preferences), procedural (how-to), temporal (values over time), relational (entity graph, multi-hop) and latent (experimental, see below). Design details: docs/MEMORY_DESIGN.md.
A Next.js dashboard renders live data from the REST API; the API key never reaches the browser. The screenshots below were captured from a real instance holding the project's own documentation (122 sections) and the 14 PEP release facts, after asking 68 real questions (scripts/seed_real.py, scripts/capture_dashboard.py).
The contradiction explorer is empty on this data because none of the real facts conflict, and the knowledge-graph view is noisy on raw prose; both are shown as they are in docs/EVIDENCE.md.
Every example runs on real data (the project's own documents and the PEP release history) and is covered by an integration test.
Compared with other systems
Documented capabilities only; "not documented" means we did not find it in the primary sources, not that it is absent. Sources, licenses and unverified claims: docs/COMPETITIVE_INTELLIGENCE.md and docs/RESEARCH_AND_COMPETITIVE_ANALYSIS.md.
Those projects are mature and often stronger at semantic extraction. MemoraOS's niche is local, inspectable, temporally correct memory that abstains. MemoraOS is not Memorilla: its latent-memory module is an interface plus a CPU k-means baseline, with no trained module and no claimed benefit (docs/LATENT_MEMORY.md).
Every Evidence carries span_start, span_end and quote_sha256; mem.verify_citations(res.evidence, user_id=...) (or POST /v1/verify-citations) re-checks each quote against the stored memory and the retained source and flags anything edited, missing or never verbatim. On the project's own docs, all 34 answered questions had citations that verified (3 of them also had an excerpt that was not a verbatim span), and 28 of 34 had a cited quote containing the gold string. This proves the quote exists unchanged in what MemoraOS stored; it does not prove the quote supports the answer and it does not change accuracy. See docs/CITATIONS.md.
Agent workflow: outcomes, hypotheses, Claude Code hook
remember_outcome / outcome_warnings (MCP: memora_outcome, memora_warnings) record failed attempts and warn when a similar action comes up again; verification="hypothesis" stores unchecked guesses as flagged, lower-reliability memory; memoraos hook install claude-code --user me stores the last exchange of each Claude Code response as hypotheses. Warnings use lexical overlap, the hook has not been run in a real Claude Code session, and none of this is benchmarked. See docs/AGENT_WORKFLOW.md.
Read these before relying on MemoraOS.
On real prose it is not ahead of RAG. It ties on accuracy, answers fewer answerable questions and refuses more unanswerable ones (evidence). Its advantage is concentrated in questions about change over time, and in abstention.
The synthetic benchmark is saturated and project-authored. The real-data benchmarks are small and project-authored too (64 and 21 questions, wide confidence intervals); no independent benchmark has been run.
Fact extraction is deterministic English rules by default. v0.2 handles negation, corrections, conjunctions and value normalization, and offers an optional LLM extractor whose output is grounded and validated against the source text. That LLM path is tested only with scripted fakes; its quality on real models is unmeasured. Implicit statements still need it.
Answers are extractive passages, not written prose; they can include neighbouring sentences or a table row. synthesize=True with a chat provider gives fluent text, but that path is not benchmarked.
Default embeddings are lexical (feature hashing). OllamaEmbedder, OpenAICompatEmbedder and SentenceTransformerEmbedder exist but are not benchmarked; entity/exact retrievers, query expansion and reranking are off by default because none improved the full pipeline in the ablation.
Latent memory is an interface plus a CPU baseline. No Memorilla reproduction exists in this repository.
Confidence is not a probability. On answered real-document questions the stated confidence (evidence_coverage) has an expected calibration error of about 0.23 to 0.27; use it for ordering, not as a likelihood.
Public retrieval benchmarks do not favour it. Plain BM25 matches or beats MemoraOS on LoCoMo and LongMemEval retrieval (section 4); its value is temporal correctness, evidence and abstention, not better ranking.
Without extracted facts, the passage fallback is only a heuristic for recency. When two near-identical statements conflict ("The customer plan is Professional." then "... Enterprise."), a recency-aware preference picks the later one, but it is covered by a few tests, not a benchmark. Phrase facts so extraction recognises them or store them with remember_json.
Vector search is exact brute force by default, which was fast enough in the measured runs (docs/SCALING.md). An opt-in IVF index exists but its recall@10 was only 0.52-0.93 with the hashing embedder and it is unmeasured with neural embedders, so it is off.
Encryption at rest is opt-in and rewrites the whole file on each commit; backups and plain sources/ copies are not rewritten on delete or encryption. See docs/SECURITY.md and docs/PERFORMANCE.md.
Not delivered: the real-LLM extractor is unmeasured (no model was available), and lifecycle controls, change sets, connectors and the Memorilla adapter remain deferred (status).
Test data. Unit and integration tests and the synthetic benchmark generators use controlled inputs by necessity. They are fixtures, not evidence.
CI status. The workflow in .github/workflows runs on ubuntu and windows with Python 3.10, 3.12 and 3.13, plus a security job and a TypeScript job. The run for the commit that added encryption, Docker and the public benchmarks failed on Python 3.10 because one new test compared a float to exactly 0.0; commit 226975b fixed that and made CI install the encryption extra, and all 8 jobs passed on it. Encryption needs Python 3.11+, so its tests skip on 3.10. A docker job builds the image on an ubuntu runner and runs scripts/docker_smoke.sh (health, 401 without a key, remember and recall, restart persistence, encrypted file); it passed on commit e6a792d together with the other 8 jobs. Check the Actions tab for the current state; nothing here is a live status.
Evidence · Public benchmarks · Competitive intelligence · Scaling · Docker · Citations · Agent workflow · MCP setup · Memory CI · Answerability · Next: audit · Next: status · Architecture · API · Memory design · Adaptive routing · Temporal memory · Extraction · Retrieval · Latent memory · Benchmark methodology · Research · Security · Performance · Roadmap · Implementation status · v0.2 architecture · Changelog · ADRs
See CONTRIBUTING.md and the Code of Conduct. The most valuable contributions are the ones that make MemoraOS look bad: a benchmark question it answers wrongly, a real document it mis-extracts, an external-system adapter that really runs. Add them with the real source text and they become regression tests. Report vulnerabilities privately: SECURITY.md.
Author: MemoraOS contributors
Both files in this release have provenance metadata.
Apache Software License (Apache-2.0)
ai memory agents rag knowledge-graph temporal mcp local-first
Development Status 3 - Alpha
Intended Audience Developers
License OSI Approved :: Apache Software License
Programming Language Python :: 3
Topic Scientific/Engineering :: Artificial Intelligence
Release files for memoraos 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 343.7 kB
Release files / memoraos-0.4.0.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Release files / memoraos-0.4.0-py3-none-any.whl
Security for memoraos 0.4.0
Both files in this release have been uploaded with provenance metadata.
With provenance memoraos-0.4.0.tar.gz Nov 25, 2026
With provenance memoraos-0.4.0-py3-none-any.whl Nov 25, 2026
Attestation for memoraos-0.4.0.tar.gz
Attestation for memoraos-0.4.0-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Nov 25, 2026 2 release files Full provenance
Nov 20, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




