AI-aware development context management with immutable architectural constraints
ContextKeeper is a RAG-powered development context awareness system that prevents AI agents from derailing from approved architectural plans through the Sacred Layer - an immutable plan storage system with 2-layer verification.
# Clone and setup
git clone https://github.com/lostmind008/contextkeeper.git
cd contextkeeper
./setup.sh
# Configure environment
cp .env.template .env
# Edit .env with your Google Cloud credentials and SACRED_APPROVAL_KEY
# Start ContextKeeper (runs on port 5556)
source venv/bin/activate
python rag_agent.py start
# Create your first project
./scripts/rag_cli.sh projects create "My Project" /path/to/project
# Ask questions with LLM-enhanced responses
./scripts/rag_cli.sh ask "What is this project about?"
# Get daily briefing
./scripts/rag_cli.sh briefing
- Immutable Plans: Architectural constraints that cannot be modified once approved
- 2-Layer Verification: Hash-based codes + environment key security
- AI Guardrails: Prevent AI agents from suggesting non-compliant changes
- Multi-Project Support: Isolated contexts for different projects
- Smart File Filtering: Automatically excludes node_modules, venv, build files, binaries, and non-relevant languages
- LLM-Enhanced Queries: Natural language responses instead of raw code chunks
- Git Integration: Track development activity through git commits
- Drift Detection: Real-time monitoring of alignment with sacred plans
- 8 MCP Tools: Sacred-aware tools for seamless AI collaboration
- Natural Language: LLM-enhanced responses for technical queries
- Real-time Context: Automatic architectural constraint provision
Document | Description |
---|---|
Installation Guide | Complete setup instructions |
Usage Guide | How to use ContextKeeper effectively |
API Reference | Complete API documentation |
MCP Tools | Claude Code integration guide |
Architecture | System design and components |
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Git Activity β β Multi-Project β β Sacred Layer β
β Tracker β β RAG Agent β β Manager β
βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ChromaDB Vector Storage β
β β’ Project Collections (isolated) β
β β’ Sacred Collections (immutable) β
β β’ Decision & Objective Tracking β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# List all projects
./scripts/rag_cli.sh projects list
# Create a new project with automatic file filtering
./scripts/rag_cli.sh projects create "My Project" /path/to/project
# Focus on a specific project
./scripts/rag_cli.sh projects focus proj_123
# Ask questions with LLM-enhanced natural language responses
./scripts/rag_cli.sh ask "What authentication system are we using?"
# Get daily briefing with project statistics
./scripts/rag_cli.sh briefing
# Track decisions and objectives
./scripts/rag_cli.sh decisions add "Using Redis for caching" "Performance reasons"
./scripts/rag_cli.sh objectives add "Implement user auth" "High priority"
# Create architectural plan
./scripts/rag_cli.sh sacred create proj_123 "Database Architecture" plan.md
# Approve with 2-layer verification
./scripts/rag_cli.sh sacred approve plan_abc123
# Check alignment
./scripts/rag_cli.sh sacred drift proj_123
# Check Sacred Layer health
curl http://localhost:5556/sacred/health
// Add to Claude Code MCP configuration
{
"contextkeeper-sacred": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/contextkeeper/mcp-server/enhanced_mcp_server.js"],
"env": {"RAG_AGENT_URL": "http://localhost:5556"}
}
}
contextkeeper/
βββ docs/ # Documentation
β βββ api/ # API documentation
β βββ guides/ # User guides
β βββ INSTALLATION.md # Setup instructions
β βββ USAGE.md # Usage guide
βββ examples/ # Usage examples
βββ mcp-server/ # Claude Code integration
βββ scripts/ # CLI and setup scripts
βββ tests/ # Test suite
βββ rag_agent.py # Main RAG orchestrator
βββ sacred_layer_implementation.py # Sacred Layer core
βββ git_activity_tracker.py # Git integration
βββ enhanced_drift_sacred.py # Drift detection
- Python 3.8+ with pip
- Node.js 16+ with npm
- Git
- Google Cloud account (for GenAI API)
# Install test dependencies
pip install -r requirements.txt
# Run all tests
pytest tests/ -v
# Run specific test suite
pytest tests/sacred/ -v
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- AI-Assisted Development: Provide architectural context to AI coding assistants
- Team Collaboration: Shared architectural constraints across development teams
- Compliance Monitoring: Ensure development aligns with approved designs
- Knowledge Management: Capture and preserve architectural decisions
- Local-only storage: No data sent to external services (except Google GenAI for embeddings)
- Immutable plans: Sacred plans cannot be modified once approved
- 2-layer verification: Prevents unauthorized plan changes
- Audit trail: Complete history of all sacred operations
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Built with ChromaDB for vector storage
- Powered by Google GenAI for embeddings
- Integrated with Claude Code via MCP
- π Documentation: docs/
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
Made with β€οΈ by LostMindAI