Stop dumping files and bleeding LLM tokens. okf-generator uses tree-sitter AST parsers to build a deterministic knowledge map. Unlocks lightning-fast, ultra-low-cost, fully-offline indexing for AI coding agents.
Vector databases (RAG) lose source code syntax structures, while full-file loading triggers model memory starvation. okf-generator offers a deterministic middle-ground.
AI coding agents query LLM APIs dozens of times daily. Because they lack local repository indexes, they read massive files repeatedly.
Drag the sliders to see how much your engineering team can save in raw API token expenditures by deploying deterministic okf-generator structures.
Calculated assuming an average raw codebase context load of 45K tokens (naive) versus 1,200 tokens using OKF structured AST lookups.
Everything you need to compile codebases into structured metadata instantly ingestible by any AI agent.
Native Tree-Sitter parsing across 12 languages (Python, Rust, Go, JS, TS, Java, C#, C, C++, Swift, Ruby, Kotlin, SQL) to identify classes, structures, and functions.
Resolves imports, call sites, and inheritance dependencies into logical graph edges (Calls, Called-by, Depends-on) across internal boundaries.
Scans and cross-indexes 12+ configuration manifests (Cargo.toml, package.json, requirements.txt, build.gradle, go.mod, Mix, Gemfile) to map libraries.
Exposes code concepts natively as tools via the Model Context Protocol. Cursor, Claude Desktop, and Cline can explore, search, and parse code automatically.
Extracts high-fidelity Instruction Pairs (`okf pairs`) from AST nodes to train custom private coding SLMs tailored strictly to your architecture.
Generates beautiful, search-enabled 2D interactive graphs of your codebase structure. Great for human onboarding, audits, and code architecture mapping.
Manage files, map repositories, serve interactive diagrams, run diff analysis, or start the AI MCP server with one simple binary command structure.
{
"mcpServers": {
"okf-generator": {
"command": "okf",
"args": [
"mcp",
"/Users/username/WSpace/my_project/okf_bundle",
"--port",
"4567"
]
}
}
}
The Model Context Protocol (MCP) allows client LLMs to invoke external scripts as specialized tools.
By running `okf mcp`, you instantly deploy an offline-first MCP server that exposes code definitions, dependencies, and structure maps. Now your agent in Cursor or Claude desktop doesn't guess filenames; it queries your AST-parsed database directly.
Automate knowledge graph generation on every commit or merge request to ensure your developers and AI agents are always operating on the absolute source of truth.
# .github/workflows/okf-bundle.yml name: okf-pipeline on: push: branches: [ main, develop ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install OKF Generator run: | pip install okf-generator - name: Compile AST Knowledge Bundle run: | okf generate ./src ./okf_bundle --enrich deep - name: Deploy Dashboard to GitHub Pages run: | okf visualize ./okf_bundle docs/index.html
Install the CLI, generate your code index, and plug it directly into your local IDE.
Get the core package via pip, or download the lightweight binary shell runner directly.
pip install okf-generator
Generate your structural graph from your source repository instantly. Fully offline.
okf generate ./src ./bundle
Expose your knowledge bundle to Claude Code or Cursor via the local MCP protocol.
okf mcp ./bundle --port 4567
Start for free with our powerful offline CLI open-source community edition, or upgrade to Pro/Enterprise for secure self-hosted environments.
Perfect for indie hackers, small startups, and solo developers running local coding workflows.
Designed for expanding developer teams that need advanced semantic descriptions and automated repo updates.
For security-conscious sectors requiring self-hosted cluster licenses, compliance auditing, and custom parsers.
Can't find the answer you need? Get in touch with our engineering team directly via GitHub.
Vector search (RAG) breaks code into arbitrary text chunks and generates embeddings. It is entirely unaware of code syntax. When an agent queries a function, RAG often returns irrelevant snippets while losing import pathways and parameters.
okf-generator is deterministic. It maps code structurally using AST Tree-Sitter parsing. This ensures the agent is given an exact mathematical representation of variables, methods, calls, and dependencies with zero hallucination.
No. By default, core extraction runs 100% offline using your local CPU to execute Tree-Sitter parse commands. No code or metadata is sent to any third-party cloud. Optional LLM enrichment can be enabled manually and is compatible with any self-hosted model or private enterprise API.
Our native Model Context Protocol (MCP) server allows okf-generator to connect instantly to major client shells including Cursor, Cline, Windsurf, Claude Code, and Claude Desktop. Developers can run simple `okf install [agent]` directives to initialize system configurations.
`okf pairs` translates your code's structural graph into clean training instructions (JSONL format). This enables you to fine-tune local Small Language Models (SLMs) such as Llama 3 8B or Phi-3 so they natively understand your proprietary engineering patterns, internal libraries, and naming conventions.