Skip to content

ccheney/engram

Repository files navigation

Engram

Bitemporal, graph-backed memory system for AI coding agents. Captures reasoning traces from Claude Code, Codex CLI, and others into a knowledge graph with full temporal history.

engram_preview.webm

Quick Start

# Prerequisites: Bun v1.3.5+, Docker

git clone https://github.com/ccheney/engram.git
cd engram
bun install
bun run infra:up   # Start FalkorDB, Qdrant, NATS, PostgreSQL
bun run dev        # Start all services

Verify: Observatory http://localhost:6178 | API http://localhost:6174/v1/health

Architecture

CLI Agents → Ingestion (6175) → NATS → Memory → FalkorDB
                                    ↓
                              Search (6176) → Qdrant
                                    ↓
                           Neural Observatory (6178)

Storage: FalkorDB (graph), Qdrant (vectors), NATS+JetStream (events), PostgreSQL (API keys)

Project Structure

apps/
├── api/          # REST API - memory operations, auth, rate limiting (6174)
├── control/      # Session orchestration, VFS, time-travel
├── ingestion/    # Event parsing, PII redaction (6175)
├── mcp/          # MCP server - remember/recall/query tools
├── memory/       # Graph persistence, turn aggregation
├── observatory/  # Real-time visualization (6178)
├── search/       # Python/FastAPI hybrid search (6176)
└── tuner/        # Python/FastAPI hyperparameter optimization (6177)

packages/
├── benchmark/    # LongMemEval evaluation (Python)
├── common/       # Utilities, errors
├── events/       # Zod event schemas
├── graph/        # Bitemporal models, repositories
├── infra/        # Pulumi IaC (GCP/GKE)
├── logger/       # Pino structured logging
├── parser/       # Provider parsers (8 formats)
├── storage/      # DB clients (Kafka, Redis, FalkorDB, Qdrant)
├── temporal/     # Time-travel, rehydration
├── tuner/        # Tuner client, CLI
└── vfs/          # Virtual file system

Commands

bun run dev          # Start all services
bun run build        # Build everything
bun test             # Run tests
bun run typecheck    # TypeScript validation
bun run lint         # Biome linting
bun run infra:up     # Start infrastructure
bun run infra:down   # Stop infrastructure

MCP Tools

Tool Purpose
engram_remember Store memory with type and tags
engram_recall Retrieve memories via hybrid search
engram_query Execute Cypher queries (local only)
engram_context Get comprehensive context for task (local only)
engram_enrich_memory Enrich memory with summary/keywords (requires sampling)
engram_extract_facts Extract key facts from text (requires sampling)
engram_summarize Summarize text using client LLM (requires sampling)

API Endpoints

Endpoint Method Purpose
/v1/memory/remember POST Store memory
/v1/memory/recall POST Hybrid search
/v1/memory/query POST Cypher query
/v1/memory/context POST Context assembly

Providers

Anthropic, OpenAI, Gemini, Claude Code, Cline, Codex, XAI, OpenCode

Infrastructure

All services use Kaprekar's constant (6174) as the base port.

Services: API 6174 · Ingestion 6175 · Observatory 6178 · Search 6176

Databases: FalkorDB 6179 · NATS 6181 · PostgreSQL 6183 · Qdrant 6180

Dev Tools: NATS Monitor 6182 · Optuna Dashboard 6184 · Tuner 6177

License

AGPL-3.0

About

A bitemporal, graph-backed memory system for AI coding agents.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •