$ buildwith diff cocoindex sourcegraph

CocoIndex vs Sourcegraph

Both are in Context & Indexing, where we rank CocoIndex #1 and Sourcegraph #3. Everything below comes from each tool's own pricing and docs pages, with the date we last checked them. How we rank.

pick CocoIndex if you want a coding agent to search a repo by meaning and get back small chunks, or you want an index of code and documents that only reprocesses what changed.

pick Sourcegraph if your team already has Sourcegraph, or will, and you want coding agents to search across repositories and get file ranges back instead of reading the tree themselves.

CocoIndex

#1 · Free / OSS

CocoIndex is an open-source Python framework that keeps code, documents, and meeting notes ready for agents by reprocessing only what changed. You declare the target in Python. The engine memoizes results when the inputs and the function code are unchanged, tracks which source items and which logic are affected, and runs independent work in parallel. Install the framework with pip install -U cocoindex. The same page describes CocoIndex Code Plus as a licensed code-search product, built on CocoIndex Plus, that searches indexed repositories and follows symbol references.

for People building agents and LLM apps that need a current view of code, documents, or meeting notes. The page's examples are a repo index for code-review and coding agents, a meeting-notes knowledge graph, and a repository wiki. A Claude skill on the same page is for writing the pipeline. CocoIndex Plus is the path the page points to for running at scale.

use this if you want a coding agent to search a repo by meaning and get back small chunks, or you want an index of code and documents that only reprocesses what changed.

pricing

  • Open source Free

    pip install cocoindex. One flow process, embedded LMDB state, a local target. The page says LMDB has one writer, and local storage and write throughput can limit how large a deployment gets. The same flow code runs on Plus with a different SDK package and state store. The comparison marks the GitHub connector, multi-node compute, and shared components as not included here.

  • CocoIndex Plus Quote

    pip install cocoindex-plus, plus a license key. Shared Postgres state on your cloud or your own servers, including Kubernetes and a Helm chart. The page does not list a dollar price. It says they answer with a deployment plan and a license. Multi-node compute, sharding, and dynamic sources are marked on request. The usage dashboard is marked in development. OpenTelemetry export is marked available.

features

  • ›cocoindex-code is an Apache-2.0 CLI (ccc) and a stdio MCP server. It parses files with Tree-sitter, tries to split them at function and class boundaries, and embeds the chunks. Chunks target about 1,000 characters, which the page calls about 300 tokens
  • ›The MCP search tool defaults to 5 results (limit 1 to 100). The page says the code in that result is at most about 1,500 tokens, plus file paths, line numbers, and scores. A whole-file read costs the length of the file, and that file is sent again on later turns until the client compacts the conversation
  • ›ccc search, which the skill runs, returns up to 10 results by default. --limit 5 matches the MCP default. offset, a path glob, and a language filter narrow the call. The MCP parameter names are limit, offset, paths, and languages
  • ›Install with pipx install 'cocoindex-code[full]' or uv tool install --upgrade 'cocoindex-code[full]', then ccc index in the repo. Claude Code: npx skills add cocoindex-io/cocoindex-code, or claude mcp add cocoindex-code -- ccc mcp. Codex: codex mcp add cocoindex-code -- ccc mcp. Other stdio clients start ccc mcp with the project as the working directory
  • ›The MCP search tool refreshes the index before each query by default. ccc index re-indexes changed files. With the local model, indexing cost is compute on your machine. With a cloud embedding provider, you pay that provider per token
  • ›The page says the saving depends on the repository and the task, and to measure it by running the same task with and without the search tool. Search does not change how many tokens the agent writes. Questions about callers and references need Serena or CocoIndex Code Plus (ccx), which is a separate self-hosted product

strengths

  • ›Apache-2.0. On 2026-11-11 the GitHub API reported 11,875 stars and 931 forks. The repository was created 2025-03-03. GitHub's language breakdown is led by Rust, then Python. The README says the core is Rust, with a Python SDK you install using pip install -U cocoindex
  • ›Latest GitHub release on that date was v1.2.0, published 2026-11-09. It adds a Discord source connector, experimental Google Drive sign-in for a personal account, and experimental data dependencies for memoized functions
  • ›The README badge says Python 3.10–3.13. The 1.2.0 package on PyPI (uploaded 2026-11-09) requires Python >=3.11, lists 3.11 through 3.14, and is classified Production/Stable. The separate cocoindex-code 0.2.43 package (uploaded 2026-11-05) is classified Alpha. Trust the package metadata over the badge
  • ›The README says a source change updates the affected records and retires stale rows without touching anything that did not change. The core is Rust

limits

  • ›The README opens with '70% token savings' and does not link a benchmark or a method. Do not treat that line as a measured saving
  • ›cocoindex-code[full] bundles sentence-transformers so embeddings run in-process, with no API key. The README says those dependencies are about 1 GB of torch and transformers. The slim install is LiteLLM-only: a cloud provider with an API key, or a local Ollama server with no key and no per-token cost. The local example is model: ollama/nomic-embed-text, and OLLAMA_API_BASE if the server is not at http://localhost:11434
  • ›As an MCP server, ccc mcp exposes one tool, search. It does not look up callers or rename a symbol. The README also says ccc grep depends on a cocoindex code_match feature that, until it ships in a released cocoindex, requires a local cocoindex build
  • ›With [full] installed, ccc init defaults to the in-process model Snowflake/snowflake-arctic-embed-xs. ccc init also recognizes the nomic-ai code models nomic-ai/CodeRankEmbed and nomic-ai/nomic-embed-code and fills in their indexing and query settings. The README shows those as sentence-transformers models, says CodeRankEmbed retrieves code better than the default, and says it is 137M parameters, needs about 1 GB of VRAM, and has an 8192-token context window

