Metadata-Version: 2.4
Name: memoraos
Version: 0.2.1
Summary: Local-first adaptive memory engine for AI agents: hybrid retrieval, temporal facts, evidence-grounded answers, and a reproducible benchmark lab.
Author: MemoraOS contributors
License: Apache-2.0
Project-URL: Homepage, https://github.com/ParthivPandya/MemoraOS
Project-URL: Issues, https://github.com/ParthivPandya/MemoraOS/issues
Project-URL: Documentation, https://github.com/ParthivPandya/MemoraOS/tree/main/docs
Keywords: ai,memory,agents,rag,knowledge-graph,temporal,mcp,local-first
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: networkx>=3.0
Requires-Dist: pydantic>=2.5
Requires-Dist: httpx>=0.25
Provides-Extra: api
Requires-Dist: fastapi>=0.110; extra == "api"
Requires-Dist: uvicorn>=0.27; extra == "api"
Provides-Extra: encryption
Requires-Dist: cryptography>=42; extra == "encryption"
Provides-Extra: yaml
Requires-Dist: pyyaml>=6; extra == "yaml"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Dynamic: license-file

<p align="center">
  <img src="docs/assets/banner.png" alt="MemoraOS: don't just give AI a bigger context window, give it a better memory" width="100%" />
</p>

<h3 align="center">The memory engine that knows <i>when</i> a fact was true, shows <i>where</i> it came from, and says "I don't know" when it doesn't.</h3>

<p align="center">
  A local-first, evidence-verifiable temporal memory engine for AI agents.<br/>
  No API key · no cloud · one SQLite file (optionally AES-256-GCM encrypted) · optional Docker image · every claim backed by a reproducible benchmark
</p>

<p align="center">
  <a href="https://github.com/ParthivPandya/MemoraOS/actions/workflows/ci.yml"><img src="https://github.com/ParthivPandya/MemoraOS/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
  <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/license-Apache_2.0-blue.svg" alt="License: Apache-2.0"></a>
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10%2B-3776AB.svg?logo=python&logoColor=white" alt="Python 3.10+"></a>
  <img src="https://img.shields.io/badge/tests-328_passing-brightgreen.svg" alt="328 tests passing">
  <img src="https://img.shields.io/badge/runs-100%25_local-success.svg" alt="Runs 100% local">
  <img src="https://img.shields.io/badge/status-v0.2_alpha-orange.svg" alt="Status: v0.2 alpha">
  <a href="https://github.com/ParthivPandya/MemoraOS/stargazers"><img src="https://img.shields.io/github/stars/ParthivPandya/MemoraOS?style=social" alt="GitHub stars"></a>
</p>

<p align="center">
  <a href="#quick-start"><b>Quick start</b></a> ·
  <a href="#the-evidence"><b>The evidence</b></a> ·
  <a href="#how-it-works">How it works</a> ·
  <a href="#dashboard">Dashboard</a> ·
  <a href="#examples">Examples</a> ·
  <a href="#limitations">Limitations</a> ·
  <a href="docs/EVIDENCE.md">Full evidence</a> ·
  <a href="docs/API.md">API</a>
</p>

---

## Proof at a glance

Measured on **real data**, scored by a mechanical judge (no LLM), regenerated by one command each. Full tables, questions and failures: [docs/EVIDENCE.md](docs/EVIDENCE.md).

<table>
  <tr>
    <td width="33%" align="center"><h2>21 / 21</h2><b>temporal questions answered</b><br/>on the real CPython release history (PEP 693 · 719 · 745). Best RAG baseline: <b>6 / 21</b>.</td>
    <td width="33%" align="center"><h2>72% vs 28%</h2><b>unanswerable questions refused</b><br/>on the project's own docs. MemoraOS refuses 13 of 18; RAG with an abstention gate refuses 5, plain RAG refuses none.</td>
        <td width="33%" align="center"><h2>~4× fewer</h2><b>evidence tokens per answer</b><br/>169 vs 659 for the best RAG baseline, because MemoraOS returns the supporting sentences, not whole chunks.</td>
  </tr>
</table>

