ForgeKit - Deterministic Code Intelligence SDK
ForgeKit provides a unified SDK for code intelligence operations, integrating multiple tools into a single API with support for both SQLite and Native V3 backends.
Features
- 🔍 Graph Queries: Symbol lookup, reference tracking, call graph navigation
- 🔎 Semantic Search: Pattern-based code search via LLMGrep integration
- 🌳 Control Flow Analysis: CFG construction and analysis via Mirage
- ✏️ Safe Code Editing: Span-safe refactoring via Splice
- 📊 Dual Backend Support: SQLite (stable) or Native V3 (high performance)
- 📡 Pub/Sub Events: Real-time notifications for code changes
- ⚡ Async-First: Built on Tokio for async/await support
Quick Start
use ;
async
Installation
Add to your Cargo.toml:
[]
= "0.2"
Feature Flags
ForgeKit uses feature flags for flexible backend and tool selection:
Storage Backends:
sqlite- SQLite backend (default)native-v3- Native V3 high-performance backend
Tool Integrations (per-backend):
magellan-sqlite/magellan-v3- Code indexingllmgrep-sqlite/llmgrep-v3- Semantic searchmirage-sqlite/mirage-v3- CFG analysissplice-sqlite/splice-v3- Code editing
Convenience Groups:
tools-sqlite- All tools with SQLitetools-v3- All tools with V3full-sqlite- Everything with SQLitefull-v3- Everything with V3
Examples
# Default: SQLite backend with all tools
= "0.2"
# Native V3 backend with all tools
= { = "0.2", = ["full-v3"] }
# Mix and match: Magellan with V3, LLMGrep with SQLite
= { = "0.2", = ["magellan-v3", "llmgrep-sqlite"] }
Workspace Structure
ForgeKit is organized as a workspace with three crates:
| Crate | Purpose | Documentation |
|---|---|---|
forge_core |
Core SDK with graph, search, CFG, and edit APIs | API Docs |
forge_runtime |
Indexing, caching, and file watching | Architecture |
forge_agent |
Deterministic AI agent loop | Manual |
Backend Comparison
| Feature | SQLite | Native V3 |
|---|---|---|
| ACID Transactions | ✅ Full | ✅ WAL-based |
| Raw SQL Access | ✅ Yes | ❌ No |
| Dependencies | libsqlite3 | Pure Rust |
| Performance | Fast | 10-20x faster |
| Pub/Sub | ✅ Yes | ✅ Yes |
| Tool Compatibility | All tools | All tools (v2.0.5+) |
Recommendation: Use Native V3 for new projects. Use SQLite if you need raw SQL access.
Pub/Sub (Real-time Events)
ForgeKit supports real-time event notifications for code changes:
use ;
use mpsc;
async
Event Types
NodeChanged- Symbol created or modifiedEdgeChanged- Reference/call created or modifiedKVChanged- Key-value store entry changedSnapshotCommitted- Transaction committed
Documentation
- API Reference - Complete API documentation
- Architecture - System design and internals
- Manual - User guide and tutorials
- Contributing - Contribution guidelines
- Changelog - Version history
Tool Integrations
ForgeKit integrates with these code intelligence tools:
| Tool | Purpose | Backend Support |
|---|---|---|
| magellan | Code indexing and graph queries | SQLite, V3 |
| llmgrep | Semantic code search | SQLite, V3 |
| mirage-analyzer | CFG analysis | SQLite, V3 |
| splice | Span-safe editing | SQLite, V3 |
License
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Note: This is an early-stage project. APIs may change until v1.0.