why #1

Ranked #1 in Context & Indexing. The job is handing an agent the right code and docs without paying to reread the repo. A default cocoindex-code MCP search returns at most about 1,500 tokens of code, five chunks of about 300 tokens, instead of whole files, and a later index run skips files that did not change. The same page says there is no single saving that holds for every repo, and that callers and references need Serena or the licensed Code Plus product. Serena ranks second as that symbol tool. Sourcegraph ranks third as the enterprise code-search instance. Repomix ranks fourth as a one-shot pack of the repo into a file. This order follows the job, not GitHub stars. The scores are unmeasured placeholders, and the site does not display them.

sources

open cocoindex.io ↗

Sourcegraph

#3 · Paid

Sourcegraph MCP gives coding agents a retrieval layer over the code indexed in a Sourcegraph instance: keyword and semantic search, file reads, navigation, history, and Deep Search. Code Finder is the tool built for this job. You give it a task, it runs its own search loop, and it returns a short summary plus the matching file paths and line ranges, so the agent reads that instead of opening files until it finds the right ones. The page says go-to-definition and find-references use precise code indexing (SCIP), an open standard.

for An engineering team that wants one place for humans and agents to search a large, multi-repository codebase. The pricing page describes a single Enterprise plan for that, with search and navigation, Deep Search, and MCP access, deployed as single-tenant cloud or self-hosted.

use this if your team already has Sourcegraph, or will, and you want coding agents to search across repositories and get file ranges back instead of reading the tree themselves.

pricing

  • Enterprise From $16,000/year

    The pricing page shows one plan, starting at $16,000 as the minimum annual contract. It includes credits for AI features that scale with team size. The summary does not say how many credits that is. Credits are per user, pooled across the org, and do not expire monthly. Purchased credit buckets roll over on renewal. Volume credit buckets are an add-on. The plan lists search and navigation, Deep Search, Batch Changes, Insights, Monitoring, the full MCP server, API, and CLI, single-tenant cloud and self-hosted, and 24×5 support.

features

  • ›The docs open with 'Supported on Enterprise plans.' The default endpoint, /.api/mcp, includes code_finder, keyword_search, read_file, list_files, list_repos, commit_search, diff_search, deepsearch_read, and evaluator. nls_search is a fallback on that endpoint when code_finder is unavailable or disabled
  • ›Go-to-definition, find-references, creating a Deep Search conversation, compare_revisions, and list_refs are on /.api/mcp/all, not the default endpoint. /.api/mcp/deepsearch is Deep Search only
  • ›read_file can take a line range and a revision. Files over 128KB return the first 200 lines and a truncation notice. list_files stops at 1,000 entries. find_references defaults to 10 results. The docs say every tool limits results so a call does not fill the context window
  • ›Code Finder takes a task and an optional revision. It searches one repository you name, runs synchronously, and returns paths and line ranges with a short explanation. Usage is metered against the instance entitlement. When the quota is used up, the tool returns an error
  • ›OAuth or a Sourcegraph access token. Users need the MCP#ACCESS permission, which the built-in User role has unless an admin removes it. Repository permissions still apply. Admins can set mcp.enabled to false or disable individual tools, including code_finder
  • ›The docs name Claude Code, Codex, Cursor, Copilot, OpenCode, and Amp as clients. A client that fails OAuth with invalid_scope should request only the mcp scope

strengths

  • ›On 2026-11-11 the GitHub API reported 10,285 stars and 1,376 forks on sourcegraph/sourcegraph-public-snapshot. The repository was created 2015-08-24. Primary language is Go. It is archived. The last push was 2024-09-02
  • ›The README says development moved to a private monorepo and this repository is a public copy of sourcegraph/sourcegraph from just before that move. It points at one commit as the last change made under Apache-2.0. Stars on this repo are for that snapshot
  • ›The self-hosted releases index lists 8.1.4873, published 2026-11-11, as the latest patch of 8.1. That page describes an executor host-kernel fix for CVE-2026-99999. It is not a commit in the archived snapshot: https://sourcegraph.com/changelog/releases/8.1.4873
  • ›A July 23, 2026 Sourcegraph post says that, on a file-finding suite they assembled, Code Finder finished more than twice as fast as an agent using local search and cost up to 40% less than an agent calling Sourcegraph's own MCP tools, at comparable quality. The post says the chart is relative to Code Finder and does not list the tasks or absolute token counts: https://sourcegraph.com/blog/code-finder-fast-code-search-for-agents

limits

  • ›LICENSE.enterprise says the software may be used in production only with a valid Sourcegraph Enterprise subscription for the correct number of seats, under the Enterprise terms or another agreement. You may copy and modify it for development and testing without a subscription
  • ›Beyond that, the same license forbids copying, merging, publishing, distributing, sublicensing, or selling the software. Sourcegraph keeps title to modifications and patches, and those may only be used with a valid subscription for the correct number of seats

why #3

Ranked #3 in Context & Indexing. Sourcegraph is the long-running code search product in this list: an agent asks an indexed copy of the company's repositories and gets paths and line ranges back, including through Code Finder. The MCP docs say that server is supported on Enterprise plans. It ranks below CocoIndex and Serena because those two run locally without that plan. It ranks above Repomix because a pack still drops a repository into the prompt, while this server is built to return a slice. The scores are unmeasured placeholders and are not shown.

sources

open sourcegraph.com ↗
sponsor this spot →