> **The honest half.** On real prose MemoraOS is *not* ahead of a well-tuned RAG baseline: overall accuracy is a statistical tie (59.4% vs 65.6% for RAG with an abstention gate, intervals overlap), and MemoraOS answers fewer answerable questions (25 of 46 vs 37 of 46). It trades recall for fewer wrong answers, and the dial is published. The synthetic benchmark is **saturated** (MemoraOS 100%) and no longer discriminates. See [Limitations](#limitations).

## Why

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.

| The problem | What MemoraOS does |
|---|---|
| **Facts change.** | **Bitemporal facts** (valid time + recorded time). Nothing is overwritten. "Current", "previous" and "on a date" are different queries over the same facts. |
| **Sources disagree.** | **Contradiction analysis.** Version changes resolve; genuine conflicts are reported and never silently picked. |
| **Answers must be trusted.** | **Evidence on every answer** (source id, excerpt, effective date, reliability) and `insufficient_evidence` instead of a guess. |
| **Questions are different.** | An **adaptive router** picks exact, temporal, graph, episodic, procedural, BM25, vector, hybrid or evidence-fusion retrieval, and reports why. |
| **Memory must stay inspectable.** | Originals are never altered; consolidation only adds linked, reversible summaries. Compression never costs you the source. |
| **"What did the agent know on date D?"** | **Time travel** over versions and a hash-chained, tamper-evident event log. |
| **Privacy.** | Tenant and user isolation, secret redaction, hard delete, export, untrusted-data rendering against prompt injection. |

## Quick start

```bash
pip install memoraos            # from PyPI; extras: memoraos[api], memoraos[encryption]
```

To run the benchmarks and tests, install from a checkout instead:

```bash
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.

```python
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:

```text
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](docs/API.md).

<details>
<summary><b>Run everything</b> (API, tests, benchmarks, dashboard, MCP, SDK, examples)</summary>

```bash
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                                       # 328 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 <api-url> <api-key>`.

</details>

## The evidence

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`](benchmarks/real_temporal.py) · 14 real dated release records from [PEP 693](https://peps.python.org/pep-0693/), [719](https://peps.python.org/pep-0719/) and [745](https://peps.python.org/pep-0745/) · 21 questions (current, previous, "on this date", and unanswerable), gold answers computed from the real dates.

| System | Accuracy [95% CI] | current | previous | on a date | unanswerable |
|---|---|---|---|---|---|
| BM25 RAG | 4.8% [0, 14.3] | 0% | 0% | 7.1% | 0% |
| Vector RAG | 28.6% [9.5, 47.6] | 0% | 0% | 42.9% | 0% |
| Hybrid RAG | 19.0% [4.8, 38.1] | 0% | 0% | 28.6% | 0% |
| Hybrid RAG + abstention gate | 19.0% [4.8, 38.1] | 0% | 0% | 28.6% | 0% |
| MemoraOS forced to hybrid retrieval | 38.1% [19.1, 57.1] | 50% | 0% | 28.6% | 100% |
| **MemoraOS** | **100%** [100, 100] | **100%** | **100%** | **100%** | **100%** |

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`](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.

<p align="center">
  <img src="docs/assets/benchmark_real_docs.png" alt="Scatter plot: answerable questions answered correctly versus unanswerable questions refused, for every system. MemoraOS is at the high-refusal end; RAG systems are at the high-recall end." width="92%" />
</p>

| System | All 64 [95% CI] | Answerable answered (46) | Unanswerable refused (18) | Held-out (22) | Evidence tokens |
|---|---|---|---|---|---|
| Hybrid RAG | 57.8% [45.3, 68.8] | 80.4% | 0% | 54.5% | 718 |
| Hybrid RAG + abstention gate | **65.6%** [54.7, 76.6] | **80.4%** | 27.8% | **63.6%** | 659 |
| **MemoraOS (default)** | 59.4% [46.9, 71.9] | 54.3% | **72.2%** | 50.0% | **169** |
| MemoraOS, looser `min_anchor_coverage=0.25` | 67.2% [54.7, 78.1] | 73.9% | 50.0% | 59.1% | 230 |

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](docs/EVIDENCE.md#what-memoraos-actually-returned)).

**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`](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](docs/RETRIEVAL.md).

### 3. Synthetic suite: a regression guard, saturated

`python -m benchmarks.run` · 19 generated scenarios × 3 seeds · digest `fca60a1fe780`.

<p align="center">
  <img src="docs/assets/benchmark_overall.png" alt="Pooled accuracy per system on the synthetic suite with 95% confidence intervals" width="82%" />
</p>

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](benchmarks/reports/REPORT.md).

<details>
<summary><b>Scenario heatmap and cost</b></summary>

<p align="center">
  <img src="docs/assets/benchmark_scenarios.png" alt="Accuracy per scenario and system" width="92%" />
</p>
<p align="center">
  <img src="docs/assets/benchmark_degradation.png" alt="Accuracy on the latest value after repeated overwrites" width="62%" />
</p>
<p align="center">
  <img src="docs/assets/benchmark_costs.png" alt="Update cost, query latency, storage and evidence tokens per system" width="100%" />
</p>

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](benchmarks/reports/REPORT.md).

</details>

### 4. Public datasets: retrieval only, and plain BM25 is as good

[`benchmarks/public.py`](benchmarks/public.py) runs the **independent** [LoCoMo](https://github.com/snap-research/locomo) and [LongMemEval](https://github.com/xiaowu0162/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**.

| System | LoCoMo any-hit@5 / @10 (1,532 questions) | LongMemEval-S session hit@5 / @10 (60-question sample) |
|---|---|---|
| **BM25** | **60.3% / 67.7%** | **91.7% / 96.7%** |
| Vector (hashing) | 45.5% / 53.1% | 85.0% / 85.0% |
| Hybrid RAG | 54.0% / 62.3% | 88.3% / 91.7% |
| MemoraOS retriever | 55.4% / 63.6% | 86.7% / 93.3% |
| MemoraOS `recall()` (short answer-oriented list, not a ranked top-k) | 43.3% / 47.3% | 50.0% / 51.7% |

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](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](docs/COMPETITIVE_INTELLIGENCE.md). The default embedder is lexical feature hashing. Method and scoring rules: [docs/BENCHMARK_METHODOLOGY.md](docs/BENCHMARK_METHODOLOGY.md).

## How it works

### Architecture

<p align="center">
  <img src="docs/assets/architecture.png" alt="MemoraOS architecture: interfaces, write path, read path, cross-cutting services and SQLite storage" width="100%" />
</p>

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](docs/ARCHITECTURE.md).

### Adaptive routing

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.

<p align="center">
  <img src="docs/assets/routing.png" alt="Seven real questions mapped to categories, the strategy that answered and the strategies tried" width="100%" />
</p>

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](docs/ADAPTIVE_ROUTING.md).

### Temporal memory

<p align="center">
  <img src="docs/assets/temporal.png" alt="Valid time versus system time for the CPython stable-release history, learned out of order, and the queries it answers" width="100%" />
</p>

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](docs/TEMPORAL_MEMORY.md).

### Evidence fusion

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](docs/RETRIEVAL.md).

### Memory CI

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`](contracts/python_releases_and_security.json): the PEP release history plus this repository's security document):

