Skip to main content

RE-call: Retrieval-Augmented Self-Recall

Trustworthy memory for AI agents.
RE-call gives retrieval results confidence, provenance, validity, tenant isolation, and an explicit abstention path when the memory does not support an answer.

CI License: Apache 2.0 Python 3.11+ PostgreSQL + pgvector CI: real pgvector, types, audit

Why RE-call  ·  Five-minute proof  ·  Quickstart  ·  How it works  ·  Product surface  ·  Documentation  ·  Evidence

Why RE-call

Most memory systems optimize for the nearest match. Agent memory needs a stricter contract: the retriever must say whether a memory is current, where it came from, how confident it is, and when the corpus does not contain an answer.

RE-call is built around that contract.

It is for teams putting agent memory behind real applications: support copilots, internal research agents, compliance assistants, and long-running workflow agents where a stale or unsupported memory is worse than no memory. The buyer story is simple: keep the memory layer local by default, attach policy to every hit, calibrate the refusal threshold on your corpus, and let the application decide what to do with a result that is not trustworthy enough to answer from.

Capability What it means in practice
Validity-aware retrieval Superseded, expired, not-yet-valid, low-confidence, and not-entailed hits are surfaced as verdicts rather than flattened into ordinary search results.
Explicit abstention When no valid result clears the calibrated threshold, callers receive an abstention with a reason instead of a nearest-neighbor guess.
Local operation Ingest and retrieval run on PostgreSQL plus pgvector. Local embeddings are supported, so memory can be built and queried without a memory-layer LLM call.
Policy-driven configuration Embedder, reranker, calibration, trust policy, and retrieval profile are selected to match legal, hardware, latency, quality, and cost requirements. The default is local and offline; higher-quality or hosted options are opt-in.
Production boundaries Tenant IDs, row-level security, token-scoped MCP HTTP transports, erasure, quotas, timeouts, migrations, and observability are part of the shipped surface.
Reproducible evidence Published numbers are tied to committed artifacts, and the claim gate checks them in CI.

Measured strengths:

Strength Evidence boundary
Lower memory-layer cost The LOCOMO head-to-head records no RE-call memory-layer LLM calls, while the comparator pays for extraction calls. See benchmarks/REVIEW.md.
External abstention check On MTRAG, IBM's multi-turn RAG benchmark, RE-call is second on correct refusals among the recomputed systems and stays near the top answer-quality rows. See docs/MTRAG_BENCHMARK.md.
Validity beats nearest-match retrieval The stale rate-limit memory is more similar to the query in the demo, but declared supersession makes the current memory win. The larger trust study is in results/FINDINGS.md.
Stronger than a plain vector store Returned hits carry verdicts, confidence, provenance, tenant scope, and validity metadata. Plain top-k retrieval returns neighbors and leaves trust to the caller.
Clear limits The evidence states where RE-call works, where it does not, and when a corpus-specific measurement is required.

The README is the product overview. For evidence behind these claims, start with docs/EVIDENCE.md, then use results/FINDINGS.md for the full interpretation and limits.

Five-minute proof

Run the bundled demo to see the product behavior before reading the evidence docs:

docker compose up -d --wait
pip install "recall-rag[fastembed]"
python -m recall.cli --table recall_quickstart \
  --migration-dsn postgresql://recall:recall@localhost:5432/recall \
  schema --dim 384 apply
RECALL_TRUST_MODE=development python -m recall.cli --table recall_quickstart demo

Expected shape:

RE-call demo output

[DEGRADED:INDEX_NOT_READY] query='how many requests per second can a client make?'
  ok          conf=1.00  cos=0.784  rate_limits_v2.md
  superseded  conf=1.00  cos=0.806  rate_limits_v1.md -> use rate_limits_v2.md

[ABSTAIN GAP DEGRADED:INDEX_NOT_READY] query='how do we handle penguins on mars?'
  reason: no hit above the calibrated confidence threshold

