CocoIndex reposted this
🎉 Check out the Python library: CocoIndex Code. 👉10k GitHub Stars 👉 897k downloads 👉 License: Apache 2.0 (permissive for commercial use) 🤗 What is it? Creates an AST (Abstract Syntax Tree) aware semantic index for the AI agents to look up parts of the code and help narrow down the problem of searching the correct context. When you use an editor like VS Code, it uses language servers to help prompt what comes after the “<class>.?” AST based search helps there. In simple English, every programming language has a grammar and keywords. The AST is created using the knowledge of the structure/grammar of the language, and this is a pre-GenAI reproducible tech. The AST aware semantic index essentially creates a lookup index for the AI to search your code alike one would check for words in a dictionary/thesaurus. Since this minimizes unnecessary guess work, it also helps reduce the token usage. 🦋 My personal perspective on AI Model Strategy: As AI companies increase the cost of token-usage (it’s a when, not an if), the AI bill is going to feel painful, unless your AI strategy has a hybrid approach: Local smaller models for simple tasks, self-hosted on-demand servers for big(~1T parameter) open-weights models (the hedge against closed proprietary models) and finally closed frontier models for very ambitious tasks, the AI bill will be painful. AI access should be viewed as akin to investment strategy: not all eggs should be placed in the same basket and hedging is necessary for a viable outcome where no proprietary model provider gets to twist your arms. True privacy is there when you thought silently, wrote nothing, said nothing. Just acted upon it. LLM traces, prompts and the product — unless all of this is accessible to you and only you, your thoughts aren’t yours. Your second-brain isn’t yours. ⚡️ pip install -U cocoindex ✨ Homepage: https://cocoindex.io/ 🎁 GitHub: https://lnkd.in/gVZ9y_Fp 🍀 PyPI: https://lnkd.in/gnwzhXp2 💡 What are ASTs? How Language Servers work using ASTs? Check an example and thorough blog post in the comments section. DISCLAIMER: All the views presented here are my own or already available openly. They do not represent in any form any of my past or present employers/clients/stakeholders. #codeindexing #ai #aiagents #ast #contextengineering #python #rust #privacy #personalai #aimodelsstrategy
CocoIndex Code helps coding agents look up the right code before they start opening files. It builds a local AST-aware semantic index, so Claude Code, Codex, Cursor, or OpenCode can retrieve relevant functions and classes instead of scanning raw files. Tree-sitter preserves code boundaries; local refresh keeps context current. Practical gain: fewer blind reads, less token waste, better first edits. 10k stars, Apache-2.0. #MCP #CodingAgents #ContextEngineering #TreeSitter #AIInfra