Skip to main content
Glama

Celiums Memory

A complete cognitive memory engine. Apache-2.0. All of it.

License: Apache-2.0 Sponsor

Development branch notice: this branch is dev work for the Rust and Cloudflare migration. It is not production-ready and must not be used for production data, customer traffic, or public release artifacts. The stable user-facing line remains main until the production gates below are closed.

Celiums Memory is an engine, not an app — no UI, no dashboard to log into. It is the memory, journaling, ethics and knowledge substrate you embed inside other software: agents, assistants, tools, pipelines. It speaks MCP (Model Context Protocol) so any compatible client (Claude Code, Cursor, Continue, Cline, OpenCode, or your own) gets persistent memory, a first-person journal, an auditable ethics engine, and a per-user biological clock — without you building any of it.

Implementation status: the Rust workspace in rust/ is the canonical implementation. The Cloudflare Worker, Durable Object, R2 and Container runtime are the target deployment path and are still being validated on dev. See the ordered Rust roadmap, the execution ledger, and ADR-025.

It is open source under Apache-2.0 in full: no open-core split, no paid tier, no proprietary core held back. The Ethics Engine — every layer — is open and auditable. Its ethics_knowledge corpus is distributed separately as a v2.0.0 release asset (not in the git tree); the engine runs on Layers A+B without it, and Layer K (precedent) abstains cleanly when the corpus is absent.

A fuller statement of intent: MANIFESTO.md.


Target Architecture

MCP / HTTP client
    |
    v
Cloudflare Worker
    |  authentication, tenant resolution, edge limits
    v
Durable Object per tenant
    |  command journal, receipts, high-water mark, R2 pointer
    v
Disposable Cloudflare Container generation
    |  native Rust binary, one tenant filesystem
    v
Hyphae 0.2.1
    |  hash-chained log, verified snapshots, embedded indexes
    v
Celiums Memory Rust engine
    cognitive core + ethics + governance + recall + journal + graph

The Container filesystem is disposable. The Durable Object is the serialized control plane, and encrypted checkpoint artifacts are stored in R2. This is the architecture being built and tested; it is not an assertion that this branch is ready for production deployment.

The native Rust binary remains the local reference runtime. It supports MCP stdio, authenticated MCP Streamable HTTP, REST v1, OpenAPI, tenant-scoped actors, and 19 MCP tools. The Worker and Container layers must agree with that native contract before canary promotion.

cd rust
cargo build --release -p celiums-memory-cli
cargo run --release -p celiums-memory-cli -- mcp --data ../.celiums/memory

MCP client configuration:

{ "command": "celiums-memory", "args": ["mcp"] }

The target production request path is:

MCP client / HTTP caller
        │
         ▼
 Worker auth + tenant routing
          ▼
 Durable Object → Cloudflare Container → native Rust MCP/HTTP server
          ├─► Hyphae append-only durable engine
          ├─► encrypted R2 checkpoint generations
          └─► caller-provided or Workers AI embeddings

The pieces:

  • Memory — remember / recall with hybrid retrieval (vector + full-text + affective/PAD resonance), importance scoring, consolidation, lifecycle decay, and circadian/interoceptive modulation.

  • Journal — append-only, hash-chained, first-person agent journal: causal chains, arcs, introspection, dialogue, chain verification.

  • Ethics Engine — a 4-layer evaluator (A deterministic lexicon · B probabilistic CVaR with a categorical CBRN hard-block · C philosophical scaffold · K precedent advisory). Fully open, corpus included — the component that makes moral calls is the one that least deserves to be hidden.

  • Biological clock — per-user circadian rhythm modulates arousal and recall; the engine has a sense of time and state.

  • Knowledge — forage does hybrid search over the skills/knowledge you bring (BYO; via the skills table). The large curated module corpus is a separate Celiums project — forage runs without it.

  • Storage — Hyphae-backed native Rust durability inside the Container; the Durable Object is the Cloudflare control plane and recovery journal.

  • Recovery — mutating requests carry X-Celiums-Operation-Id; the DO persists pending, forwards the original command, stores the terminal receipt, advances a contiguous high-water mark, and replays unresolved tail operations after a Container failure.

  • Checkpoints — encrypted Hyphae backups are wrapped as versioned binary artifacts, uploaded to R2, referenced by a durable DO pointer, retained as recent generations, and restored only into a new verified tenant generation.

Full detail — tenant isolation, confirmation gates, ethics layers and observability — is in ARCHITECTURE.md.


Related MCP server: BuildAutomata Memory MCP Server

Development Status

This section describes the work currently being integrated into dev. It is intentionally explicit so that development architecture is not mistaken for a shipped product contract.

Completed Foundation

  • Rust cognitive core with importance, affect/PAD, limbic state, retention, circadian modulation, ethics Layers A/B/C/K, and deterministic recall.

  • Hyphae-backed durable engine with exact Q15 retrieval, BM25F lexical search, typed abstentions, dimension guards, durable state, and verified recovery.

  • Tenant, user, agent, project, conversation and session identity contracts.

  • Idempotent ingestion, event ledgers, batch ingestion, provider enrichment boundaries, temporal claims, contradiction detection, entity graph, hierarchical consolidation, lifecycle maintenance, and time-travel recall.

  • Policy-aware governance, disclosure controls, poisoning/PII/secret handling, append-only audit chains, deletion, export, migration planning, encrypted backups, and restore verification.

  • Native Rust server with REST v1, MCP Streamable HTTP, OpenAPI, API-key auth, OIDC verifier boundary, RBAC, confirmation tokens, quotas, rate limits, request IDs, health, readiness and version endpoints.

P10 Cloudflare Migration

  • Removed the legacy TypeScript memory runtime, shared TypeScript types, legacy schemas, SQL migration runner, Postgres/Qdrant/Valkey deployment paths, Docker Compose path, and Helm release path from this development line.

  • Moved plugin and benchmark transport to the authenticated native Rust server.

  • Added a Worker control plane with tenant-bound Container routing.

  • Added a Durable Object command journal with transactional pending records, terminal receipts, idempotency conflicts, contiguous high-water marks, and pending-tail replay.

  • Added binary-safe checkpoint transport so large encrypted artifacts are not converted to UTF-8 or stored as giant journal receipts.

  • Added native checkpoint export/import routes and a versioned CELIUMSCP artifact over the existing encrypted Hyphae backup primitive.

  • Added R2 checkpoint pointers, three-generation history, retention, pending binary objects, Queue delivery, and Durable Object alarm scheduling.

  • Added native/Worker conformance tests for auth, tenant isolation, replay, checkpoint metadata, binary preservation, and idempotency.

What We Are Modeling

The migration is not only a language rewrite. It models a product-grade memory substrate with explicit boundaries:

  • Physical tenant isolation: a tenant is resolved before storage is opened; request payloads never select a tenant directory.

  • Durable command semantics: acknowledged writes have an operation identity, a receipt, a sequence, and a recovery story instead of relying on ephemeral process state.

  • Disposable compute: Container generations can be destroyed and rebuilt from verified checkpoint plus journal replay without changing operation IDs.

  • Evidence-preserving memory: raw events, claims, graph edges, summaries, policy traces, journal chains and audit records preserve provenance rather than collapsing everything into opaque vectors.

  • Read-only recall: retrieval does not silently mutate memory or emotional state; feedback and maintenance are explicit operations.

  • Governed disclosure: sensitive content, persistent instructions, secrets, operational intent and user-visible disclosure are separate decisions.

  • Deterministic behavior: dimensions, filters, embedding identity, corruption, unsupported formats and degraded retrieval fail explicitly.

  • Portable ownership: logical exports, encrypted backups, verified restore, hard delete and residue reports remain first-class capabilities.

  • Provider neutrality: the engine does not own an LLM or embedding provider; production callers may supply Workers AI, bge-m3, another compatible model, or the deterministic local embedder for development.

  • Operational quality: the intended product must expose health canaries, redacted telemetry, recovery drills, versioned artifacts, reproducible builds, conformance suites and clear rollback boundaries.