The stale memory is more similar to the query, but it is declared superseded and loses to the current memory. The unrelated query returns an abstention. The degraded marker is intentional here: this is a sample-corpus demonstration, not a certified production calibration.

Runnable examples: examples/README.md.

Quickstart

After the demo, run the guided setup wizard for your own corpus. The wizard records the selected embedder, retrieval options, and an optional calibration that is fitted to your labeled queries and your corpus.

docker compose up -d --wait
pip install "recall-rag[fastembed]"
python -m recall.cli --table recall_quickstart \
  --migration-dsn postgresql://recall:recall@localhost:5432/recall \
  schema --dim 384 apply
python -m recall.cli setup

PowerShell:

docker compose up -d --wait
pip install "recall-rag[fastembed]"
python -m recall.cli --table recall_quickstart `
  --migration-dsn postgresql://recall:recall@localhost:5432/recall `
  schema --dim 384 apply
python -m recall.cli setup

When the wizard asks whether to calibrate, provide a labeled query JSON and the corpus directory. Use recall/eval/queries.json as the input shape. Calibration is per embedder and per corpus, so a new model or substantially changed corpus should be calibrated again.

The distribution is recall-rag; the import is recall. The name recall on PyPI belongs to an unrelated package, so do not install both into the same environment.

Working from a clone:

pip install -e ".[fastembed]"

How it works

flowchart TB
    M["Memo: markdown plus frontmatter"] --> CH["Chunk"]
    CH --> EW["Embed locally"]
    EW -. "optional" .-> SP["SPLADE encode"]
    EW --> DB
    SP -. "optional" .-> DB

    Q["Query"] --> EQ["Query encoder"]
    EQ --> DB[("PostgreSQL plus pgvector")]

    DB --> DN["Dense vector search"]
    DB --> SL["Postgres full-text search"]
    DB -. "optional" .-> LS["Learned sparse search"]

    DN --> F["Reciprocal Rank Fusion"]
    SL --> F
    LS -. "optional" .-> F

    F -. "optional" .-> RR["Cross-encoder rerank"]
    RR --> GP
    F --> GP{"Gap check: calibrated threshold"}
    GP --> TR{"Trust layer: supersession, validity, confidence"}
    CAL["Calibration: fitted per embedder and corpus"] --> TR
    TR -. "optional" .-> EJ{"Entailment judge"}
    EJ --> OUT
    TR --> OUT["Verdict, confidence, provenance, or ABSTAIN"]

Product surface

Area Ships today
Retrieval Dense, sparse, hybrid RRF, optional SPLADE, optional cross-encoder reranking, calibrated confidence, provenance, and trust verdicts.
Configuration Guided setup, local and hosted embedder choices, retrieval cost profiles, optional reranking, strict or development trust policy, and per-corpus calibration.
Storage PostgreSQL with pgvector, ordered SQL migration path, immutable generations, incremental indexing, pruning, and source-scoped erasure.
Agent integration CLI, MCP server, LangChain retriever, LlamaIndex retriever, and injectable search seams for tests.
Security Tenant isolation, row-level security checks, serving and migration DSNs, bearer-token HTTP transports, scopes, quotas, and unsafe-DSN refusal.
Operations Timeouts, reconnect policy, structured logging, counters, latency percentiles, and MCP stats.
Quality gates Real pgvector integration tests, type checking, linting, dependency audit, claim-artifact checks, and regression fixtures for known failure modes.

Deliberately out of scope: an end-user dashboard, graph reasoning, entity synthesis, high availability orchestration, and automatic truth inference from prose.

The ordered SQL migration path is versioned now, pre-tenancy tables are migrated in place, and runtime CREATE TABLE IF NOT EXISTS remains bootstrap only.

Use it

For an ad hoc local markdown folder, create a table for that index, index the corpus, and search it. If you did not calibrate during setup, use development mode only for local evaluation and demos. Replace ./notes with your memo folder.

python -m recall.cli --table recall_notes \
  --migration-dsn postgresql://recall:recall@localhost:5432/recall \
  schema --dim 384 apply
RECALL_TRUST_MODE=development python -m recall.cli --table recall_notes index ./notes
RECALL_TRUST_MODE=development python -m recall.cli --table recall_notes search "what did we decide about caching?"
python -m recall.cli lint ./notes
python -m recall.cli check ./notes/new-memo.md --strict

PowerShell uses the same commands, but set development mode first when you are running an uncalibrated local evaluation:

$env:RECALL_TRUST_MODE = "development"

For production generation mode, build, validate, calibrate, and promote an immutable generation. Then query the tenant's active generation:

from recall.embeddings import FastEmbedEmbedder
from recall.generation_store import GenerationStore
from recall.trust import trusted_search

emb = FastEmbedEmbedder()
with GenerationStore(DSN, dim=emb.dim, tenant="acme", pool_size=8) as store:
    store.check_schema()
    result = trusted_search(store, emb, "what is the rate limit?")
    if result.abstained:
        ...  # say you do not know
    for hit in result.hits:
        hit.verdict
        hit.confidence
        hit.validity.superseded_by

Set RECALL_SERVING_DSN for application traffic and RECALL_MIGRATION_DSN only in the migration job. RECALL_DSN remains a deprecated development fallback for the serving DSN. See docs/MIGRATIONS.md. Configuration modes are summarized in docs/OPERATING_MODES.md.

Operational safety notes:

Topic Rule
Test database The test suite drops tables. It uses RECALL_TEST_DSN, never RECALL_DSN.
Default credentials The MCP server refuses a non-local built-in recall:recall DSN unless RECALL_ALLOW_INSECURE_DSN=1 is set deliberately.
Tenancy Set RECALL_TENANT or PgVectorStore(tenant=...). Use an unprivileged database role, because PostgreSQL superusers bypass RLS.

MCP

The MCP server uses the default chunks table. Apply that schema for the embedder the server will run, then point the client at recall_mcp.server.

python -m recall.cli --migration-dsn postgresql://recall:recall@localhost:5432/recall \
  schema --dim 384 apply

If an existing chunks table was created with another vector dimension, use a fresh database or an embedder with the matching dimension. The MCP stdio server does not take a --table flag.

{
  "mcpServers": {
    "recall": {
      "command": "python",
      "args": ["-m", "recall_mcp.server"],
      "env": {
        "RECALL_SERVING_DSN": "postgresql://...",
        "RECALL_TENANT": "acme",
        "RECALL_TRUST_MODE": "development"
      }
    }
  }
}

Omit RECALL_TRUST_MODE in production after you have built, calibrated, and promoted a generation. Local uncalibrated MCP work needs the explicit development setting for the same reason the CLI demo does.

Tools: recall_search, recall_evidence, recall_index, recall_forget, and recall_stats.

Full guide: docs/USING_WITH_CLAUDE.md. Authentication and tenancy: docs/AUTH.md.

LangChain and LlamaIndex

pip install "recall-rag[langchain]"
pip install "recall-rag[llamaindex]"
from recall.integrations.langchain import RecallRetriever

retriever = RecallRetriever.from_store(store, emb, k=5)
docs = retriever.invoke("what is the rate limit?")

When the trust layer abstains, the adapters return no document by default. Returned documents carry trust metadata, including verdict, confidence, cosine, and supersession details.

Documentation

Start with docs/README.md.

Core documents:

Document Purpose
docs/WRITEUP.md Architecture and design rationale.
docs/API.md Supported Python, CLI, and MCP surface.
docs/REPOSITORY_MAP.md What is product, evidence, benchmark support, and archive.
docs/AUTH.md Authentication, scopes, and tenant isolation.
docs/MIGRATIONS.md Migration roles, serving DSNs, and schema operations.
docs/OPERATING_MODES.md Local, production, quality, hosted, and evaluation deployment modes.
docs/CALIBRATION.md Calibration workflow and generation-aware serving.
docs/CASE_STUDY.md Where the system came from and what is public versus private.
docs/RESEARCH_PROTOCOL.md How benchmark runs are controlled and audited.

Release notes and upgrade warnings live in CHANGELOG.md.

Evidence

Start with benchmarks/README.md. The results directory has its own map at results/README.md.

The short version:

Question Current evidence
Does declared supersession beat plain similarity search? Yes, on the authored-edge cases measured in the trust and scale studies.
Can abstention be trusted everywhere? No. It works on far gaps and fails on near-misses unless a stronger answerability layer is added.
Is retrieval quality universal? No. Corpus shape dominates, and the measured recommendation is to benchmark your corpus before choosing an embedder.
Is the Mem0 comparison apples-to-apples? The published head-to-head uses the same LOCOMO questions, generator, judge, and paired tests, with reader-tier limits stated in the benchmark review.
What does MTRAG add? A third-party multi-turn benchmark with an official judge that gives full credit for correct refusal. RE-call does not top the benchmark, and that boundary is stated in docs/MTRAG_BENCHMARK.md.

Important benchmark documents:

Document Purpose
results/FINDINGS.md Interpretation, limits, and negative results.
results/RESULTS.md Complete result tables.
results/ARTIFACTS.md Checksum and artifact map for readers auditing a claim.
docs/MTRAG_BENCHMARK.md MTRAG setup, results, and scope boundaries.
benchmarks/REVIEW.md Adversarial review of the LOCOMO comparison.
benchmarks/PREREGISTRATION.md Pre-registered rules for the main memory benchmark.
benchmarks/archive/preregistrations/README.md Archived preregistrations for follow-up benchmark arms.

When not to use RE-call

Use something else if you need managed hosting, per-chunk ACLs, graph reasoning, automatic truth extraction from prose, or a memory system that rewrites facts for you. RE-call is a retrieval library over your PostgreSQL database, not a hosted memory platform.

What this does not do

RE-call is a retrieval library, not a general reasoning system. It does not infer every missing supersession edge, prove that an on-topic memory answers a near-miss question, or replace database operations with a managed service. It returns the trust signals the caller needs, and it refuses to pretend that a nearest match is always usable evidence.

Reproduce

make eval
python -m recall.eval.scale --embedder hashing --filler 50000

Cloud rows require the relevant API keys. Local rows run key-free.

Citation

If you describe RE-call in a paper, post, talk, or README of your own, cite the project and credit Giulio D'Erme. Use CITATION.cff as the canonical citation source.

License

Apache 2.0 license. See LICENSE, and keep NOTICE with redistributed derivative works.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recall_rag-0.9.1.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

recall_rag-0.9.1-py3-none-any.whl (559.1 kB view details)

Uploaded Python 3

File details

Details for the file recall_rag-0.9.1.tar.gz.

File metadata

  • Download URL: recall_rag-0.9.1.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for recall_rag-0.9.1.tar.gz
Algorithm Hash digest
SHA256 69461793c2274b657809d334388e7ee4fbf916d281c9e070782549f06f5f0dbe
MD5 9c80349b06fa80e2ca149f4b4d8202b4
BLAKE2b-256 01d9c1a6ce1efd710a924a702f040441de81eec6174a9f15863e03e1e9de42e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for recall_rag-0.9.1.tar.gz:

Publisher: release.yml on GiulioDER/RE-call

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file recall_rag-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: recall_rag-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 559.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for recall_rag-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17b49a917f4fa242c647659fbea6540af375b56f1060265b16b5e386d38c772c
MD5 6192b01c8e9d97f41f7e53711714ba7f
BLAKE2b-256 226469a00e9f28536be33289e4b0e9edf47d837eda2d13509c87e3d0ea4c622f

See more details on using hashes here.

Provenance

The following attestation bundles were made for recall_rag-0.9.1-py3-none-any.whl:

Publisher: release.yml on GiulioDER/RE-call

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page