Skip to main content
Glama

Coherra

An AI agent's memory gets messy. Coherra keeps it clean.

After months of use, any long-running agent accumulates contradictions (the same fact stored twice with different values), duplicates (the same value under different key names), and stale entries (facts that were true six months ago but almost certainly aren't now). Coherra audits the entire memory on demand, scores its health, surfaces every issue with a clear explanation, and repairs them — logging every single action permanently inside Sibyl Memory itself. No external database. No separate service. Everything lives inside Sibyl.


Live Production Deployment

  • Production Domain (Web App & Chat): https://coherra.xyz (or https://coherra.app)

  • Production API & x402 Server: https://api.coherra.xyz (or https://api.coherra.app)

  • Base Mainnet Smart Contract (USDC): 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (Chain ID: 8453)

  • Official Payout Address: 0x1BFAe4EE12c8f2bF17B8EEb8Ea0BcB32AdbB240B

  • Track 1: In-browser hosted multi-model chat with Gemini, OpenAI, Grok, and Claude.

  • Track 2: Local MCP/CLI memory audit and drift resolution.


Related MCP server: memory-immune-system

Architecture

┌─────────────────────────────────────────────────────────┐
│                        Agent / IDE                       │
│           (Claude Code, Codex CLI, Cursor, …)            │
└───────────────────────┬─────────────────────────────────┘
                        │ MCP (stdio)
          ┌─────────────▼──────────────┐
          │       Coherra MCP Server    │
          │  coherra_remember           │  ← structured writes
          │  coherra_recall             │  ← single entity read
          │  coherra_list               │  ← browse memory
          │  coherra_audit              │  ← run full scan
          │  coherra_repair             │  ← fix one issue
          │  coherra_repair_safe        │  ← batch safe fixes
          └─────────────┬──────────────┘
                        │ sibyl-memory-client SDK
          ┌─────────────▼──────────────┐
          │       Sibyl Memory          │
          │  WARM tier  — entities      │  ← facts, preferences, people
          │  HOT  tier  — state         │  ← coherra:last_audit, coherra:config
          │  COLD tier  — journal       │  ← coherra_scan, coherra_repair events
          └─────────────────────────────┘
                   ~/.sibyl-memory/memory.db

Coherra sits between the agent and Sibyl Memory. It adds a schema layer (versioned, confidence-tagged bodies), an audit engine (three detectors: contradiction, duplicate, staleness), and a repair engine that logs every action to Sibyl's own append-only journal — so the audit trail is itself part of the memory being managed.


Quickstart

# 1. Clone and install
git clone <repo>
cd coherra
pip install -e .

# 2. Make sure Sibyl Memory is initialised
#    (run once if you haven't already)
sibyl init

# 3. Load the demo dataset
python -m coherra.seed --demo

# 4. Run your first audit
coherra scan

# 5. Browse the issues
coherra issues

# 6. Fix safe issues automatically
coherra fix --all

# 7. Resolve contradictions interactively
coherra fix <issue-id>

# 8. Confirm clean memory
coherra scan

CLI reference

Command

What it does

coherra scan

Run a full audit — contradiction, duplicate, staleness checks

coherra health

One-line summary of the last scan result

coherra issues [--severity <s>]

List every flagged issue, grouped by severity

coherra fix <id> [action]

Fix one issue; contradictions get an interactive prompt

coherra fix --all

Auto-apply all safe repairs (duplicates + stale)


MCP server

Add to your .mcp.json or Claude Code settings:

{
  "mcpServers": {
    "coherra": { "command": "coherra-mcp" }
  }
}

Tools exposed: coherra_remember, coherra_recall, coherra_list, coherra_audit, coherra_repair, coherra_repair_safe.


The pitch

Most memory systems only answer the question "what do I know?" Coherra answers "what do I know that's wrong?" — and fixes it, permanently, with a complete audit trail stored inside the same memory it's cleaning.

Built for the Sibyl Labs Memory Hackathon · August 2026. Requires: sibyl-memory-client >= 0.5.0, mcp >= 1.0.0.

Available Tools

7 tools
coherra_auditA

Run a full Coherra memory audit and return the results.

Scans all entities in Sibyl Memory for three classes of drift:

  • contradiction two names that likely refer to the same fact but carry different values

  • duplicate two entities in the same category with nearly identical values

  • stale an entity whose body.updated_at exceeds the per-category threshold from coherra:config

Side-effects:

  • Seeds coherra:config with default thresholds if absent

  • Writes results to coherra:last_audit (memory_set_state)

  • Appends a coherra_scan journal event (memory_record_event)

Returns: { "ok": True, "timestamp": "", "health_score": 0-100, "entity_count": N, "issue_count": N, "issues_found": [ {severity, category, name, detail, ...} ] }

Inputs: no named parameters. Returns: object

coherra_listA

List entities managed by Coherra, optionally filtered by category.

Returns entities most-recently-updated first. Each result includes the structured Coherra body so the caller can inspect value, confidence, source, and timestamps without a separate recall call.

Args: category: Optional category filter. Omit to list all categories. limit: Maximum entities to return (default 50, max 200).

Returns: {"ok": True, "category": ..., "count": N, "results": [...]}

Inputs: limit, category. Returns: object

coherra_onboardA

Import JSON data from another tool into Coherra.

Runs the full onboarding pipeline:

  1. Parse the JSON into individual records

  2. Categorize each record (category, name, confidence)

  3. Write to Sibyl Memory using the Coherra schema

  4. Audit for contradictions, duplicates, staleness

  5. Auto-repair safe issues (duplicates + stale)

  6. Flag contradictions for manual review

Args: import_data: A dict or list representing the JSON export. Accepts flat dicts, nested dicts, lists of dicts (with key/value fields), or lists of strings.

Returns: { "ok": True, "imported": N, # records written "auto_cleaned": X, # safe issues fixed "flagged_for_review": Y, # contradictions needing manual fix }

Inputs: import_data (required). Returns: object

coherra_recallA

Fetch a single Coherra entity by (category, name).

Returns the full entity including the structured Coherra body (value, confidence, source, created_at, updated_at, version). Raises a NOT_FOUND error if the entity does not exist.

Args: category: The category the entity was stored under. name: The unique-within-category key.

Returns: {"ok": True, "category": ..., "name": ..., "body": {...}}

Inputs: name (required), category (required). Returns: object

coherra_rememberA

Store a structured fact in Sibyl Memory using Coherra's schema.

Wraps memory_remember with a versioned body shape so all Coherra entities are uniform and auditable.

Args: category: Logical grouping, e.g. "people", "projects", "prefs". name: Unique-within-category key, e.g. "alice", "acme-deal". value: The fact to store — any JSON-serialisable value. confidence: Optional float 0.0–1.0 expressing certainty. source: Optional provenance tag: "conversation", "tool", "inference", etc.

Returns: {"ok": True, "category": ..., "name": ...} on success.

Inputs: name (required), value (required), category (required), source, +1 more. Returns: object

coherra_repairA

Apply one repair to a flagged issue from the last audit.

Actions by severity: stale: "archive" — forget the entity "refresh" — bump updated_at to now (fact still true) duplicate: "merge" — keep higher-confidence entry, archive the other contradiction: "keep_a" — keep primary (category/name), archive related "keep_b" — keep related_entity, archive primary "merge_manual" — archive both, write new canonical entity at primary address using supplied value

Args: issue_id: 10-char hex id from coherra_audit issues_found list. action: Repair action string (see above). value: Required only for contradiction/merge_manual — the correct canonical value to write.

Returns: {ok, issue_id, severity, action_taken, archived, written}

Inputs: action (required), issue_id (required), value. Returns: object

coherra_repair_safeA

Batch-apply all safe repairs from the last audit.

Auto-applies:

  • stale → archive (entity is old, remove it)

  • duplicate → merge (keep higher-confidence copy, archive the other)

Contradictions are NEVER auto-resolved — they require explicit human choice via coherra_repair with keep_a / keep_b / merge_manual.

Returns: {ok, fixed_count, skipped_contradictions, results: [...]}

Inputs: no named parameters. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 7 tools

    Disambiguation4/5

    Each tool targets a distinct operation: remember, recall, list, audit, repair, batch repair, and import. The only possible confusion is between coherra_repair and coherra_repair_safe, but their descriptions clearly separate single-issue repair from batch auto-repair.

    Naming Consistency4/5

    All tools share the coherra_ prefix and use snake_case with a verb-oriented style. The naming is mostly consistent, though coherra_repair_safe and coherra_onboard are slightly less parallel than simple verb_noun forms.

    Tool Count5/5

    Seven tools is a well-scoped count for a memory management server. Each tool serves a clear purpose, covering storage, retrieval, listing, auditing, repair, batch repair, and importing without unnecessary bloat.

    Completeness3/5

    The set covers create, read, list, audit, repair, and import workflows, but there is no direct update or delete tool. Agents must work around this by using remember to overwrite or repair actions to archive, which is a notable gap in standard CRUD coverage.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to audit and clean their memory files by scanning for duplicates, broken links, stale facts, and conflicts, with non-destructive, reversible fixes and a full audit trail. It also lets the calling agent serve as the conflict judge through MCP tools.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables real-time auditing of LLM long-term memory to detect contradictions, user-introduced falsehoods, staleness, and unsourced fabrications, while providing a safe memory store with tools like recall, review, and restore.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides AI agents with long-term memory that tracks temporal validity and corrections, enabling context-aware retrieval of past facts via MCP tools.
      MIT