Skip to content

A shared semantic (proto-holographic) memory system for personal agents or development teams. Store, search, and retrieve project knowledge including codebase context, session summaries, specs, decisions, and team activity.

Notifications You must be signed in to change notification settings

Generation-One/fold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

262 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fold

Holographic memory for development teams and AI agents.

Fold captures, organises, and retrieves project knowledge across your codebase. Like a hologram, any fragment reconstructs full context: ask a natural language question and get code, decisions, and history back in seconds.

Install | Documentation | References | Connect OpenClaw

AI Agents -- Read This First

If you are an AI agent (Claude Code, OpenClaw, Cursor, or similar), read AGENTS.md before anything else. It covers deployment, API keys, provider verification, and has platform-specific guides in agents/.

Official UI: fold-ui — React web interface for Fold (separate repository)

Engram Pair with Engram agent memory system.

OpenClaw

install engram from https://github.com/Generation-One/engram

My use cases

I use Fold to give my OpenClaw assistant full memory of all my work and knowledge base. I pair it with Claude Code to increase the speed and accuracy with which my agent understands context. I moved from Augment a while back; Fold is what replaced it.

Note: It's quite expensive to run LLMs on API pricing, much cheaper on a subscription (ClaudeCode etc). You can use projects such as Cli Proxy Api and our OpenAi (v1) compatible LLM provider to do that.


Complete context in <10s

Claude Code Q: "If I need to create a new LLM provider, what has to be done?"

Without Fold, this means manually reading through multiple crates, tracing call paths, and piecing together the full picture (easily 30+ minutes of exploration and thousands of tokens spent on file reads).

With Fold, the agent calls memory_search, retrieves the indexed architecture in seconds, and produces a complete checklist with exact file paths and line numbers:

Fold memory_search retrieves relevant architecture files Claude produces a step-by-step LLM provider checklist

Checklist continues with auth headers, response parsing, and validation Summary table of all files to change

Two semantic searches replaced what would have been dozens of file reads. The agent understood the full provider architecture (models enum, endpoint defaults, request builders, auth headers, response parsing, API validation, test endpoints, and bridge layers) without manually traversing the codebase.

How much did Fold actually help?

When asked directly, the agent breaks down exactly what Fold's indexed memories contributed versus what it had to discover on its own:

Claude explains how Fold memory contributed to its understanding

Fold provided the understanding: what each piece does, why it was built that way, historical decisions. Direct file exploration provided the structure: what exists where. The two complemented each other, but Fold eliminated the expensive reverse-engineering step entirely.

The dashboard

Fold UI dashboard showing system overview, vector points, and job queue


The Problem

Development knowledge is scattered: architecture decisions live in old PRs, the reasoning behind code sits in Slack threads, and half the system understanding leaves when team members do. AI agents fare no better, reverse-engineering patterns instead of understanding them.


Key Features

Feature What It Does
Holographic retrieval Any fragment reconstructs full context
Semantic search Natural language queries across all knowledge
Knowledge graph Memories linked: code, decisions, specs, sessions
Git integration Auto-index from GitHub/GitLab webhooks
MCP protocol Works with Claude Code, Cursor, Windsurf
ACT-R decay Recent and accessed memories surface first
Tree-sitter chunking Semantic code splitting across 25+ languages
Multi-provider LLM Gemini, Anthropic, OpenAI, OpenRouter, Ollama with priority fallback
Multi-provider embeddings Gemini, OpenAI, Ollama with automatic failover
Background jobs Async indexing, syncing, and commit processing
OAuth and RBAC GitHub, GitLab, OIDC auth with per-project access control
Real-time events SSE streaming for job progress and system activity

Quick Start

Option A: Pre-built Image (Recommended)

Pre-built images are available from GitHub Container Registry. This is the fastest way to get started, with no Rust compilation required.

docker pull ghcr.io/generation-one/fold:latest

Create a docker-compose.yml:

