Kaos AST

•

Provides high-precision code context to AI agents by semantically chunking code with AST parsing and generating local vector embeddings.

Kaos AST functions as an intelligent, AST-based semantic code search engine, designed to enhance AI coding agents' understanding of codebases. It achieves this by dynamically scanning target repositories, detecting programming languages, and extracting deeply structured code chunks like functions, classes, and methods using Tree-sitter. By integrating `code_ast`'s advanced parsing with `cocoindex-code`'s embedding and search capabilities, Kaos AST delivers perfectly bounded, semantically complete code snippets, drastically improving the relevance of retrieved context, minimizing hallucinations, and significantly reducing LLM token consumption.

Key Features

01AST-Based Semantic Chunking for precise code slicing
02Dynamic Language Detection for seamless indexing across multiple languages
03Zero-Setup Embedding Engine using `sentence-transformers` for local embeddings
04Built-in MCP Server for integration with Claude Code, Cursor, OpenCode, and VSCode Copilot Chat
050 GitHub stars

Use Cases

01Improving LLM token efficiency by supplying semantically complete code chunks
02Enabling local semantic search across a codebase for AI agents
03Providing highly relevant code context to AI coding assistants