cocoindex-code  by cocoindex-io

Super-lightweight code indexing for AI agents

Created 1 month ago
729 stars

Top 47.3% on SourcePulse

GitHubView on GitHub
Project Summary

A lightweight, embedded, AST-based code indexing solution designed to significantly reduce token usage and improve speed for AI coding agents. It targets developers using agents like Claude, Codex, and Cursor, offering up to 70% token savings and faster code understanding through efficient codebase indexing.

How It Works

This project leverages CocoIndex, a Rust-based, ultra-performant data transformation engine, to create an Abstract Syntax Tree (AST) based Memory Codebase Proxy (MCP). It intelligently indexes codebases, re-indexing only changed files to ensure rapid updates. This approach avoids complex database setups and provides direct code understanding capabilities.

Quick Start & Requirements

  • Install: pip3 install -U cocoindex-code
  • Prerequisites: Python 3.
  • Usage: Integrate with agents via commands like claude mcp add cocoindex-code -- cocoindex-code. An index is automatically built and updated in the background, or can be manually created with cocoindex-code index.
  • Documentation: https://cocoindex.io/docs/getting_started/quickstart

Highlighted Details

  • Semantic Code Search: Enables natural language queries for finding relevant code, surpassing traditional grep and saving tokens.
  • Ultra-Performant Updates: Built on a Rust engine, it efficiently re-indexes only modified files for near real-time updates.
  • Multi-Language Support: Supports a wide array of languages including Python, JavaScript/TypeScript, Rust, Go, Java, C/C++, SQL, and more.
  • Flexible Embeddings: Defaults to a free, local SentenceTransformers model (all-MiniLM-L6-v2) without API keys, but supports over 100 cloud providers and local models via LiteLLM for customized semantic understanding.

Maintenance & Community

The project features active CI/release workflows and provides a Discord community link for support and discussion. Enterprise inquiries regarding large codebase indexing and remote setup can be directed to linghua@cocoindex.io.

Licensing & Compatibility

The project is licensed under the Apache-2.0 license, permitting commercial use and integration. It is designed to be compatible with various coding agents, including Claude, Codex, and Cursor.

Limitations & Caveats

Users on macOS may encounter sqlite3 issues if using the system's default Python installation; installing Python via Homebrew is recommended. Switching embedding models requires re-indexing the codebase due to differing vector dimensions. Advanced enterprise features for very large codebases are available but may necessitate direct contact.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
44
Issues (30d)
16
Star History
743 stars in the last 30 days

Explore Similar Projects

Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Cofounder of Luma AI), Will Brown Will Brown(Research Lead at Prime Intellect), and
7 more.

avante.nvim by yetone

0.3%
18k
Neovim plugin emulating Cursor AI IDE for AI-driven code assistance
Created 1 year ago
Updated 2 days ago
Feedback? Help us improve.