| Crates.io | kodegen_candle_agent |
| lib.rs | kodegen_candle_agent |
| version | 0.10.11 |
| created_at | 2025-11-03 16:26:36.610749+00 |
| updated_at | 2026-01-02 15:12:03.79371+00 |
| description | KODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents. |
| homepage | https://kodegen.ai |
| repository | https://github.com/cyrup-ai/kodegen-candle-agent |
| max_upload_size | |
| id | 1914950 |
| size | 8,107,027 |
Memory-efficient, blazing-fast MCP tools for code generation agents.
A high-performance Model Context Protocol (MCP) server that provides cognitive memory capabilities for AI agents. Built with Rust and the Candle ML framework, it delivers semantic memory storage, retrieval, and quantum-inspired routing for intelligent code generation workflows.
rust-toolchain.toml)# Clone the repository
git clone https://github.com/cyrup-ai/kodegen-candle-agent.git
cd kodegen-candle-agent
# Build with default features
cargo build --release
# Or build with hardware acceleration
cargo build --release --features metal # macOS
cargo build --release --features cuda # NVIDIA GPU
# Start the MCP server (HTTP transport)
cargo run --release
# The server will start on http://localhost:3000 by default
Add to your MCP client configuration (e.g., Claude Desktop's claude_desktop_config.json):
{
"mcpServers": {
"kodegen-candle-agent": {
"command": "cargo",
"args": ["run", "--release"],
"cwd": "/path/to/kodegen-candle-agent"
}
}
}
The server provides four MCP tools for memory operations:
Ingest files or directories into a named memory library:
{
"tool": "memory_memorize",
"arguments": {
"input": "/path/to/your/codebase",
"library": "my-project"
}
}
Returns a session_id for tracking the async operation.
Poll the progress of a memorization task:
{
"tool": "memory_check_memorize_status",
"arguments": {
"session_id": "your-session-id"
}
}
Returns status (IN_PROGRESS, COMPLETED, FAILED) with progress details.
Search for relevant memories using semantic similarity:
{
"tool": "memory_recall",
"arguments": {
"query": "authentication logic",
"library": "my-project",
"top_k": 5
}
}
Returns ranked memories with similarity scores and importance metrics.
Enumerate all available memory libraries:
{
"tool": "memory_list_libraries",
"arguments": {}
}
┌─────────────────────────────────────────────────────────┐
│ MCP Tools Layer │
│ (memorize, recall, check_status, list_libraries) │
└─────────────────────┬───────────────────────────────────┘
│
┌─────────────────────▼───────────────────────────────────┐
│ Memory Coordinator Pool │
│ (Per-library coordinator management) │
└─────────────────────┬───────────────────────────────────┘
│
┌─────────────┼─────────────┐
│ │ │
┌───────▼─────┐ ┌────▼────┐ ┌──────▼──────┐
│ Graph DB │ │ Vector │ │ Cognitive │
│ (SurrealDB) │ │ Storage │ │ Workers │
└─────────────┘ └─────────┘ └─────────────┘
# Full cognitive capabilities
cargo build --features full-cognitive
# Specific vector backends
cargo build --features faiss-vector
cargo build --features hnsw-vector
# API server (HTTP endpoint for memory operations)
cargo build --features api
# Development mode (debug + desktop features)
cargo build --features dev
# Run all tests
cargo test
# Run specific test module
cargo test --test memory
# Run with output
cargo test -- --nocapture
# Run a single test
cargo test test_quantum_mcts
# Run the demo that exercises all tools
cargo run --example candle_agent_demo --release
The system is optimized for production use:
arrayvec and smallvec for hot pathskodegen_simd for vector operationsTypical performance on Apple M1 Pro:
Memory system behavior can be configured via environment variables or the MemoryConfig struct:
use kodegen_candle_agent::memory::utils::config::MemoryConfig;
let config = MemoryConfig {
database: DatabaseConfig {
connection_string: "surrealkv://memory.db".to_string(),
namespace: "kodegen".to_string(),
database: "memories".to_string(),
username: None,
password: None,
},
vector: VectorConfig {
backend: VectorBackend::InstantDistance,
dimension: 1024,
},
cognitive: CognitiveConfig::default(),
};
The system uses the Stella embedding model family by default:
Models are automatically downloaded from HuggingFace Hub on first use.
Contributions are welcome! Please see our contributing guidelines.
This project is dual-licensed under:
You may choose either license for your purposes.
Built with ❤️ by the KODEGEN.ᴀɪ team