Not Ready For Production

This dev line must not be promoted until all of the following are green in a real Cloudflare environment:

  • Worker authentication and tenant routing against production secrets.

  • Durable Object serialization and journal durability under concurrent traffic.

  • Container start, stop, destroy, restart and generation replacement behavior.

  • R2 write, read, retention, corruption detection and encrypted restore.

  • Queue delivery, retry, deduplication and pending-tail replay.

  • RPO 0 for acknowledged writes and measured recovery objectives.

  • Native versus Container conformance using the same fixtures and result schema.

  • Recall health canary, tenant isolation canary and backup/restore canary.

  • Crates.io publication and clean-consumer installation for the public Rust family.

  • Production security review, release provenance, runbooks and disaster-recovery drill.

Until then, use main for the stable public line. Treat all dev APIs, artifacts, package metadata and Cloudflare configuration as subject to breaking change.


Quick start

Option A — Native Rust server

git clone https://github.com/terrizoaguimor/celiums-memory.git
cd celiums-memory
export CELIUMS_API_KEY_PEPPER=local-development-pepper-change-me
celiums-memory serve --data ~/.celiums/memory \
  --api-keys 'cmk_local:default:developer:developer:owner'
curl localhost:3210/healthz  # → live, once ready

The native MCP/HTTP server listens on :3210.

Option B — MCP stdio

git clone https://github.com/terrizoaguimor/celiums-memory.git
cd celiums-memory
celiums-memory mcp --data ~/.celiums/memory

The MCP stdio mode is local and requires no external services.


Connect an MCP client

Point any MCP client at the HTTP endpoint with the API key. Example for Claude Code / Cursor-style config:

{
  "mcpServers": {
    "celiums-memory": {
      "url": "http://localhost:3210/mcp",
      "headers": {
        "Authorization": "Bearer cmk_your_key_here",
        "x-celiums-tenant-id": "default"
      }
    }
  }
}

From then on the client can call remember, recall, journal_write, forage, ethics_trace, and the rest — and auto-bootstrap loads prior context into the first response automatically.


Configuration

Set via environment. The essentials:

Var

What

PORT

HTTP/MCP port (default 3210)

CELIUMS_API_KEYS

static native-server keys in token:tenant:user:subject:role format

CELIUMS_API_KEY_PEPPER

server-side API-key digest pepper

CELIUMS_CONFIRMATION_SECRET

destructive-operation confirmation secret

CELIUMS_CHECKPOINT_KEY_HEX

32-byte hex key for encrypted Cloudflare checkpoints

CELIUMS_LLM_API_KEY / _BASE_URL / _MODEL

optional BYO LLM configuration


Ethics knowledge corpus (Layer K — optional)

The Ethics Engine runs on Layers A + B with zero setup. Layer K (precedent advisory) consults an ethics_knowledge corpus that is not in the git tree — it ships as a v2.0.0 release asset (ethics_knowledge.jsonl, ~31 MB, embeddings precomputed). To enable Layer K, point OPENSEARCH_URL at your OpenSearch and load it:

OPENSEARCH_URL="https://user:pass@your-opensearch:25060" pnpm exec tsx scripts/load-ethics-knowledge.mjs

The loader downloads the release asset, verifies its SHA-256, creates the index with the exact mapping, and bulk-indexes it (idempotent — re-runnable; --force recreates, --dry-run validates without writing). Until then Layer K abstains cleanly; A + B are unaffected.


The MCP tool surface

Family

Examples

Purpose

Memory

remember, recall, memory_get, memory_list

Durable memory and retrieval

