## The Architectural Paradigm Shift

### Why Traditional AI Context Fetching is Costing You a Fortune

Vector databases (RAG) lose source code syntax structures, while full-file loading triggers model memory starvation. okf-generator offers a deterministic middle-ground.

The Context Bloat (Without OKF)

#### Naive File Loading & Semantic Vector Slices

- No call hierarchy tracking: Vectors chunk code raw, shredding class context and missing how methods connect.
- Heavy API bill overhead: Feeding entire class files (30K+ tokens) into the LLM just to get one method signature.
- SLM memory choke: Local models like Llama 8B or Phi-3 can't process massive code windows. They forget context or run out of memory.

Average cost per AI coding task:
$1.35 / task (45,000 raw tokens loaded)
The OKF Edge (AST Knowledge Graph)

#### AST Extraction + Deterministic Cross-Linking

- Full AST graph mapping: Captures exact callers, callees, parameters, types, and dependencies automatically.
- Surgically tiny payloads: Feeds agents highly dense 300-token summaries containing explicit reference signatures.
- Unlocks local LLMs: Tight context requirements fit into local SLM memory instantly, allowing laptops to achieve cloud-like results.

Average cost per AI coding task:
$0.0036 / task (1,200 linked tokens loaded)
Business ROI Calculator

## Calculate Your AI Context API Savings

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.

Average context savings: ~97.3% less tokens per prompt
Context loading delay: Reduced from 18 seconds to 1.5 seconds
Fully Local AI option: Save 100% of LLM costs using offline SLMs.
Number of AI Developers 25 devs
1 Dev 250 Devs
Daily Queries / Dev 20 queries
5 Queries 100 Queries
Target AI Model Integration
Estimated Annual Savings
$12,470 / year (saved 97%)

Calculated assuming an average raw codebase context load of 45K tokens (naive) versus 1,200 tokens using OKF structured AST lookups.

## Enterprise Capabilities

### Packed with Features Built for Production Systems

Everything you need to compile codebases into structured metadata instantly ingestible by any AI agent.

#### AST Multi-Language Parsers

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.

#### Cross-Reference Linker

Resolves imports, call sites, and inheritance dependencies into logical graph edges (Calls, Called-by, Depends-on) across internal boundaries.

#### Manifest Dependency Scanners

Scans and cross-indexes 12+ configuration manifests (Cargo.toml, package.json, requirements.txt, build.gradle, go.mod, Mix, Gemfile) to map libraries.

#### Native MCP Server Integration

Exposes code concepts natively as tools via the Model Context Protocol. Cursor, Claude Desktop, and Cline can explore, search, and parse code automatically.

#### Fine-Tuning Dataset Generator

Extracts high-fidelity Instruction Pairs (`okf pairs`) from AST nodes to train custom private coding SLMs tailored strictly to your architecture.

#### Interactive Visual Dashboard

Generates beautiful, search-enabled 2D interactive graphs of your codebase structure. Great for human onboarding, audits, and code architecture mapping.

Command Line Interface

## Comprehensive, Elegant CLI Toolkit

Manage files, map repositories, serve interactive diagrams, run diff analysis, or start the AI MCP server with one simple binary command structure.

okf-terminal-session zsh
$ okf generate ./my_project ./okf_bundle --enrich deep
[1/4] Scanned codebase: 74 python, 12 javascript, 3 manifest files.
[2/4] Parsing Tree-Sitter AST nodes for method definitions...
[3/4] Resolving cross-references & library import matches...
[4/4] Optional LLM enrichment: Enhancing method docstrings (Deep Mode)...
✓ Generated knowledge bundle at './okf_bundle/' (124 concepts resolved).
✓ Code context compressed by 88.4% (avg. concept size 320 tokens).
Run in your workspace terminal
claude_desktop_config.json MCP Server Configuration

    {
      "mcpServers": {
        "okf-generator": {
          "command": "okf",
          "args": [
            "mcp",
            "/Users/username/WSpace/my_project/okf_bundle",
            "--port",
            "4567"
          ]
        }
      }
    }

Connect your IDE client directly:
Cursor
Tools Panel
Cline
Native MCP
Claude Desktop
Desktop App
Model Context Protocol

## Instantly Link Your Codebase Into IDE Agents

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.

Full tool support for okf-lookup, schema extraction, and call mapping.
Integrates instantly with Cursor, Windsurf, Cline, and Claude Code.
Zero-latency local network sockets for optimal speed.

## CI/CD Automation

### Keep Your Knowledge Graphs Always Up To Date

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-workflow.yml
Deploy via GitHub Actions

    # .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

## Setup Guide

### Adopt in Less Than 2 Minutes

Install the CLI, generate your code index, and plug it directly into your local IDE.

1

#### Install Package

Get the core package via pip, or download the lightweight binary shell runner directly.

    pip install okf-generator

2

#### Scan Codebase

Generate your structural graph from your source repository instantly. Fully offline.

    okf generate ./src ./bundle

3

#### Start MCP Server

Expose your knowledge bundle to Claude Code or Cursor via the local MCP protocol.

    okf mcp ./bundle --port 4567

## Subscription Options

### The Right Plan for Every Team Size

Start for free with our powerful offline CLI open-source community edition, or upgrade to Pro/Enterprise for secure self-hosted environments.

COMMUNITY

#### Open Source

Perfect for indie hackers, small startups, and solo developers running local coding workflows.

$0 / forever (MIT)

- 12+ Language parsers (offline)
- 12+ Manifest dependency scanners
- D3/SVG HTML code visualizer
- Local MCP Server Integration

Install CLI Now
Most Popular
TEAM PRO

#### Developer Pro

Designed for expanding developer teams that need advanced semantic descriptions and automated repo updates.

$19 / dev / month
FREE UNTIL JULY 15, 2026!

- Everything in Open Source
- Deep LLM semantic enrichment
- Automated PR diff graph analysis
- Priority email support

ENTERPRISE

#### Enterprise Custom

For security-conscious sectors requiring self-hosted cluster licenses, compliance auditing, and custom parsers.

Custom / self-hosted SLA

- Everything in Team Pro
- 100% On-Prem self-hosted clusters
- SOC2 Type II, HIPAA, GDPR Audits
- Custom proprietary language parsers
- 24/7 Priority support SLA

## Questions & Answers

### Frequently Asked Questions

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.