Skip to content

DCPRevere/hippo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

91 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

'||                                 
 ||      ''                         
 ||''|,  ||  '||''|, '||''|, .|''|, 
 ||  ||  ||   ||  ||  ||  || ||  || 
.||  || .||.  ||..|'  ||..|' `|..|' 
              ||      ||            
             .||     .||            

πŸ¦› The memory graph for AI agents that improves whilst it sleeps.
Background passes infer links, resolve contradictions, and weight sources. Server, embedded, or browser via WASM.

Rust edition 2021 hippo v0.1.0


What it is

Hippo extracts entities and relationships from natural language, stores them in a typed graph, and runs background passes that infer new edges, write supersession relationships when sources disagree, and update per-source accuracy.

Reads use an iterative loop: /ask requests additional context from the graph until it has enough to answer.

        write something                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚                                 β”‚   Dreamer    β”‚
              β–Ό                                 β”‚  (background)β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                          β”‚              β”‚
       β”‚  /remember  β”‚                          β”‚  β€’ Linker    β”‚
       β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                          β”‚  β€’ Inferrer  β”‚
              β”‚                                 β”‚  β€’ Reconcilerβ”‚
              β–Ό                                 β”‚  β€’ Consolid. β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” ◄────── reads ────────── β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚  the graph  β”‚ ─────── writes β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
              β”‚
              β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚    /ask     β”‚   ranking by salience + credibility,
       β”‚             β”‚   filtered by supersession
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Design

The Dreamer is the background pass. It walks the graph and emits append-only actions: links between previously unconnected entities, edges inferred from existing structure, supersedes edges when two sources disagree, and consolidation of episodic facts into semantic patterns. See docs/DREAMS.md.

Writes are append-only. Contradictions produce a supersedes edge; the original is retained and filtered out at read time by default. retract and correct are available for explicit removal.

Sources carry an accuracy score updated as contradictions resolve. Edges carry a salience score incremented on each retrieval.

Backends: SQLite, Postgres, in-memory, FalkorDB, Qdrant. The same Rust core compiles to wasm32-unknown-unknown.

Architecture

                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚              GraphBackend                 β”‚
                  β”‚  (trait β€” implemented by 5 backends)      β”‚
                  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                  β”‚ InMemory      β”‚ SQLite    β”‚ Postgres      β”‚
                  β”‚ (test, WASM)  β”‚ (default) β”‚ (multi-node)  β”‚
                  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                  β”‚ FalkorDB (Cypher)         β”‚ Qdrant (vec)  β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β–²
                              β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                      β”‚                      β”‚
   pipeline::             pipeline::             pipeline::
   remember               ask                    dreamer
   (write)                (read)                 (background)
       β”‚                      β”‚                      β”‚
       β”‚                      β–Ό                      β–Ό
       β”‚              iterative LLM loop      WorkerPool drives
       β”‚              over the subgraph       Linker/Inferrer/
       β”‚                                      Reconciler/Consolid.
       β–Ό
   plan β†’ enrich β†’ execute
   (LLM extracts ops; graph
    enriches; ops applied)

Quick start

As a server

# 1. Set credentials
export ANTHROPIC_OAUTH_TOKEN=...      # or ANTHROPIC_API_KEY

# 2. Choose a backend (default: in-memory)
export GRAPH_BACKEND=sqlite
export SQLITE_PATH=./hippo.sqlite

# 3. Enable production safety
export HIPPO_AUTH=true
export HIPPO_RATE_LIMIT=true

# 4. Run
cargo run --release --bin hippo

Using the TypeScript SDK

import { HippoClient } from "@dcprevere/hippo-sdk";

const hippo = new HippoClient({
  baseUrl: "http://localhost:21693",
  apiKey: process.env.HIPPO_API_KEY,
});

// Write
await hippo.observe({ statement: "Alice works at Acme as a lawyer" });

// Read
const { answer } = await hippo.recall({ question: "Where does Alice work?" });

// Trigger one dream pass and inspect what changed
const report = await hippo.dream();
console.log(report); // { facts_visited, links_written, supersessions_written, ... }

// Explicitly correct an error
await hippo.correct({
  edge_id: 42,
  statement: "Alice works at Acme as a doctor",
  reason: "extraction error β€” original transcript said doctor",
});

In the browser (WASM)

import init, { Hippo } from "@dcprevere/hippo-wasm";

await init();
const hippo = new Hippo(JSON.stringify({
  api_key: localStorage.getItem("openai_key"),
  model: "gpt-5.4",
}));

await hippo.remember("I prefer cycling to driving");
const answer = await hippo.ask("How do I get around?");

API surface

Core verbs

Verb HTTP What it does
observe / remember POST /remember Extract entities and facts from a natural-language statement; resolve against existing entities; write append-only edges.
recall / ask POST /ask Iteratively gather context from the graph, return an LLM answer plus the supporting facts.
context POST /context Raw subgraph for a query, no LLM synthesis.
dream POST /maintain Trigger one dream pass; returns a DreamReport with counts. Runs continuously in the background by default.
retract POST /retract Explicit user/agent destructive removal of an edge with audit reason. Distinct from autonomous supersession.
correct POST /correct Convenience: retract + observe in one call.

Auxiliary

Verb HTTP What it does
Provenance GET /edges/:id/provenance Supersession chain for an edge β€” what it replaced, what replaced it.
Graph dump GET /graph Full graph (entities + active edges + invalidated edges).
Events GET /events Server-sent events stream of graph mutations.
Health GET /health Liveness check.
Metrics GET /metrics Prometheus exposition.

Full schemas: see docs/openapi.yaml.

Backend support

Backend Status Best for Dreamer support
SQLite βœ… Stable Single-node, embedded, dev Full (reference impl + parity tests)
Postgres βœ… Stable Multi-node, managed cloud Full (additive CREATE TABLE IF NOT EXISTS migrations)
In-memory βœ… Stable Tests, WASM Full
FalkorDB ⚠️ Experimental Cypher graph queries Implemented; parity tests not yet automated
Qdrant ⚠️ Limited Vector-first deployments Partial (revisit-window is a no-op) β€” not recommended for production Dreamer use

See docs/CONFIG.md#backend-readiness-matrix for details.

Comparison

Hippo Mem0 v3 Zep / Graphiti Supermemory Letta
Contradiction handling Background supersedes None (ADD-only) Write-time invalid_at Write-time isLatest App-defined
Background graph processing βœ… ❌ Ingest-time community detection Documented, not in OSS ❌
Inference of new edges βœ… ❌ ❌ Documented, not in OSS ❌
Salience-on-use ranking βœ… ❌ ❌ ❌ ❌
Append-only writes βœ… n/a ❌ ❌ ❌
Browser (WASM) βœ… ❌ ❌ ❌ ❌
Iterative reads βœ… ❌ ❌ ❌ Via agent loop

Notes:

  • Mem0 v3 (April 2026) removed the v2 graph backend in favour of a pure vector + entity-sidecar model.
  • Supermemory's Derives and Automatic Forgetting are documented but not present in any source available for inspection.

Configuration

Environment variables and hippo.toml cover the same surface. See docs/CONFIG.md for the full matrix.

Quick prod template:

[graph]
backend = "postgres"
name = "hippo_prod"

[graph.postgres]
url = "postgres://hippo:secret@db.internal:5432/hippo"

[auth]
enabled = true

[rate_limit]
enabled = true
requests_per_minute = 60

[pipeline.tuning]
dreamer_worker_count = 2
dreamer_max_units = 200
dreamer_max_tokens = 100000

Production checklist

  • Backend is SQLite or Postgres (not Qdrant for Dreamer use).
  • HIPPO_AUTH=true; HIPPO_INSECURE and ALLOW_ADMIN are unset.
  • HIPPO_RATE_LIMIT=true with a sensible HIPPO_RPM.
  • TLS terminated either by hippo (HIPPO_TLS=true) or a fronting proxy.
  • Dreamer cost ceilings set in hippo.toml.
  • LLM credentials set via *_OAUTH_TOKEN or *_API_KEY.
  • Container runs as non-root (the bundled Dockerfile already does this).

Project layout

hippo/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ backends/           # GraphBackend impls (in_memory, sqlite, postgres, qdrant, falkor)
β”‚   β”œβ”€β”€ pipeline/
β”‚   β”‚   β”œβ”€β”€ ask.rs          # iterative read path
β”‚   β”‚   β”œβ”€β”€ remember.rs     # plan β†’ enrich β†’ execute
β”‚   β”‚   β”œβ”€β”€ maintain.rs     # housekeeping + drives the Dreamer
β”‚   β”‚   └── dreamer/        # Dreamer trait, WorkerPool, Linker/Inferrer/Reconciler/Consolidator
β”‚   β”œβ”€β”€ llm/                # LlmClient + RetryingLlm decorator
β”‚   β”œβ”€β”€ http/               # axum router + handlers
β”‚   └── ...
β”œβ”€β”€ hippo-api/              # shared request/response types (used by SDKs and server)
β”œβ”€β”€ hippo-wasm/             # wasm-bindgen wrapper for in-browser use
β”œβ”€β”€ sdks/typescript/        # @dcprevere/hippo-sdk
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ DREAMS.md           # the Dreamer architecture
β”‚   └── CONFIG.md           # full config reference + backend matrix
└── tests/                  # 450+ unit + contract + idempotency tests

Building & testing

# Native build + unit tests
cargo build --release
cargo test --tests              # ~450 tests, no network needed

# WASM build
cargo check --target wasm32-unknown-unknown --manifest-path hippo-wasm/Cargo.toml

# Lints (CI runs these with -D warnings)
cargo clippy --all-targets -- -D warnings
cargo fmt --check

# Integration / eval tests (require LLM credentials, gated with #[ignore])
cargo test --tests -- --ignored

CI runs unit tests + clippy + fmt on every PR; the eval suite runs nightly via .github/workflows/eval.yml.

Documentation

  • docs/DREAMS.md β€” the Dreamer architecture, design decisions, and shortlist of must-have features.
  • docs/CONFIG.md β€” full env-var matrix, backend readiness, production checklist.
  • docs/openapi.yaml β€” HTTP API spec.

Licence

Hippo is not open source. The repository is published source-available so the implementation can be read, audited, and reasoned about, but there is no permissive licence β€” you may not redistribute, modify, or use the code in your own projects without an explicit written agreement.

If you'd like to use hippo in a product, get in touch.

About

πŸ¦› The memory graph for AI agents that improves whilst it sleeps.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors