Favicon of CocoIndex

CocoIndex

An AI indexing framework for local files and code, with sentence-transformers embeddings and pgvector or LanceDB storage. Apache 2.0 licensed.

Screenshot of CocoIndex website

CocoIndex is an open-source AI indexing framework for developers processing codebases and documents on their own hardware. Its code indexing example uses sentence-transformers for embeddings and writes to pgvector or LanceDB, giving it a concrete role in preparing searchable context for agents and LLM apps.

Its main distinction is how it handles changes. An edited file triggers work on the affected data while unchanged results remain cached, reducing repeated embedding and processing. Changes to Python transformation code also trigger selective updates, and target schemas can evolve automatically. Data lineage connects indexed output to the source material it came from.

The framework supports document retrieval pipelines that extract and split PDF text before storing embeddings. Sources can include local files, S3 and Google Drive. Other examples turn conversations into knowledge graphs in Neo4j or Kuzu, or produce repository summaries that refresh when commits arrive. Model dependencies vary by workflow: the Hacker News topic extraction example uses Gemini, so that processing involves a cloud model.

Developers define transformations in Python over a Rust core. CocoIndex uses the Apache 2.0 license. CocoIndex Code is a separate project built on the framework, with semantic search, symbol tables and call graphs that stay in sync with repository changes. Coding agents can trace callers and callees to examine which code a proposed edit affects.

Similar to CocoIndex