Repository avatar
AI Tools
v0.3.3
active

recallic

com.recallic/recallic

Self-hosted long-term memory for AI agents: keeps facts current, says when it does not know.

Documentation

Recallic

Formerly Recallix: same project, new name. Old setting names (RECALLIX_*), export files and the recallix-mcp command keep working.

Persistent memory for AI agents: store what a user tells any of their agents, recall it later by meaning, keep facts up to date, and say "I don't know" instead of guessing.

Watch the 50-second demo: a week of messy texting, three answers, and one honest decline

50-second demo, narrated (click to play). Every message, answer and timing in it comes from a real run.

  • No LLM in the memory pipeline. Fact extraction, schema tagging, importance, ranking, reflections and predictions are rules, embeddings and small fitted models. Nothing generates text. Three small encoder models run locally on CPU: the embedding model (bge-small, 33M parameters; or Ollama / an API), the answer check (a SQuAD 2.0 reader, 125M) and, for deep recall, a re-ranker (MiniLM cross-encoder, 22M). No per-token bill, no API key.
  • Per-user HNSW vector engine in C++ (NEON / AVX2), rebuilt from SQLite on start, so the engine can restart at any time without losing anything.
  • Learned, explainable recall. Each result carries its relevance and the feature breakdown behind it, plus a top-level answer (the span a local reader found). Weights and the abstention threshold are fitted on labelled data, and the ranker refits itself nightly from your users' feedback (mem.used(out)), keeping a new fit only if it ranks better on feedback it was not fitted on.
  • Deep recall for spread-out answers. mem.recall(question, deep=True) re-reads 50 candidates with a small local re-ranker: slower, but finds more of the evidence when the answer is spread over several memories. Measurements: eval/results/retrieval_fixes/.
  • You choose how cautious it is. mem.recall(question, mode="cautious" | "cautious_lite" | "balanced" | "helpful") (default balanced; server-wide recall.mode). cautious reads with Recallic's own stricter reader and says "I don't know" far more often; cautious_lite is cautious with one re-ranked second try before it declines (fewer refusals, still declines most trick questions: eval/results/bench_locomo/adaptive_conv44/); helpful answers more counting, ordering and "how long between" questions and, when it can do so safely, returns the worked-out result (computed_answer: "41 days", or the order, with the dates in the receipt). Each mode's measured trade-off is in eval/results/aggregation_check/.

Measured results

Copied from eval/results/RESULTS.md (generated 2026-12-02 on an Apple M4; regenerate with the commands in eval/README.md). The website's Benchmarks page reads the same files. Embeddings: BAAI/bge-small-en-v1.5, real engine, no LLM anywhere, API cost $0.

LongMemEval_S (public benchmark: 500 questions over 246,750 chat turns; never used to fit or choose anything, each run uses a configuration fixed beforehand). Share of each question's evidence in the top 10:

recall@10overallmulti-sessiontemporalknowledge updatesingle-session userpreference
Recallic ranking0.8600.7480.8380.9630.9770.717
Recallic, served (default)0.7770.6260.7020.9350.9840.794
Recallic, served (deep recall)0.8140.7290.7380.9790.9690.739
Recallic, served, declines keep their results*0.8340.7040.7910.9350.9840.794
Recallic, served, deep recall + declines keep their results*0.8710.8070.8270.9790.9690.739
Dense vectors (same embeddings)0.7980.7370.6740.9030.8980.828
BM250.7670.6360.7530.8890.9300.444

The ranking puts 8% more evidence in the top 10 than dense search with the same embeddings. What is served is lower, because recall declines when its answer check finds no answer: it declined 43.3% of the 30 unanswerable questions, but also 9.8% of the 470 answerable ones. The answer check's threshold was set on a different dataset and needs calibrating per deployment.

* Per-request option keep_on_decline=True (off unless asked for; server-wide: recall.keep_results_on_decline): recall declines exactly as often, but a decline still returns its results, marked ABSTAINED with no answer, and the agent decides whether to use them. These rows count those low-confidence results as served. Earlier runs stay in eval/results/ (longmemeval_s_*.json).

Memory pipeline: held-out test split, real engine:

MetricResult
Recall hit@1 / hit@3 (answerable questions)0.86 / 0.93
Unanswerable questions correctly declined3/4 (false abstention on answerable: 0.07)
Fact extraction F10.93
Schema accuracy0.85
Importance ROC AUC1.00
Recall / store latency, p50 (incl. embedding)41.3 ms / 16.1 ms
Legacy adversarial gauntlet v1–v38/12
Legacy 500-turn retention, recall@17/8

The test split has been evaluated several times during development, so treat it as a regression check rather than an unseen benchmark.

LoCoMo (public benchmark; test split: 5 conversations, 3,122 turns, 987 questions; held out from fitting, but evaluated repeatedly during development). Evidence retrieved, no LLM involved:

recall@10overallmulti-hoptemporalopen-domainsingle-hop
Recallic0.7640.4670.7690.4200.896
Dense vectors (same embeddings)0.5700.3930.5840.3510.646
BM250.5270.2080.5430.2930.651

Recallic declined 28.7% of LoCoMo's 209 adversarial questions (they attribute something the conversation did discuss to the wrong person) and wrongly declined 4.2% of the 778 answerable ones. For conversations between people (memories stored with the speaker's name), recall re-ranks its top 100 candidates with a small local cross-encoder before deciding (recall.rerank.first: chat, since 1 Dec 2026; user / assistant chats are unaffected). Multi-hop questions, whose answer is spread over several messages, remain the weak spot. Measurements: eval/results/ranking/.

The legacy gauntlet and retention benchmarks are the pre-existing ones from this repository. Earlier versions of this README reported 10/12 and 75% for them. Those scores depended on answers hardcoded into the recall code (e.g. a fixed alias table), which has been removed.

Vector engine (single thread, recall@10 against exact search, M=16, efConstruction=100, efSearch=50):

VectorsDimDataRecall@10Search avg / p99Build
100,000128clustered0.9800.082 / 0.116 ms8.8 s
100,000384clustered0.9560.164 / 0.274 ms25.3 s
1,000,000128clustered0.9210.173 / 0.648 ms127 s
100,000128uniform random0.189 (hnswlib: 0.190)0.149 ms17.9 s

Uniform random vectors are the known worst case for HNSW; the reference implementation (hnswlib) gets the same recall on the same data, which validates the engine. These numbers exclude the Python API and the embedding model.

Limits worth knowing:

  • The eval sets are small and were written by the same author as the extraction rules.
  • Fact extraction is rule-based. It misses phrasings such as "we have a…", "rescheduled to" and "also called"; unextracted facts are still stored and searchable, just not versioned.

Architecture

client ──X-API-Key──▶ FastAPI (server.py)
                        ├─ store:  dedupe → embed once → facts → schema → importance
                        │          → SQLite (row + embedding + FTS5) → engine /add
                        ├─ recall: aliases → FTS5 + entity index + user's HNSW → learned ranker
                        │          → truth arbitration → multi-hop → abstain below threshold
                        ├─ index sync: SQLite → engine (startup, engine restart, reindex)
                        └─ jobs: world state · next-topic prediction · reflections · forgetting
                      SQLite (system of record)        C++ engine (one HNSW index per user)

Diagrams: docs/architecture_high_level.puml, docs/architecture_technical_depth.puml.

Getting started

Docker (recommended):

git clone https://github.com/Recallic/Recallic && cd Recallic
docker compose up -d                                       # engine + API on localhost:8000
docker compose logs recallic | grep -A1 "admin API key"    # printed once: save it
docker compose exec recallic python -m backend.tools.keys create --user alice
pip install recallic                                       # Python SDK + recallic-mcp
npm install recallic                                       # TypeScript / Node 18+
from recallic import Memory
mem = Memory(api_key="rx_...")
mem.store("I moved to Pune last month.")
print(mem.recall("Where do I live?")["memories"][0]["content"])

On a server, in one click:

Deploy to Render

It runs in your own Render account, and you pay Render for it directly. It uses a 2 GB instance (Recallic needs about 0.75 GB measured, so the 512 MB instances are too small) and a 5 GB disk for your data and the models. The admin API key appears once in the service's Logs after the first start. On Railway: New project → Deploy from GitHub repo → add a volume mounted at /data → set the variable PORT=8000 → generate a domain. On any VPS with 2 GB of memory, the Docker commands above work as they are.

Without Docker:

pip install -r requirements-local.txt           # API + local embeddings and answer check
python -m backend.tools.get_engine              # prebuilt vector engine for this machine (checksum-verified)
#   or compile it yourself (needs cmake and a C++17 compiler):
#   cmake -S backend/infra_cpp -B backend/infra_cpp/build -DCMAKE_BUILD_TYPE=Release && cmake --build backend/infra_cpp/build -j

python -m backend.tools.setup_env               # writes the engine secret to .env, prints an admin key
set -a; source .env; set +a
./backend/infra_cpp/build/memory_service &      # vector engine
python server.py                                # API on 127.0.0.1:8000

Then create a key (python -m backend.tools.keys create --user alice) and use the Python SDK or TypeScript SDK. Integrations: Open WebUI (memory for every chat, one filter, no code), LangChain and LangGraph (RecallicMiddleware, retriever, tools), Google ADK (RecallicMemoryService), Haystack (RecallicMemoryStore), LlamaIndex (RecallicMemoryBlock) and the Vercel AI SDK (recallicMemory() middleware). Full walkthrough: docs/quickstart.md. Endpoints: docs/api_reference.md. To try every endpoint from the browser, open http://localhost:8000/docs, click Authorize and paste your key (no SDK needed). All settings live in config.yaml. Secrets come only from the environment.

Security model

  • API keys are random tokens stored only as SHA-256 hashes, with roles: user (acts as itself), service (may act for its end users), admin (maintenance endpoints).
  • Each user has a separate vector index, and a key only reaches its own user's memories. private memories are scoped to the agent that wrote them (enforced in SQL), but the agent_id is named by the caller: this separates a user's cooperating agents, it is not access control between agents that don't trust each other.
  • Limits against abuse (api in config.yaml): request size (1 MB; 10 MB for imports), metadata size, memories per import (one import per user at a time), and per-user writes and recalls per second (a deep recall counts as 4). User and agent ids are at most 128 printable characters.
  • Deleting a memory removes its vector, long-term copy and timeline entry. Clearing a user removes their data from every store.
  • The engine binds to localhost and refuses to start without RECALLIC_INTERNAL_KEY.

Development

pip install -r requirements-dev.txt
RECALLIC_ENGINE_BIN=backend/infra_cpp/build/memory_service python -m pytest tests
ctest --test-dir backend/infra_cpp/build --output-on-failure   # includes a ThreadSanitizer run
python eval/run_eval.py --split dev -v

CI (.github/workflows/backend.yml) builds the engine on Linux (AVX2) and macOS (NEON), runs the C++ tests under ThreadSanitizer, the API/integration tests against the real engine binary, and an eval regression gate.

examples/multi_agent_handover.py is the multi-agent demo (the agents use an LLM; Recallic does not).

License

  • Recallic (server, engine, everything in this repository except the SDKs and integrations): Functional Source License 1.1, ALv2 Future License (FSL-1.1-ALv2).
    • What you may do: use, modify and self-host it for anything, including inside your own commercial products.
    • What you may not do: offer it, or a substantially similar product built from it, as a competing commercial product or service.
    • Each version becomes Apache 2.0 two years after release.
  • Client SDKs (sdk/python, sdk/typescript), published as recallic on PyPI and npm: Apache 2.0.
  • Integrations (integrations/: LangChain, LlamaIndex, Haystack, Google ADK, Vercel AI SDK, Open WebUI, Microsoft Agent Framework, Pydantic AI, CrewAI, Langflow, Dify, Flowise, LibreChat, Hermes Agent): Apache 2.0, each folder with its own LICENSE file. The n8n node (integrations/n8n) is MIT, as n8n requires for community nodes.
  • Earlier releases: versions up to commit e5fddcd0 (2026-11-24) were released under Apache 2.0 and stay available under it.

"Recallic" and its logo are trademarks of Ayishik Das; see NOTICE.

PYPI
recallic
Install Command
pip install recallic
Runtime: uvx