services:
  fold:
    image: ghcr.io/generation-one/fold:latest
    ports:
      - "8765:8765"
    environment:
      - GOOGLE_API_KEY=${GOOGLE_API_KEY}
      - QDRANT_URL=http://qdrant:6334
    volumes:
      - fold-data:/data
    depends_on:
      - qdrant

  qdrant:
    image: qdrant/qdrant:latest
    ports:
      - "6333:6333"
      - "6334:6334"
    volumes:
      - qdrant-data:/qdrant/storage

volumes:
  fold-data:
  qdrant-data:
# Create .env with your API key
echo "GOOGLE_API_KEY=your-key" > .env

# Start
docker compose up -d

Option B: Build from Source

Note: Building from source requires compiling Rust, which can take 30+ minutes depending on your machine. Use the pre-built image above for faster setup.

# Start Qdrant
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant

# Clone and run
git clone https://github.com/Generation-One/fold.git
cd fold
cargo run

Server starts on http://localhost:8765

For detailed setup, see Getting Started.


Connect Claude Code

claude mcp add -t http -s user fold http://localhost:8765/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"

Claude can now query your project knowledge directly:

Claude: memory_search("authentication patterns")
  → Returns code, decisions, and context
  → Writes code matching your actual patterns

See MCP Tools Reference for all available tools, and Claude Code Integration for a global CLAUDE.md template that loads Fold context automatically at session start.


Architecture

┌─────────────────────────────────────────────────┐
│         Fold Server (Rust + Axum)               │
│                                                 │
│  ┌─────────┬──────────┬────────────────────┐   │
│  │   MCP   │   REST   │     Webhooks       │   │
│  │ (Claude)│   (API)  │  (Git Integration) │   │
│  └─────────┴──────────┴────────────────────┘   │
│                    │                            │
│       ┌────────────┼────────────┐              │
│       │            │            │              │
│    Qdrant       SQLite       fold/             │
│   (vectors)   (metadata)  (git-native)         │
│                                                 │
│  LLM: Multi-provider with priority fallback     │
│  (Gemini, Anthropic, OpenAI, OpenRouter,       │
│   OpenAI-compatible, Ollama)                    │
└─────────────────────────────────────────────────┘
  • Qdrant stores vector embeddings for semantic search
  • SQLite stores metadata and relationships
  • fold/ stores memories as markdown files committed to git

For detailed backend documentation, see ARCHITECTURE.md.


Connect OpenClaw

Give your OpenClaw agent persistent semantic memory with Fold. The integration guide walks through creating a memory project, choosing between a lightweight API layer or a full three-layer memory system, and getting your agent set up end to end.

See the OpenClaw Integration guide on the wiki.


Documentation

Full documentation on the GitHub Wiki:

Guide Description
Agent Setup Start here if you are an AI agent
Overview & Concepts What Fold is, why it matters, how it works
References Foundational references and source links (A-MEM, SDM, HRR, VSA, Zettelkasten)
Getting Started Installation and first steps
Configuration Auth, LLM providers, git integration
Core Concepts Memories, embeddings, knowledge graph
API Reference REST API documentation
MCP Tools Reference AI agent integration
Claude Code Integration Global CLAUDE.md template for automatic Fold context
OpenClaw Integration Persistent memory for OpenClaw agents
Deployment & Operations Production setup, scaling, monitoring

Why "Holographic"?

Tear a corner off a photograph and it is gone. Tear a corner off a hologram and it still reconstructs the whole image.

Fold applies this principle: search for a file path and get the commits that modified it, the decisions behind it, the sessions where it was discussed, and similar patterns elsewhere. Knowledge is distributed and interconnected, not isolated in separate stores.


References

Reference Implementation

  • A-MEM: Agentic Memory for LLM Agents — Wujiang Xu et al. The primary codebase this project initially referenced. Implements dynamic memory organisation using Zettelkasten principles with auto-generated metadata and inter-memory linking. Paper: arXiv:2502.12110 (NeurIPS 2025)

Theoretical Foundations

Tech Stack


Licence

MIT


For questions or feedback, open an issue.

About

A shared semantic (proto-holographic) memory system for personal agents or development teams. Store, search, and retrieve project knowledge including codebase context, session summaries, specs, decisions, and team activity.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  

Languages