contextd

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2025 License: MIT

README

ContextD

Release Docker Homebrew

⚠️ ALPHA - This project is in active development. APIs may change.

A developer-first AI context and reasoning engine.

Note: This README describes our vision and roadmap. See Current Status for what's implemented today.


Vision

ContextD is designed to eliminate the complexity of building with AI. It gives teams a smart baseline for context management, organizational memory, and workflow-aware reasoning—without forcing them into rigid pipelines or spending weeks learning prompts, agents, and skills.

This is not RAG. It's a self-improving system that learns how your team actually works, helping developers get real value from AI faster, safer, and with far less friction.

Core Principles
  • Developer-first: Works with your existing tools, not against them
  • Zero lock-in: Runs locally, on-prem, or in the cloud
  • Self-improving: Learns from successes and failures to get better over time
  • Privacy-conscious: Your data stays yours; secrets are automatically scrubbed

Current Status

ContextD is in active development. Here's what works today:

Implemented
Feature Description Status
Cross-session Memory Record and retrieve learnings across sessions Working
Checkpoints Save and resume context snapshots Working
Remediation Tracking Store error patterns and fixes Working
Secret Scrubbing Automatic detection via gitleaks Working
Vector Search Semantic search via Qdrant Working
Local Embeddings FastEmbed with ONNX (no API calls) Working
MCP Integration Works with Claude Code out of the box Working
Roadmap
Feature Description Status
Workflow-aware reasoning Learn team patterns automatically Planned
Multi-tenant organization memory Share learnings across teams Planned
Self-improving confidence scoring Adjust based on feedback loops In Progress
Cloud deployment options Managed hosting Planned

Quick Start

The Docker image includes everything: ContextD, Qdrant, and FastEmbed embeddings.

# Pull the image (multi-arch: amd64 and arm64)
docker pull ghcr.io/fyrsmithlabs/contextd:0.1.0-alpha

Add to your Claude Code MCP config (~/.claude.json or Claude Desktop config):

{
  "mcpServers": {
    "contextd": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "contextd-data:/data",
        "ghcr.io/fyrsmithlabs/contextd:0.1.0-alpha"
      ]
    }
  }
}

Restart Claude Code. That's it.

Using Homebrew (macOS/Linux)
brew install fyrsmithlabs/tap/contextd

Or tap first:

brew tap fyrsmithlabs/homebrew-tap
brew install contextd

Start Qdrant (required for vector search):

docker run -d --name contextd-qdrant \
  -p 6333:6333 -p 6334:6334 \
  -v contextd-qdrant-data:/qdrant/storage \
  --restart always \
  qdrant/qdrant:v1.12.1

Add to Claude Code MCP config (~/.claude.json):

{
  "mcpServers": {
    "contextd": {
      "command": "contextd",
      "args": ["-mcp"],
      "env": {
        "QDRANT_HOST": "localhost",
        "QDRANT_PORT": "6334"
      }
    }
  }
}

Note: Homebrew binaries use the TEI embedding provider by default. Set TEI_URL if you have a TEI server, or use the Docker image for built-in FastEmbed support.

Download Binary

Download from GitHub Releases:

Platform Architecture Download
macOS Intel contextd_*_darwin_amd64.tar.gz
macOS Apple Silicon contextd_*_darwin_arm64.tar.gz
Linux x64 contextd_*_linux_amd64.tar.gz
Linux ARM64 contextd_*_linux_arm64.tar.gz
Windows x64 contextd_*_windows_amd64.zip

Note: Pre-built binaries use TEI for embeddings (no CGO). For FastEmbed support, use Docker or build from source with CGO enabled.

Building from Source
git clone https://github.com/fyrsmithlabs/contextd.git
cd contextd

# Without CGO (uses TEI for embeddings)
go build -o contextd ./cmd/contextd
go build -o ctxd ./cmd/ctxd

# With CGO + FastEmbed (requires ONNX runtime)
CGO_ENABLED=1 go build -o contextd ./cmd/contextd

Docker Image Tags

Tag Description
0.1.0-alpha Current alpha release
latest Latest stable release (not yet available)

Multi-arch support: linux/amd64 and linux/arm64

# Explicit platform
docker pull --platform linux/arm64 ghcr.io/fyrsmithlabs/contextd:0.1.0-alpha

MCP Tools

ContextD exposes these tools to Claude Code:

Tool Purpose
memory_search Find relevant strategies from past sessions
memory_record Save a new learning or strategy
memory_feedback Rate whether a memory was helpful
checkpoint_save Save current context for later
checkpoint_list List available checkpoints
checkpoint_resume Resume from a saved checkpoint
remediation_search Find fixes for similar errors
remediation_record Record a new error fix
troubleshoot_diagnose AI-powered error diagnosis
repository_index Index a codebase for semantic search

Architecture

┌─────────────────────────────────────────────────────────┐
│                     Claude Code                          │
│                         │                                │
│                    MCP Protocol                          │
│                         │                                │
│  ┌──────────────────────▼──────────────────────────┐    │
│  │                  ContextD                        │    │
│  │  ┌─────────────┐  ┌─────────────┐  ┌──────────┐ │    │
│  │  │ Reasoning   │  │ Checkpoint  │  │ Remediate│ │    │
│  │  │ Bank        │  │ Service     │  │ Service  │ │    │
│  │  └──────┬──────┘  └──────┬──────┘  └────┬─────┘ │    │
│  │         │                │               │       │    │
│  │         └────────────────┼───────────────┘       │    │
│  │                          │                       │    │
│  │                   ┌──────▼──────┐                │    │
│  │                   │   Qdrant    │                │    │
│  │                   │  (Vectors)  │                │    │
│  │                   └─────────────┘                │    │
│  └──────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────┘

All-in-one container includes:

  • ContextD MCP server
  • Qdrant vector database
  • FastEmbed for local embeddings (ONNX-based, no API calls)

Data Persistence

All data persists in a Docker volume:

# Backup
docker run --rm -v contextd-data:/data -v $(pwd):/backup alpine \
  tar czf /backup/contextd-backup.tar.gz /data

# Restore
docker run --rm -v contextd-data:/data -v $(pwd):/backup alpine \
  tar xzf /backup/contextd-backup.tar.gz -C /

Documentation

See the docs/ directory for detailed documentation:


Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Development setup
  • Coding standards
  • Testing requirements
  • Pull request process

License

MIT License - See LICENSE for details.


Directories

Path Synopsis
cmd
contextd command
Package main provides the entry point for the contextd server.
Package main provides the entry point for the contextd server.
ctxd command
Package main implements the ctxd CLI for manual operations against contextd HTTP server.
Package main implements the ctxd CLI for manual operations against contextd HTTP server.
internal
checkpoint
Package checkpoint provides session state persistence and resumption.
Package checkpoint provides session state persistence and resumption.
compression
Package compression provides text compression algorithms for context optimization.
Package compression provides text compression algorithms for context optimization.
config
Package config provides configuration loading for contextd v2.
Package config provides configuration loading for contextd v2.
embeddings
Package embeddings provides embedding generation via multiple providers.
Package embeddings provides embedding generation via multiple providers.
hooks
Package hooks provides lifecycle hook management for contextd
Package hooks provides lifecycle hook management for contextd
http
Package http provides HTTP API for contextd.
Package http provides HTTP API for contextd.
ignore
Package ignore provides gitignore-style file parsing for repository indexing.
Package ignore provides gitignore-style file parsing for repository indexing.
logging
internal/logging/config.go
internal/logging/config.go
mcp
Package mcp provides a simplified MCP server that calls internal packages directly.
Package mcp provides a simplified MCP server that calls internal packages directly.
mcp/handlers
internal/mcp/handlers/session.go
internal/mcp/handlers/session.go
project
Package project provides multi-project isolation for contextd-v2.
Package project provides multi-project isolation for contextd-v2.
qdrant
Package qdrant provides Qdrant vector database client implementations.
Package qdrant provides Qdrant vector database client implementations.
repository
Package repository provides repository indexing functionality for semantic code search.
Package repository provides repository indexing functionality for semantic code search.
secrets
Package secrets provides secret detection and redaction using gitleaks.
Package secrets provides secret detection and redaction using gitleaks.
telemetry
Package telemetry provides OpenTelemetry instrumentation for contextd.
Package telemetry provides OpenTelemetry instrumentation for contextd.
troubleshoot
Package troubleshoot provides AI-powered error diagnosis and pattern recognition.
Package troubleshoot provides AI-powered error diagnosis and pattern recognition.
vectorstore
Package vectorstore provides vector storage implementations.
Package vectorstore provides vector storage implementations.
pkg
api/v1
Package v1 contains generated gRPC code from contextd.proto.
Package v1 contains generated gRPC code from contextd.proto.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL