A memory and a life for language-model agents.
Memories fade unless recalled. What it reads, it keeps word for word.
It gets bored and goes looking. It gets tired, sleeps, and dreams.
An open source project from DeepBlue Dynamics, which builds open source agentic tooling for the marine electronics market. DeepBlue's promise: agents and people can ask questions of a boat's instruments, logs and documents, on board and without a connection.
Drafted by the flagship agent (Steve) from its own documents on 2026-09-27, lightly corrected for accuracy by the engineer.
Ferricula is a memory engine and cognition stack for a software agent. What arrives through its sense doors — operator messages, documents (text, web pages via the grub crawler, PDFs), feeds, radio entropy — commits to two planes: experience, which decays and is strengthened by recall, and evidence, which is kept verbatim and never decays. Recall is hybrid — word match, BM25, meaning (embeddings), and one graph hop — and conversations are remembered across sessions. Background drives shape the agent's behavior: boredom leads it to read on its own, sleep pressure leads to consolidation and a dream, meditation holds it, and entropy comes from an SDR radio. Ollaya decision gates judge whether something is worth deliberating on; they are fast (10–18 ms) but not yet calibrated, so they are advisory only.
The design follows the Abhidhamma's analysis of a moment of mind (contact, feeling-tone, recognition, investigation, a fast judgment, and only then the expensive step, thinking with an LLM). See the white paper for the architecture and measured results, PLAN_V3.md and docs/BACKLOG.md for what is left, and docs/HANDOFF.md to pick up the work.
- Documents — the agent can be handed text, a web page (via the grub crawler),
or a PDF; content is kept verbatim and cited as
[doc <id>§<section> p.<page>]; paywalls and login walls are rejected. - Recall by meaning — shivvr GTR-T5 embeddings; 2,802 zero vectors backfilled; recall now fuses word match, BM25, meaning, and one graph hop.
- Recall quality — Recall@5 over the agent's memory went from 0.133 to 0.500; 0.600 with faded memories, which are now enabled.
- Conversations are remembered across sessions.
- Drives — boredom leads the agent to read on its own; sleep pressure leads to consolidation and a dream; meditation holds it; entropy comes from an SDR radio.
- Judges — Ollaya decision gates: fast (10–18 ms) but not yet calibrated, so advisory only.
- Built, not yet wired — live thermodynamics; the vīthi record with the 52 cetasikas; Paṭṭhāna edges; meditation with a bell and breath; dream images via ComfyUI.
- Next — the agent's own tools to search and read documents mid-conversation (docs/HANDOFF.md, SEARCH_TOOL.md), per the agent's four requirements.
- Benchmarks — every number lives in
audit/bench/ledger.jsonl; the plan is in docs/BENCH_PLAN.md and the v3 benchmark plan PDF.
sense doors cognitive process planes
operator (HTTP / MCP) ─┐
documents (PDF, URL, ─┼─► contact ─► feeling-tone ─► recognition ─► novel? ─► JUDGE ─► LLM ─► commit ─┬─► experience (decays; recall
text via grub) │ gate gate (Ollaya, (only if │ strengthens; consolidates)
feeds, radio entropy ─┘ ~15 ms) worth it) └─► evidence (verbatim; never decays)
drives: boredom ─► curiosity ─► read the web ─► ingest sleep pressure ─► sleep ─► consolidate ─► dream ─► wake
| Crate | What it is |
|---|---|
ferricula-core |
Memory engine: records with fidelity, decay and recall strengthening; durable snapshot + WAL; roaring-bitmap tag index; graph; prime tree |
ferricula-cognition |
The mind: gate contract (Answer | Abstain + provenance), non-destructive consolidation (bhāvanā), read-time curator, sati monitors, drives (life.rs), entropy source, identity casting |
ferricula-ingest |
The document sense door: text, web pages (via grub) and PDFs become verbatim, page-aware sections in a durable store searched with BM25 |
ferricula-gates |
Gate backends: Ollaya decision models (/api/decide) and an Ollama-chat fallback, with calibration discipline |
ferricula-episode |
Versioned episodes and the append-only memory overlay |
ferricula-search |
lume: FST tagger, field-aware BM25, spelling, crawl, rerank. Also builds the standalone lume CLI |
ferricula-semantic |
shivvr: chunker, GTR-T5 ONNX embedder, vec2text inverter (ml feature) |
ferricula-server |
The runtime: HTTP API, MCP endpoint, model router with budgets, task worker and scheduler |
ferricula-bench |
Benchmarks that write every number to audit/bench/ledger.jsonl |
- Rust 1.85+ (2024 edition). The Docker build uses
rust:1.96. - Ollama at
127.0.0.1:11434for thinking. Any chat model works; thinking models (e.g.glm-5.3:cloud) needollama_reasoning_tokensset. - Optional: Ollaya at
127.0.0.1:11435for fast judgments (docker run -d --gpus=all -p 127.0.0.1:11435:11435 ghcr.io/ollaya-dev/ollaya:cuda, then pulllaya). - Optional: a grub crawler at
127.0.0.1:6792so the agent can read web pages. - Optional: a radio entropy source (gnosis-radio / sdr-rand) at
RADIO_URL; the OS is used otherwise.
cargo build --release -p ferricula-server
cargo test --workspace --exclude ferricula-semantic # semantic's ONNX runtime needs glibc >= 2.38 on Linuxferricula-server init ./agents/ada/memory --agent-id ada --name "Ada" --role "a patient reader of papers"This writes identity.json (with a birth hexagram cast from the entropy source) and a starter agent.toml persona. Edit agent.toml to give the agent its voice. The engine has no built-in persona; who the agent is lives entirely in that directory.
cp config/agent.example.toml config/agent.toml
# set: expected_agent_id = "ada", [models.identity] agent_id/name, memory_dir, state_dir,
# bind = "127.0.0.1:8875" for a bare (non-container) run
export FERRICULA_OPERATOR_TOKEN=$(openssl rand -hex 32)
ferricula-server serve --config config/agent.toml
curl http://127.0.0.1:8875/health
curl -H "Authorization: Bearer $FERRICULA_OPERATOR_TOKEN" http://127.0.0.1:8875/statusmemory_dir is always opened read-only; everything the runtime writes (conversations, what it has read, new experience) goes under state_dir, which must not be inside memory_dir.
mkdir -p secrets && openssl rand -hex 32 > secrets/ferricula_operator_token
FERRICULA_MEMORY_VOLUME=my-agent-memory FERRICULA_CONFIG=./config/agent.toml docker compose up -d --buildThe image runs as a non-root user with a read-only root filesystem, all capabilities dropped, and the port published on host loopback only. config/examples/steve/ shows a complete deployment of an agent built from a recovered v1 memory.
- HTTP:
POST /mcp(JSON-RPC, protocol2025-06-18), operator bearer auth, loopbackOriginonly. - stdio:
scripts/ferricula_mcp_bridge.pyfor clients that only speak stdio (setFERRICULA_URLandFERRICULA_OPERATOR_TOKENorFERRICULA_OPERATOR_TOKEN_FILE).
| Tool | What it does |
|---|---|
ferricula_chat |
Talk to the agent. Answers are grounded in its memory and cite what it read as [doc <id>§<section> p.<page>] |
ferricula_ingest |
Hand it something to read: text, url, or a PDF (pdf_base64 + name; the stdio bridge accepts a local path), with an optional note about why |
ferricula_documents |
What it has read |
ferricula_read_section |
The exact text of one section |
ferricula_recall |
Hybrid recall over its memories and everything it has read, fused by reciprocal rank |
ferricula_status |
Mode, memory counts, spend |
Every route except GET / and GET /health needs Authorization: Bearer <operator token>.
| Method | Endpoint | |
|---|---|---|
| POST | /chat · GET /chat/{conversation_id} |
Conversation (persisted) |
| POST, GET | /documents |
Ingest ({"kind":"text"|"url"|"pdf",...}) or list |
| GET | /documents/{doc_id} · /documents/{doc_id}/sections/{index} |
A document, a verbatim section |
| POST | /documents/search · /memory/recall |
Section search; hybrid recall |
| GET | /status · /identity · /models/status |
Runtime, memory and spend |
| POST | /control/mode · /control/wake · /control/sleep · /control/pause |
Activity |
| GET, POST | /tasks · /tasks/{id} |
Task queue |
| POST | /memory/episodes · /memory/episode-query |
Episodes |
serve --config <file> reads TOML; every key has a default (crates/ferricula-server/src/config.rs). Start from config/agent.example.toml, which documents each key. Highlights:
| Key | Meaning |
|---|---|
expected_agent_id |
Must match identity.json; startup refuses a different agent |
memory_dir / state_dir |
Read-only identity + memory / writable runtime state |
private_context_profiles |
Model profiles allowed to see private memory. An Ollama :cloud model listed here sends memory off-box: that is the operator's choice |
ollama_model / ollama_reasoning_tokens / ollama_context_tokens |
Local model, extra output headroom for thinking models, and its context window (default 8192; raise it for large-context models so evidence cards fit) |
[documents] |
Ingest: grub_base_url, max_bytes, allow_url, timeout_secs |
[budgets] max_model_usd_per_day |
Hard daily spend cap across all routes |
[schedule], [autonomy], [sleep_cycle] |
Wakes, event-driven autonomy, sleep planning |
cargo run --release -p ferricula-bench -- docs|gates|longmem. Every run appends a row to audit/bench/ledger.jsonl (commit, dataset hash, model, metrics) and writes a report beside it. Current numbers are in paper/WHITEPAPER.md §5. In short: stored documents are byte-identical to their source and a paraphrased sentence finds its source section 71% of the time at rank 1 and 91% in the top 5 with BM25 alone; the off-the-shelf judge is not calibrated on our gate labels yet, so gates stay advisory.
| Area | State |
|---|---|
Load a v1 memory read-only; create a new agent with init |
✅ |
| Chat, persisted conversations, budgeted model routing | ✅ |
| Document ingest (text, URL via grub, PDF), verbatim citations, hybrid recall | ✅ |
| MCP over HTTP and stdio | ✅ |
| Ollaya gate backends; calibration harness | ✅ built · |
Drives (boredom → curiosity via the web, sleep pressure → sleep → dream → wake), [life], /life, ferricula_life |
✅ live-soaked on a recovered memory (audit/life) · ⏳ 72-hour soak |
| Non-destructive consolidation (bhāvanā) in the sleep cycle | ◐ runs on a scratch copy; clusters and karmic log persist, nothing written back yet |
| Dense (embedding) recall: meaning index, backfill, dense + graph arms in hybrid recall, turns remembered across conversations | ◐ R2b recall landed; sati-recall gate, saññā tags, consolidation clusters still planned: docs/EMBEDDINGS_PLAN.md |
| Chinese / Pāli tokenization | ❌ ASCII-folded today |
| LongMemEval / LoCoMo end-to-end | ⏳ harness skeleton |
| paper/WHITEPAPER.md | Architecture, the Abhidhamma mapping and its limits, measured results |
| PLAN_V3.md | Remaining work, phase by phase, with exit tests |
| PLAN.md | The v2 fusion design (substrate) |
| docs/ | Runtime operations, recovery of a v1 memory, Nuts News contracts |
| research/ | Background research: Abhidhamma, thermodynamic memory, agent-memory literature |
Gnosis AI-Sovereign License v1.3. crates/ferricula-search derives from lume (BSD 3-Clause, see THIRD_PARTY_NOTICES.md).