MCPcopy Index your code
hub / github.com/cocoindex-io/cocoindex

github.com/cocoindex-io/cocoindex @v1.0.16

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.16 ↗ · + Follow
9,466 symbols 39,000 edges 558 files 2,885 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://cocoindex.io/blobs/github/homepage/enterprise-hero-light.svg" alt="Enterprise corpus — codebase, Slack, meeting notes, and documentation — flowing continuously through the CocoIndex incremental sync engine into a production AI agent with always-fresh context. Only the Δ (delta) is reprocessed on every change. Keywords: RAG pipeline, agent memory, enterprise retrieval, AI agent context, live indexing, retrieval-augmented generation, production LLM apps, streaming ETL, incremental ingestion." width="100%" draggable="false"/>

Your agents deserve fresh context.

Star us ❤️ → 

Star CocoIndex on GitHub — open-source Python framework for RAG, vector search, and live agent context

 · 

cocoindex.io — the CocoIndex homepage: incremental data pipelines for AI agents

 · 

CocoIndex documentation — quickstart, connectors, ops, transformations, target stores, RAG and knowledge graph recipes

 · 

Join the CocoIndex Discord community — help, showcase, release notes, and live chat with maintainers

CocoIndex turns codebases, meeting notes, inboxes, Slack, PDFs, and videos into live, continuously fresh context for your AI agents and LLM apps to reason over effectively — with minimal incremental processing. Get your production AI agent ready in 10 minutes with reliable, continuously fresh data — no stale batches, no context gap

Incremental · only the delta  ·  Any scale · parallel by default  ·  Declarative · Python, 5 min

stars downloads pypi python rust license discord

CI release links

cocoindex-io/cocoindex | Trendshift

Deutsch | English | Español | français | 日本語 | 한국어 | Português | Русский | 中文

Built with CocoIndex ❤️

CocoIndex-code — flagship MCP server for AI coding agents. AST-aware incremental semantic code index that keeps live call graphs, symbols, vectors, and chunks fresh on every commit. 70% fewer tokens per turn, 80-90% cache hits on re-index, sub-second freshness. Supports Python, TypeScript, Rust, and Go. Features: Δ-only incremental processing, semantic search by meaning (not grep), call graphs and blast-radius analysis, global repo view for duplicates and architecture. Build coding agents (generate, refactor) and code-review agents (catch, approve). One install — Claude Code, Cursor, and other MCP-aware agents see your whole repository instantly. Keywords: MCP server, coding agent, code intelligence, AST chunking, semantic code search, call graph, vector embedding, repository context, Claude Code, Cursor, incremental indexing, blast radius.

See all 20+ examples · updated every week →

Get started

pip install -U cocoindex

Declare what should be in your target — CocoIndex keeps it in sync forever, recomputing only the Δ.

import cocoindex as coco
from cocoindex.connectors import localfs, postgres
from cocoindex.ops.text import RecursiveSplitter

@coco.fn(memo=True)                          # ← cached by hash(input) + hash(code)
async def index_file(file, table):
    for chunk in RecursiveSplitter().split(await file.read_text()):
        table.declare_row(text=chunk.text, embedding=embed(chunk.text))

@coco.fn
async def main(src):
    table = await postgres.mount_table_target(PG, table_name="docs")
    table.declare_vector_index(column="embedding")
    await coco.mount_each(index_file, localfs.walk_dir(src).items(), table)

coco.App(coco.AppConfig(name="docs"), main, src="https://github.com/cocoindex-io/cocoindex/raw/v1.0.16/docs").update_blocking()

Run once to backfill. Re-run anytime — only the changed files re-embed.

Building with an AI coding agent?

Drop in our CocoIndex skill so your agent writes correct v1 code — concepts, APIs, patterns, all in one file.

See Use with AI coding agents for install steps.

Full quickstart — open-book icon linking to the CocoIndex documentation quickstart: pip install, declare sources and targets, run the incremental engine

  

Learn the concept — lightbulb icon linking to the CocoIndex core-concepts guide: sources, targets, flows, incremental engine, and data lineage

Animated GitHub Star button for the cocoindex-io/cocoindex repository: a cursor clicks the star, it fills yellow, confetti bursts, the star count ticks up, and an 'Appreciate a star if you like it!' caption with a beating heart shows below the button

