repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources15d ago| #1 | # Clawd Memory vs Hindsight Self-Hosted |
| #2 | |
| #3 | **Last updated:** 2026-05-13 |
| #4 | |
| #5 | Clawd Memory uses the Mnemosyne SQLite engine for local storage and recall, then adds Clawd-specific agent workflow, markdown vaulting, Solana/OODA metadata, and operational memory rules. |
| #6 | |
| #7 | This is an honest, technical comparison between Clawd Memory's local engine and Hindsight self-hosted (local Docker, not the managed Cloud product). Every claim below is grounded in source code, not fabricated benchmarks or aspirational APIs. |
| #8 | |
| #9 | > **TL;DR:** They are not direct competitors. Hindsight is a **memory engine** with sophisticated NLP and multi-signal retrieval. Mnemosyne is a **memory layer** optimized for simplicity, speed, and single-machine deployments. Choose based on what you actually need. |
| #10 | |
| #11 | --- |
| #12 | |
| #13 | ## Architecture |
| #14 | |
| #15 | | Dimension | Mnemosyne | Hindsight Self-Hosted | |
| #16 | |---|---|---| |
| #17 | | **Process model** | In-process Python library | Separate Docker containers (FastAPI + PostgreSQL) | |
| #18 | | **IPC overhead** | Zero (direct function calls) | HTTP + JSON serialization to localhost:8888 | |
| #19 | | **Database** | SQLite (single file, WAL mode) | PostgreSQL + pgvector extension | |
| #20 | | **Embedding model** | fastembed ONNX — BAAI/bge-small-en-v1.5 (~67MB) | sentence-transformers PyTorch (~500MB) | |
| #21 | | **Vector search** | sqlite-vec (int8/bit/float32) or numpy fallback | pgvector HNSW (mature, optimized) | |
| #22 | | **Cold start** | Instant (if models cached locally) | ~5–10s (Docker container boot + model loading) | |
| #23 | | **Vector storage** | int8 (default): 384 bytes per 384-dim vector | float32: ~1536 bytes per 384-dim vector | |
| #24 | | | bit (optional): 48 bytes per 384-dim vector | | |
| #25 | | **Runtime memory** | ~10–20MB per session (SQLite + ONNX) | ~100–300MB (PostgreSQL pool + PyTorch) | |
| #26 | |
| #27 | --- |
| #28 | |
| #29 | ## Setup |
| #30 | |
| #31 | | Step | Mnemosyne | Hindsight Self-Hosted | |
| #32 | |---|---|---| |
| #33 | | Install | `pip install mnemosyne-memory` | `docker compose up` (requires Docker) | |
| #34 | | Dependencies (core) | Python stdlib + SQLite — nothing else | Docker, PostgreSQL, pgvector extension | |
| #35 | | Dependencies (semantic) | `pip install mnemosyne-memory[embeddings]` → fastembed (ONNX) | sentence-transformers (PyTorch) or TEI container | |
| #36 | | Dependencies (LLM) | `pip install mnemosyne-memory[llm]` → ctransformers + GGUF, or remote OpenAI-compatible API | Local LLM or remote API | |
| #37 | | Configuration | Zero config. Sensible defaults. Env vars optional. | YAML config, PostgreSQL connection, port bindings | |
| #38 | | Number of containers | 0 | 2–3 (API server, PostgreSQL, optional embedding worker) | |
| #39 | |
| #40 | **Verdict:** Mnemosyne has a materially simpler install path. `pip install` vs Docker Compose is a real difference, especially on resource-constrained environments or ephemeral VMs. |
| #41 | |
| #42 | --- |
| #43 | |
| #44 | ## Memory Model |
| #45 | |
| #46 | ### Mnemosyne: BEAM (Bilevel Episodic-Associative Memory) |
| #47 | |
| #48 | Three SQLite tables: |
| #49 | |
| #50 | | Tier | Purpose | Behavior | |
| #51 | |---|---|---| |
| #52 | | **Working memory** | Hot, recent context | Auto-injected into prompts via `pre_llm_call` hook. TTL-based eviction (default 24h). Max 10,000 items. FTS5 indexed. | |
| #53 | | **Episodic memory** | Long-term consolidated storage | Populated by `sleep()` consolidation. Hybrid vector + FTS5 search. | |
| #54 | | **Scratchpad** | Temporary agent workspace | Not searchable, not consolidated. Cleared explicitly. Max 1,000 items. | |
| #55 | |
| #56 | Additional: **TripleStore** — temporal knowledge graph with `valid_from`/`valid_until` for point-in-time queries. |
| #57 | |
| #58 | **Core operations:** `remember()`, `recall()`, `sleep()` — intentionally simple. |
| #59 | |
| #60 | ### Hindsight: Retain / Recall / Reflect |
| #61 | |
| #62 | | Operation | Mnemosyne equivalent | Gap? | |
| #63 | |---|---|---| |
| #64 | | **Retain** — LLM-driven fact extraction, entity normalization, 2–5 structured facts per chunk | `remember()` stores raw text + optional embedding. `extract=True` enables LLM fact extraction. | **Partial gap.** Mnemosyne can extract facts via LLM but has no automatic entity normalization. | |
| #65 | | **Recall** — 4-way parallel (semantic + BM25 + graph + temporal), RRF fusion, cross-encoder rerank | `recall()` — hybrid (vector + FTS5 + importance) × recency decay. Single-pass. | **Design difference.** Mnemosyne is simpler by choice. | |
| #66 | | **Reflect** — Agentic loop with tool calling, mental models, disposition traits | `sleep()` — LLM summarization of working → episodic. No agentic loop, no mental models. | **Gap.** Mnemosyne does consolidation, not reasoning about knowledge. | |
| #67 | |
| #68 | **Honest assessment:** Hindsight's model is more sophisticated. Mnemosyne's model is intentionally simpler — fewer moving parts, fewer failure modes, but also fewer capabilities. |
| #69 | |
| #70 | --- |
| #71 | |
| #72 | ## Retrieval |
| #73 | |
| #74 | | Feature | Mnemosyne | Hindsight Self-Hosted | |
| #75 | |---|---|---| |
| #76 | | **Vector search** | sqlite-vec (cosine distance) | pgvector HNSW | |
| #77 | | **Keyword search** | SQLite FTS5 | PostgreSQL full-text + BM25 | |
| #78 | | **Graph search** | TripleStore (subject-predicate-object, temporal) | Native knowledge graph with co-occurrence tracking | |
| #79 | | **Temporal search** | `from_date`/`to_date` filters + configurable exponential decay boost (`temporal_weight`, `temporal_halflife`) | Native date parsing, `occurred_start/end`, temporal recall strategy | |
| #80 | | **Scoring formula** | `score = vec_weight × vec_sim + fts_weight × fts_rank + importance_weight × importance`, then × recency decay | 4-way parallel retrieval → RRF fusion → cross-encoder rerank | |
| #81 | | **Default weights** | 50% vector, 30% FTS, 20% importance | Learned fusion weights | |
| #82 | | **Configurable?** | Yes — `vec_weight`, `fts_weight`, `importance_weight` params per query, or via env vars | Yes — configurable strategies | |
| #83 | | **Reranking** | None (single-pass) | Cross-encoder rerank | |
| #84 | |
| #85 | **The trade-off:** Mnemosyne's single-pass scoring is faster but less precise. Hindsight's 4-way + rerank pipeline finds more relevant results at the cost of latency and compute. |
| #86 | |
| #87 | --- |
| #88 | |
| #89 | ## Entity Extraction |
| #90 | |
| #91 | | Feature | Mnemosyne | Hindsight Self-Hosted | |
| #92 | |---|---|---| |
| #93 | | **Method** | Regex patterns + pure Python Levenshtein distance | spaCy NLP pipeline + LLM extraction | |
| #94 | | **Patterns** | `@mentions`, `#hashtags`, `"quoted phrases"`, capitalized sequences (2–5 words) | Full NLP: named entities, noun phrases, coreference | |
| #95 | | **Fuzzy matching** | Levenshtein distance with prefix/substring bonuses. `"Abdias"` ≈ `"Abdias J"` (similarity: 0.925) | Trigram/full resolution strategies. Entity co-occurrence tracking. | |
| #96 | | **Storage** | TripleStore triples: `(memory_id, "mentions", "entity_name")` | Structured entity table with normalization | |
| #97 | | **Speed** | ~0.01ms per extraction | Heavier (spaCy model loading + inference) | |
| #98 | | **Accuracy** | Good for proper nouns, handles, hashtags. Misses pronouns, complex references. | Higher recall — resolves "she", "the project", complex entity mentions. | |
| #99 | | **Opt-in?** | `extract_entities=True` on `remember()` | Always on | |
| #100 | |
| #101 | **Verdict:** Mnemosyne's regex approach is fast and dependency-free but misses many entity types that spaCy catches. This is a deliberate trade-off: speed and simplicity over NLP accuracy. |
| #102 | |
| #103 | --- |
| #104 | |
| #105 | ## Fact Extraction |
| #106 | |
| #107 | | Feature | Mnemosyne | Hindsight Self-Hosted | |
| #108 | |---|---|---| |
| #109 | | **Method** | LLM-driven (`extraction.py`): sends text to LLM, parses 2–5 factual statements | LLM-driven Retain pipeline with provenance tracking | |
| #110 | | **Fallback chain** | Remote OpenAI-compatible API → local ctransformers GGUF → skip (graceful) | N/A (runs inside container) | |
| #111 | | **Storage** | TripleStore: `(memory_id, "fact", fact_text)` | Structured fact table with evidence tracking | |
| #112 | | **Opt-in?** | `extract=True` on `remember()` | Always on via Retain | |
| #113 | | **Automatic?** | No — caller must opt in per memory | Yes — automatic on all ingested text | |
| #114 | |
| #115 | --- |
| #116 | |
| #117 | ## Integrations |
| #118 | |
| #119 | ### MCP (Model Context Protocol) |
| #120 | |
| #121 | Mnemosyne provides an MCP server with **6 tools** and **2 transports**: |
| #122 | |
| #123 | | Tool | Description | |
| #124 | |---|---| |
| #125 | | `mnemosyne_remember` | Store a memory (supports entity extraction, fact extraction, bank selection) | |
| #126 | | `mnemosyne_recall` | Search memories with hybrid scoring and configurable weights | |
| #127 | | `mnemosyne_sleep` | Run consolidation cycle | |
| #128 | | `mnemosyne_scratchpad_read` | Read agent scratchpad | |
| #129 | | `mnemosyne_scratchpad_write` | Write to scratchpad | |
| #130 | | `mnemosyne_get_stats` | Get memory statistics | |
| #131 | |
| #132 | ``` |
| #133 | mnemosyne mcp # stdio transport (Claude Desktop, etc.) |
| #134 | mnemosyne mcp --transport sse --port 8080 # SSE transport (web clients) |
| #135 | mnemosyne mcp --bank project_a # scoped to a specific bank |
| #136 | ``` |
| #137 | |
| #138 | ### Hermes Agent Integration |
| #139 | |
| #140 | `plugin.yaml` registers **15 tools** and **3 hooks**: |
| #141 | |
| #142 | **Tools:** `mnemosyne_remember`, `mnemosyne_recall`, `mnemosyne_stats`, `mnemosyne_triple_add`, `mnemosyne_triple_query`, `mnemosyne_sleep`, `mnemosyne_scratchpad_write`, `mnemosyne_scratchpad_read`, `mnemosyne_scratchpad_clear`, `mnemosyne_invalidate`, `mnemosyne_export`, `mnemosyne_update`, `mnemosyne_forget`, `mnemosyne_import`, `mnemosyne_diagnose` |
| #143 | |
| #144 | **Hooks:** `pre_llm_call` (context injection), `on_session_start` (session init), `post_tool_call` (memory capture) |
| #145 | |
| #146 | ### Hindsight Integration |
| #147 | |
| #148 | Custom HTTP API on port 8888. Native `openclaw-hindsight` plugin exists for OpenClaw. Hermes integration via HTTP client. |
| #149 | |
| #150 | | | Mnemosyne | Hindsight | |
| #151 | |---|---|---| |
| #152 | | **Hermes** | Native (in-process, no serialization) | HTTP client | |
| #153 | | **OpenClaw** | Planned (adapter not yet built) | Native plugin exists | |
| #154 | | **MCP** | 6 tools, stdio + SSE | Custom HTTP API | |
| #155 | | **Cross-machine** | Export/import JSON only | Any agent with HTTP access to port 8888 | |
| #156 | |
| #157 | --- |
| #158 | |
| #159 | ## Memory Banks |
| #160 | |
| #161 | | Feature | Mnemosyne | Hindsight | |
| #162 | |---|---|---| |
| #163 | | **Named banks** | `BankManager` — create, list, delete, rename banks | `banks` table with strict isolation | |
| #164 | | **Isolation** | Per-bank SQLite file under `~/.hermes/mnemosyne/data/banks/<name>/` | PostgreSQL schema-level isolation | |
| #165 | | **Usage** | `Mnemosyne(bank="work")` or `mnemosyne mcp --bank work` | API-level bank selection | |
| #166 | | **Multi-tenancy** | No access control | HindClaw extension (JWT/API key multi-tenancy) | |
| #167 | | **Stats** | `BankManager.get_bank_stats(name)` — exists, size, path | Per-bank metrics | |
| #168 | |
| #169 | --- |
| #170 | |
| #171 | ## Additional Features |
| #172 | |
| #173 | ### Mnemosyne-specific |
| #174 | |
| #175 | | Feature | Module | Description | |
| #176 | |---|---|---| |
| #177 | | **Streaming** | `core/streaming.py` | `MemoryStream` with push (callbacks) and pull (iterator) patterns. Thread-safe event buffer. | |
| #178 | | **Delta sync** | `core/streaming.py` | `DeltaSync` — incremental synchronization between Mnemosyne instances with checkpointed resume. | |
| #179 | | **Pattern detection** | `core/patterns.py` | `PatternDetector` — temporal (hour/weekday), content (keyword frequency, co-occurrence), sequence patterns. | |
| #180 | | **Memory compression** | `core/patterns.py` | `MemoryCompressor` — dictionary-based, RLE, and semantic compression strategies. | |
| #181 | | **Plugin system** | `core/plugins.py` | `MnemosynePlugin` base class with 4 lifecycle hooks. Built-in: `LoggingPlugin`, `MetricsPlugin`, `FilterPlugin`. Discovers plugins from `~/.hermes/mnemosyne/plugins/`. | |
| #182 | | **Diagnostics** | `diagnose.py` | PII-safe health check — dependencies, database state, vector readiness. No memory content or API keys. | |
| #183 | | **Cost logging** | `core/cost_log.py` | Tracks LLM API usage and costs. | |
| #184 | |
| #185 | ### Hindsight-specific (not in Mnemosyne) |
| #186 | |
| #187 | | Feature | Description | |
| #188 | |---|---| |
| #189 | | **Automatic entity normalization** | "Abdias" and "Abdias J" resolved to same entity automatically | |
| #190 | | **Cross-encoder reranking** | Second-pass neural reranking of retrieval results | |
| #191 | | **Mental models** | Agent reasoning about user preferences and traits | |
| #192 | | **Agentic reflection** | Tool-calling loop during Reflect phase | |
| #193 | | **Conflict detection** | Automatic contradiction detection and merging | |
| #194 | | **Multi-machine sharing** | Network API for distributed agents | |
| #195 | | **Multi-tenancy** | Per-user isolation with access control via HindClaw | |
| #196 | |
| #197 | --- |
| #198 | |
| #199 | ## Performance Characteristics |
| #200 | |
| #201 | | Metric | Mnemosyne | Hindsight Self-Hosted | |
| #202 | |---|---|---| |
| #203 | | **Recall latency (10K corpus)** | ~2–10ms — in-process SQLite + sqlite-vec, no HTTP overhead | ~50–200ms — HTTP round-trip + PostgreSQL + 4-way retrieval + rerank | |
| #204 | | **IPC model** | Direct Python function call | HTTP POST to localhost:8888 → JSON serialization → response parsing | |
| #205 | | **Storage footprint** | ~50–100MB SQLite file per 10K memories | ~200–500MB PostgreSQL + WAL per 10K memories | |
| #206 | | **Model download** | One-time ~67MB (fastembed ONNX) | One-time ~500MB (sentence-transformers PyTorch) | |
| #207 | | **Runtime memory** | ~10–20MB per session | ~100–300MB (PostgreSQL pool + PyTorch runtime) | |
| #208 | | **Consolidation** | `sleep()` — LLM summarization or AAAK fallback, runs on-demand | Background consolidation engine with evidence tracking | |
| #209 | |
| #210 | > **Important caveat on latency numbers:** Mnemosyne's latency advantage comes from being an in-process library calling SQLite directly, compared to HTTP round-trips to a local Docker container. This is an architectural advantage, not a retrieval-quality advantage. If Hindsight were called as a library (not over HTTP), the gap would narrow significantly. |
| #211 | |
| #212 | --- |
| #213 | |
| #214 | ## Dependency Profile |
| #215 | |
| #216 | | Mode | Mnemosyne Dependencies | Network Calls | |
| #217 | |---|---|---| |
| #218 | | **Minimal (keyword only)** | Python stdlib + SQLite | **None** | |
| #219 | | **Semantic search** | + fastembed ONNX (~67MB one-time download) | **One-time** model download, then none | |
| #220 | | **Vector search in SQLite** | + sqlite-vec (pip-installable C extension) | None | |
| #221 | | **LLM consolidation** | + ctransformers + GGUF (~600MB), or remote API | **One-time** model download, or remote LLM API | |
| #222 | | **MCP server** | + mcp, starlette, uvicorn (for SSE) | None at runtime | |
| #223 | |
| #224 | | Mode | Hindsight Dependencies | Network Calls | |
| #225 | |---|---|---| |
| #226 | | **Full stack** | Docker, PostgreSQL, pgvector, sentence-transformers | **One-time** model download, then none | |
| #227 | | **TEI variant** | + HuggingFace TEI container | None at runtime | |
| #228 | |
| #229 | Both systems are fully offline after initial setup. The difference is weight: Mnemosyne's core is Python stdlib + SQLite. Hindsight requires Docker + PostgreSQL even for basic operation. |
| #230 | |
| #231 | --- |
| #232 | |
| #233 | ## When to Choose What |
| #234 | |
| #235 | ### Choose Mnemosyne if: |
| #236 | |
| #237 | - You want `pip install` with zero containers |
| #238 | - You need the fastest possible recall latency for interactive agent loops |
| #239 | - You're running on a resource-constrained environment (VPS, ephemeral VM, CI) |
| #240 | - You're building a single-user, single-machine agent (Hermes, Claude Desktop, etc.) |
| #241 | - You want an MCP-compatible memory layer (stdio + SSE) |
| #242 | - You want full control over the memory model and don't need automatic "magic" |
| #243 | - You value fewer moving parts over sophisticated NLP |
| #244 | - You want memory banks with per-bank SQLite isolation without standing up PostgreSQL |
| #245 | |
| #246 | ### Choose Hindsight Self-Hosted if: |
| #247 | |
| #248 | - You need entity resolution ("Abdias" and "Abdias J" are the same person) |
| #249 | - You need automatic structured fact extraction from raw text |
| #250 | - You need cross-machine memory sharing via network API |
| #251 | - You need multi-tenant memory banks with access control |
| #252 | - You need temporal reasoning ("what did I say last Tuesday?") with automatic date extraction |
| #253 | - You need the highest recall quality (4-way retrieval + cross-encoder rerank) |
| #254 | - You need an OpenClaw integration today (not planned) |
| #255 | - You're okay with Docker + PostgreSQL complexity as a trade-off for richer capabilities |
| #256 | |
| #257 | ### Neither is "better." They serve different points on the simplicity-sophistication spectrum. |
| #258 | |
| #259 | --- |
| #260 | |
| #261 | ## Known Gaps in Mnemosyne (honest list) |
| #262 | |
| #263 | | Gap | Severity | Workaround | |
| #264 | |---|---|---| |
| #265 | | No automatic entity normalization | Medium | `extract_entities=True` captures entities; fuzzy matching helps but doesn't resolve coreference | |
| #266 | | No cross-machine network API | Medium for multi-agent setups | Export/import JSON; same-machine sharing via shared SQLite file. **Can now import FROM Hindsight directly** — migrate without data loss | |
| #267 | | No cross-encoder reranking | Low for most queries | Hybrid scoring with configurable weights covers common cases | |
| #268 | | No automatic conflict detection | Medium | Manual `invalidate(memory_id, replacement_id=new_id)` | |
| #269 | | No multi-tenancy / access control | High for SaaS use cases | Use per-bank SQLite isolation for domain separation | |
| #270 | | No mental models / agentic reflection | Low | `sleep()` does consolidation; reasoning about knowledge is the caller's job | |
| #271 | | OpenClaw adapter not yet built | Medium for OpenClaw users | Hermes integration is native; OpenClaw requires MCP adapter work | |
| #272 | | Temporal queries require explicit dates | Low | `valid_until` and `superseded_by` are manual; `TripleStore` supports `as_of` queries | |
| #273 | |
| #274 | --- |
| #275 | |
| #276 | *This page was rewritten for v2.1 after community feedback about inaccurate comparisons. Every feature listed for Mnemosyne has been verified against the source code. Hindsight features are based on public documentation and the author's direct codebase analysis. If anything here is wrong, please open an issue — we'll fix it.* |
| #277 |