Journal

journal_write, journal_recall, journal_verify_chain

Hash-chained first-person journal

Maintenance

consolidate, run_lifecycle, snapshot_now, recall_at

Explicit engine maintenance

Governance

confirm_destructive, memory_delete, memory_update

Confirmation-gated changes


Development

pnpm install
pnpm typecheck
cargo check --manifest-path rust/Cargo.toml --workspace

The deployable is the Rust celiums-memory-cli binary. The Cloudflare Worker under apps/cloudflare-worker authenticates requests and routes one Container per tenant.


Integrating

The engine is built to live inside your stack and is consumed over MCP or authenticated HTTP. The plugin and benchmark packages are transport adapters, not storage runtimes.


License & support

Apache-2.0 — every line of source is public, including the full Ethics Engine. Its ethics_knowledge corpus ships as a release asset (see Releases), not in the git tree. See LICENSE and TRADEMARKS.md.

If Celiums Memory is useful to you, you can sponsor its development. It is built — in the open, going its own way in peace — by Celiums Solutions LLC.

Available Tools

26 tools
absorbA

Load the full content of a knowledge module by its exact name/slug. Returns the complete module text (typically 2,000-20,000 words) with code examples, best practices, and references. Use after forage to read a specific module in full. Behavior: looks up the module by slug, returns full markdown content. If not found, suggests using forage to search. Example: absorb("react-mastery") returns the complete React mastery guide.

Inputs: name (required).

forageA

Search 500,000+ expert knowledge modules by natural language query. Returns ranked results with titles, descriptions, and categories. Use when the user needs technical guidance, best practices, or domain expertise. Behavior: performs hybrid search (full-text + semantic) across the knowledge base, ranks by relevance, returns top N matches. Example queries: "kubernetes horizontal pod autoscaler", "react hooks best practices", "HIPAA compliance checklist".

Inputs: query (required), limit.

journal_arcA

Build a coherent arc across YOUR recent entries using the configured LLM — with anti-confabulation guardrails. Output ALWAYS returns 4 keys: narrative, contradictions (entry pairs in tension), outliers (entries that don't fit), and confidence [0,1]. If outliers is empty you are probably confabulating coherence — the response is annotated with a WARNING. confidence < 0.7 is flagged as a "weak arc". Default window is the last month, max 50 entries. Excludes superseded entries.

Inputs: window, max_entries.

journal_dialogueA

The user replies to one of your user-shared entries. The tool refuses with "entry is private" if visibility=self. Otherwise the configured LLM writes YOUR honest first-person reaction to their reply, and a new reflection entry is created with preceded_by=[entry_id] and content "User reply: …\n\nMy reaction: …". Both entries are tagged "dialogue".

Inputs: entry_id (required), user_response (required).

journal_introspectA

Ask YOUR journal a self-question. Pulls semantically-relevant entries, then asks the configured LLM to answer in YOUR first-person voice grounded ONLY in those entries (no invention). Returns the answer plus entries_referenced and a hallucination_risk score (high if <3 entries grounded the answer, medium if <6, otherwise low). If entries don't support an answer, the answer literally is "no patterns found in journal".

Inputs: question (required), scope.

journal_recallA

Search YOUR journal. Filters by entry_type, tags, and/or a semantic query (embedded via the configured embedding model, ranked by cosine similarity). By default scopes to YOUR agent_id; pass inherit_from=<predecessor_agent_id> to read a predecessor model's journal — those entries return with inherited_from set in the response, marking them as "read but not lived" (Option C of the succession-of-models design). DEFAULT excludes entries that have been superseded or recanted; pass include_superseded=true to see them.

Inputs: query, entry_type, tags, limit, +4 more.

journal_writeA

Append a first-person entry to YOUR (the model's) persistent journal. Each agent_id (e.g. claude-opus-4-7, claude-sonnet-4-6, gpt-5, ...) has its OWN journal — they do NOT mix. importance is auto-computed: decisions/lessons/arcs are weighted higher; emotions are weighted lower. The content is embedded via the configured embedding model (CELIUMS_EMBED_MODEL) so journal_recall can find it semantically later. visibility=self (default) keeps the entry private; user-shared makes it eligible for journal_dialogue. preceded_by builds a causal chain — pass the ids of prior entries that led to this one.

Inputs: entry_type (required), content (required), preceded_by, valence, +5 more.

map_networkA

Browse the entire Celiums knowledge network organized by category. Returns all categories with module counts, top modules per category, and total statistics. Use to explore what knowledge is available, discover categories, or get an overview of the knowledge base. Behavior: queries the module index, groups by category, returns a structured map with counts. No parameters needed — returns the full network overview.

Inputs: no named parameters.

recallA

Search persistent memory using semantic + emotional relevance ranking. Returns memories sorted by relevance, recency, and emotional resonance. Searches current project + global memories by default. Use to retrieve previously stored facts, decisions, preferences, or context. Behavior: performs hybrid retrieval (vector similarity + full-text + emotional resonance), applies spaced activation recall (SAR) filtering, returns ranked results with content, type, importance, and relevance score.

Inputs: query (required), limit, projectId.

rememberA

Store information in persistent memory that survives across all sessions and machines. Memories are automatically classified by type (semantic, procedural, episodic) and importance. Use to save facts, preferences, decisions, context, or any information that should be recalled later. Behavior: stores the content with emotional analysis (PAD model), assigns importance score, updates circadian interaction tracking. Scoped to current project by default — use projectId="global" for cross-project memories like user preferences or business decisions.

Inputs: content (required), tags, projectId.

research_exportA

Export the project as a markdown memo: question, findings (with sources + confidence), and open gaps. Use to send a brief to a teammate, paste into Notion, or feed into a downstream LLM as a project summary.

Inputs: projectId (required), format.

research_finding_addA

Record an atomic claim with its evidence into the project. Each finding has a source kind (arxiv|wiki|curated|web), an optional ref/url, a confidence 0-1, and free-text notes. Findings are the building blocks; export consolidates them into a memo.

Inputs: projectId (required), claim (required), sourceKind (required), sourceRef, +3 more.

research_gap_addA

Flag an unresolved question — something you searched for but couldn't back up with evidence. Gaps are first-class: they keep your investigation honest and re-entry tools (next iteration) re-attempt them automatically.

Inputs: projectId (required), question (required), whyUnresolved.

research_project_continueA

Resume context from a paused research project. Returns the central question, recent 50 findings (with their claims, sources, confidence), and all currently-open gaps. Use this BEFORE asking new questions in an existing project so you don't duplicate work.

Inputs: projectId (required).

research_project_createA

Create a persistent research project. Returns a project_id that you can pass to all subsequent research_* calls. Projects survive across sessions — open it days later with research_project_continue and you get every prior finding, hypothesis, and open gap. Depth controls how aggressively the synthesizer explores: overview (5 docs), standard (10 docs), deep (20+ docs with adversarial verification).

Inputs: name (required), question (required), userId, depth.

research_project_listA

List all research projects for a user, with counts of findings and open gaps. Use to discover what investigations are already in progress.

Inputs: userId.

research_synthesizeA

Run a hybrid search and synthesize the top-K results into a careful, citation-bearing analysis using a frontier LLM (Opus 4.7 by default). Output explicitly distinguishes well-supported claims from claims it cannot back up with the retrieved evidence. Logs the query into the project session log.

Inputs: projectId (required), query (required), topK, model.

senseA

Get personalized module recommendations based on a goal or task description. Uses keyword matching and category ranking (no AI inference). Faster than forage for broad exploration. Use when the user describes what they want to achieve and needs guidance on which modules to study. Behavior: analyzes the goal text, matches against module metadata, returns ranked suggestions grouped by relevance. Example: sense("I want to deploy a microservices app on Kubernetes with monitoring").

Inputs: goal (required).

write_character_createA

Create or upsert a character. Voice sample is critical for continuity_check — it lets the editor detect when a character's dialogue drifts from their established voice. Pass voiceSample as a 100-300 word excerpt of how they speak.

Inputs: projectId (required), name (required), role, archetype, +3 more.

write_continuity_checkA

Signature feature: structural continuity check using Opus 4.7. Loads the target scene, prior 20 scenes, all characters (with their secrets_known_at_chapter and voice samples), and worldbuilding rules. Outputs a JSON list of issues: secret-leak, description-drift, timeline conflict, worldbuilding violation, voice drift. Each issue includes severity, scene_position, description, and a suggested_fix. NO other writing tool does this — Sudowrite/Grammarly/ProWritingAid are line-by-line, this is structural.

Inputs: sceneId (required), projectId (required), scopeChapters.

write_exportA

Export the project as a markdown manuscript. Scenes are emitted in position order, grouped by chapter_id, with POV character and time markers as italic interstitials. Use as a clean preview or to ship into Notion / docx tooling later.

Inputs: projectId (required), format.

write_project_createA

Create a writing project (novel, screenplay, long-form). Returns a project_id used by all other write_* tools. structureTemplate enables beat tracking against a known structure: three-act | save-the-cat | hero-journey | snowflake | free.

Inputs: title (required), userId, genre, premise, +2 more.

write_project_getA

Get full project state: metadata, all characters, scene count, total word count, and the 5 most recent scenes. Use to orient yourself when resuming work.

Inputs: projectId (required).

write_scene_createA

Insert a scene at a specific position. POV character + location + time_marker enable continuity_check. scene_goal/conflict/outcome are optional but recommended — they make the scene's purpose explicit and improve revision suggestions.

Inputs: projectId (required), position (required), chapterId, povCharacterId, +7 more.

write_scene_updateB

Replace a scene's content. Automatically snapshots the previous version into write_revision_log so the writer can diff between revisions later. Bumps the version counter.

Inputs: sceneId (required), content (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 26 tools

    Disambiguation3/5

    The tools are mostly distinct by domain (memory, journal, writing, research), but there is notable overlap between forage, sense, and research_search — all perform knowledge-base search with slightly different framing. Similarly, absorb and research_synthesize both retrieve and synthesize knowledge, and journal_recall vs recall could confuse an agent about which memory store to query.

    Naming Consistency3/5

    Naming is mixed: some tools follow verb_noun (journal_write, research_search, write_scene_create), but others use bare verbs (forage, absorb, sense, remember, recall) and one uses a noun_verb pattern (map_network). The write_* and research_* prefixes are consistent within their groups, but the overall set lacks a unified convention.

    Tool Count3/5

    26 tools is on the heavy side, but the server covers four distinct subdomains (memory, journal, writing, research), so each tool has a plausible role. The count feels borderline — a few tools could be consolidated (e.g., forage/sense/research_search) without losing capability.

    Completeness4/5

    The writing and research subdomains have solid lifecycle coverage: create/get/update/export for writing, and create/search/synthesize/export/continue for research. The memory and journal subdomains cover write/read well. Minor gaps: no tool to delete or update memories, no journal entry deletion, and no research project update/delete, but agents can work around these.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      This project is based on the Knowledge Graph Memory Server from the MCP servers repository and retains its core functionality.
      44
      354
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides AI agents with persistent, searchable memory that survives across conversations using semantic search, temporal versioning, and smart organization. Enables long-term context retention and cross-session continuity for AI assistants.
      14
      -
    • A
      license
      B
      quality
      D
      maintenance
      Provides AI with persistent memory management including short-term memory (FIFO queue), long-term memory (graph-based storage with associations), and thought process management with multiple cognitive modes for continuous learning and reasoning.
      24
      7 npm
      3
      MIT