React — for data engineering

<img src="https://cocoindex.io/blobs/github/homepage/react4de-hero-light.svg" alt="React — for data engineering. The CocoIndex mental model: Target = F(Source). A persistent-state-driven dataflow where you declare the desired target state and the engine keeps it in sync with the latest source data and code, forever, at low latency and low cost. Source files (.py, .md, .pdf, .ts) flow through your Python transformation F into a live target dots-matrix index; only the Δ is reprocessed on every change, and every target dot traces back to its exact source byte. Four core properties: Python not a DAG (sky), declare target state (yellow bullseye), lineage end-to-end (coral connected dots), and incremental at any scale (mint Δ+1). Your code is as simple as the one-off version — the engine does the rest. Keywords: React for data engineering, declarative ETL, persistent state, data lineage, dataflow, Δ only, incremental indexing, CocoIndex." width="100%"/>



















<img src="https://cocoindex.io/blobs/github/homepage/either-side-change-light.svg" alt="What happens when either side changes — CocoIndex tracks per-row provenance so the Δ propagates at minimum cost. Two scenarios shown in one illustration: (top) Source change — one file (b.md) is edited and only one target dot re-syncs (coral pulse). (bottom) Code change — the transformation function F is rewritten from v1 to v2 and only the dots whose outputs depend on the changed code re-run (amber/yellow pulses). Source on the left, F in the center (Python code block

Extension points exported contracts — how you extend this code

LanguageHooks (Interface)
Language-specific logic for namespace tracking, `has_body` determination, and path-expression rendering. [10 implementers]
rust/code_ast/src/elements/hooks.rs
Tokenizer (Interface)
A pattern tokenizer: given the input at a position, return the byte length of a token at the start, or `None`. `RegexTok [5 …
rust/code_match/src/config.rs
FileLike (Interface)
(no doc) [6 implementers]
rust/sdk/cocoindex/src/file.rs
Runner (Interface)
(no doc) [5 implementers]
rust/utils/src/batching.rs
Persist (Interface)
(no doc) [4 implementers]
rust/core/src/engine/profile.rs
FromPyResult (Interface)
(no doc) [1 implementers]
rust/py_utils/src/error.rs
SidebarDoc (Interface)
(no doc)
docs/src/data/docs-sidebar.ts
TargetHandler (Interface)
(no doc) [38 implementers]
rust/sdk/cocoindex/src/target_state.rs

Core symbols most depended-on inside this repo

clone
called by 1730
rust/sdk/cocoindex/src/ctx.rs
Ok
called by 1663
rust/utils/src/retryable.rs
to_string
called by 1049
rust/py/src/stable_path.rs
update_blocking
called by 576
python/cocoindex/_internal/app.py
map
called by 564
rust/sdk/cocoindex/src/ctx.rs
join
called by 452
rust/sdk/cocoindex/src/file.rs
collect
called by 424
python/tests/common/target_states.py
is_empty
called by 304
rust/code_ast/src/positions.rs

Shape

Function 4,409
Method 3,221
Class 1,712
Enum 81
Interface 37
Route 6

Languages

Python52%
Rust47%
TypeScript1%

Modules by API surface

python/tests/core/test_live_component.py127 symbols
rust/sdk/cocoindex/tests/pipeline.rs121 symbols
python/tests/core/test_function_batching.py104 symbols
rust/sdk/cocoindex/src/postgres.rs102 symbols
rust/sdk/cocoindex/src/cypher_graph.rs101 symbols
rust/sdk/cocoindex/src/doris.rs97 symbols
rust/core/src/engine/context.rs97 symbols
python/tests/internal/test_memo_fingerprint.py92 symbols
python/cocoindex/_internal/function.py92 symbols
rust/sdk/cocoindex/src/surrealdb.rs89 symbols
rust/sdk/cocoindex/src/lancedb.rs88 symbols
rust/sdk/cocoindex/src/qdrant.rs86 symbols

Datastores touched

cocoindexDatabase · 1 repos
dbDatabase · 1 repos
dbnameDatabase · 1 repos
source_dbDatabase · 1 repos
target_dbDatabase · 1 repos

For agents

$ claude mcp add cocoindex \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact