cocoindex

Build incremental data transformation pipelines for embeddings, knowledge graphs, and search indexes.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/coolrobertj/Agency-Cowork --skill cocoindex-coolrobertj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cocoindex
Source: https://github.com/coolrobertj/Agency-Cowork/tree/main/skills/cocoindex/skills/cocoindex
Command: npx skills add https://github.com/coolrobertj/Agency-Cowork --skill cocoindex-coolrobertj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cocoindex, python-dotenv, sentence-transformers, pgvector, psycopg, and includes references (resource) components.

What problem does it solve? Building and maintaining ETL pipelines for AI data processing—embedding documents into vector databases, extracting structured data with LLMs, or building knowledge graphs—requires complex orchestration. This Skill guides you through creating CocoIndex flows that process only changed data incrementally, keeping indexes continuously in sync. ## Core Features & Use Cases - Indexing Flow Authoring: Write Python flows that ingest from local files, S3, Azure Blob, Google Drive, or Postgres, transform data (chunking, embedding, LLM extraction), and export to Postgres+pgvector, Qdrant, LanceDB, or Neo4j. - Custom Functions: Create reusable transformation logic with standalone functions or spec+executor patterns for model loading and caching. - Flow Operations: Run, update, live-sync, evaluate, and drop flows via CLI or Python API, with query handlers for semantic search. - Use Case: Build a real-time codebase index that chunks code with Tree-sitter, embeds it with SentenceTransformer, stores vectors in Postgres, and answers natural-language code search queries. ## Quick Start Ask your agent to build a CocoIndex flow that embeds the documents in a folder into a Postgres vector database with semantic search.

Frequently Asked Questions about cocoindex

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a vector search index with CocoIndex?

Define a flow that adds a LocalFile source, chunks content with SplitRecursively, embeds chunks with SentenceTransformerEmbed, and exports to Postgres with a vector index using cosine similarity. Run it with cocoindex update --setup main.

How do I create a custom function in CocoIndex?

Decorate a Python function with @cocoindex.op.function and provide type annotations for all arguments and the return value. For functions needing setup like model loading, use a FunctionSpec class paired with an executor class that implements prepare and __call__.

Can I use OpenAI or Anthropic models with CocoIndex flows?

This deployment prohibits external LLM providers like OpenAI, Anthropic, Gemini, and Voyage to prevent data exfiltration. Use Ollama for local LLM inference or SentenceTransformerEmbed for local embeddings instead.

Does CocoIndex support live updates when source data changes?

Yes, add a refresh_interval parameter to your source and run cocoindex update main.py -L for live mode. CocoIndex processes only changed data incrementally rather than reprocessing everything.

Why does my CocoIndex flow fail with a database connection error?

The flow requires a Postgres database with pgvector for internal storage. Verify COCOINDEX_DATABASE_URL is set in your .env file and that Postgres is running, for example via the provided Docker Compose configuration.