```text
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](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](docs/NEXT_ANSWERABILITY.md).

### Encryption at rest

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`](tests/unit/test_encryption.py). Details: [docs/SECURITY.md](docs/SECURITY.md#encryption-at-rest).

### Docker (optional)

`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](docs/DOCKER.md).

### Memory types

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](docs/MEMORY_DESIGN.md).

## Dashboard

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`).

<table>
  <tr>
    <td width="50%"><img src="docs/assets/dashboard_playground.png" alt="Search playground: a question about the REST API address with the answer, routing, separate confidence signals and the evidence inspector" /><br/><sub><b>Search playground:</b> strategy, separate confidence signals and the evidence behind one answer. The answer is an extractive passage, so it can be a table row quoted as written.</sub></td>
    <td width="50%"><img src="docs/assets/dashboard_history.png" alt="Temporal history of the latest Python 3.14 release: ten historical values and one current value with valid-from and valid-until dates" /><br/><sub><b>Temporal history:</b> every value a real fact has had, with valid time and recorded time.</sub></td>
  </tr>
  <tr>
    <td><img src="docs/assets/dashboard_strategies.png" alt="Retrieval strategies: which strategy answered each recent question, with status, latency and tokens" /><br/><sub><b>Retrieval strategies:</b> which path answered each question; refusals show as <code>insufficient_evidence</code> with 0 context tokens.</sub></td>
    <td><img src="docs/assets/dashboard_overview.png" alt="Overview: memory counts, latency percentiles, unsupported-answer rate and audit-chain health" /><br/><sub><b>Overview:</b> counts, latency, audit-chain health and the unsupported-answer rate measured from judged feedback.</sub></td>
  </tr>
</table>

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](docs/EVIDENCE.md#4-a-real-limit-shown).

## Examples

Every example runs on real data (the project's own documents and the PEP release history) and is covered by an integration test.

| Example | What it shows |
|---|---|
| [`basic_memory`](examples/basic_memory/main.py) | Store real decision records, ask with evidence, restart, and see an unsupported question refused. |
| [`temporal_memory`](examples/temporal_memory/main.py) | Current, previous, "on a date" and full history over the real CPython release dates. |
| [`hybrid_rag`](examples/hybrid_rag/main.py) | Chunked ingestion of one long real document, routing, forced strategies and `explain()`. |
| [`multi_agent`](examples/multi_agent/main.py) | Private, project, agent and org scopes with isolation between tenants. |
| [`research_memory`](examples/research_memory/main.py) | Many notes, a connection question, consolidation that keeps the originals, and reflection. |

## 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](docs/COMPETITIVE_INTELLIGENCE.md) and [docs/RESEARCH_AND_COMPETITIVE_ANALYSIS.md](docs/RESEARCH_AND_COMPETITIVE_ANALYSIS.md).

| | Local, no key, no server | Bitemporal facts | Contradiction reporting | Abstention measured | Learned latent memory |
|---|---|---|---|---|---|
| **MemoraOS** | yes | yes (rule-based extraction) | yes | yes | experimental baseline only |
| Mem0 | needs an LLM | partial | no | not documented | no |
| Graphiti / Zep | needs LLM + graph DB | yes (core strength) | invalidation | not documented | no |
| Hindsight | yes with a local LLM | time-range recall | beliefs | not documented | no |
| Memorilla | needs Linux + CUDA GPU | none documented | none documented | no | **yes (the reference)** |

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](docs/LATENT_MEMORY.md)).

## Limitations

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](docs/EVIDENCE.md)). 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](#4-public-datasets-retrieval-only-and-plain-bm25-is-as-good)); 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](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](docs/SECURITY.md) and [docs/PERFORMANCE.md](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](docs/NEXT_IMPLEMENTATION_STATUS.md)).
- **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.

## Documentation

[Evidence](docs/EVIDENCE.md) · [Public benchmarks](docs/PUBLIC_BENCHMARKS.md) · [Competitive intelligence](docs/COMPETITIVE_INTELLIGENCE.md) · [Scaling](docs/SCALING.md) · [Docker](docs/DOCKER.md) · [MCP setup](docs/MCP.md) · [Memory CI](docs/MEMORY_CI.md) · [Answerability](docs/NEXT_ANSWERABILITY.md) · [Next: audit](docs/NEXT_REPOSITORY_AUDIT.md) · [Next: status](docs/NEXT_IMPLEMENTATION_STATUS.md) · [Architecture](docs/ARCHITECTURE.md) · [API](docs/API.md) · [Memory design](docs/MEMORY_DESIGN.md) · [Adaptive routing](docs/ADAPTIVE_ROUTING.md) · [Temporal memory](docs/TEMPORAL_MEMORY.md) · [Extraction](docs/EXTRACTION.md) · [Retrieval](docs/RETRIEVAL.md) · [Latent memory](docs/LATENT_MEMORY.md) · [Benchmark methodology](docs/BENCHMARK_METHODOLOGY.md) · [Research](docs/RESEARCH_AND_COMPETITIVE_ANALYSIS.md) · [Security](docs/SECURITY.md) · [Performance](docs/PERFORMANCE.md) · [Roadmap](docs/ROADMAP.md) · [Implementation status](docs/IMPLEMENTATION_STATUS.md) · [v0.2 architecture](docs/V02_ARCHITECTURE.md) · [Changelog](CHANGELOG.md) · [ADRs](docs/ADR)

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md). 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](SECURITY.md).

## License

[Apache-2.0](LICENSE)
