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.
主要功能
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
使用案例
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