# CocoIndex Docs > CocoIndex is an ultra-performant framework for building data pipelines for AI, with built-in incremental processing. Declare what your target should look like as a function of your source — the Rust engine keeps it in sync, reprocessing only what changed. > This index lists the Python SDK pages. The Rust SDK pages are indexed at https://cocoindex.io/docs/rust/llms.txt. > Full docs text in one file: https://cocoindex.io/docs/llms-full.txt. Docs pages and example walkthroughs have raw Markdown twins by replacing the trailing slash with `.md`, e.g. https://cocoindex.io/docs/programming_guide/core_concepts.md — and they are all included in llms-full.txt. > Coding agents: install the CocoIndex skill before writing v1 code — https://cocoindex.io/docs/skill.md (teaches the correct v1 API; without it, LLMs tend to hallucinate the deprecated v0 flow-builder DSL). ## Key pages - [Core Concepts](https://cocoindex.io/docs/programming_guide/core_concepts/): Declare your outputs. CocoIndex applies changes and reuses cached results. - [CLI Reference](https://cocoindex.io/docs/cli/): Reference for the `cocoindex` CLI — app target formats, environment variable loading, and subcommands for init, ls, show, update (catch-up or live), drop and auth. - [FAQ](https://cocoindex.io/docs/faq/): Common questions about CocoIndex behavior — how change detection propagates through logic vs inputs, runtime invocation tracking, hidden dependencies, and crash recovery vs cross-target atomicity for target states. ## Getting Started - [Overview](https://cocoindex.io/docs/getting_started/overview/): CocoIndex is a real-time data transformation framework for AI with incremental processing: only the data that actually changed is reprocessed, lineage is observable end to end, and the schema is known up front. - [Installation](https://cocoindex.io/docs/getting_started/installation/): Install CocoIndex with pip, uv, or Poetry, and check system requirements — Python 3.11 to 3.13 on macOS, Linux, or Windows. - [Quickstart](https://cocoindex.io/docs/getting_started/quickstart/): Build your first CocoIndex pipeline: convert PDFs to Markdown and watch incremental processing only reprocess files that actually changed. - [Use with AI coding agents](https://cocoindex.io/docs/getting_started/ai_coding_agents/): Make Claude Code, Cursor, and other AI coding agents write correct CocoIndex v1 code by installing the official CocoIndex skill — concepts, APIs, and patterns packaged for agent context. ## Programming Guide - [Overview](https://cocoindex.io/docs/programming_guide/): Build a pipeline from Apps, processing components, functions, and target states. - [App](https://cocoindex.io/docs/programming_guide/app/): Apps are the top-level runnable unit in CocoIndex. Learn how to create an App, trigger updates, configure the database path, and wire up lifespan-managed resources. - [Target state](https://cocoindex.io/docs/programming_guide/target_state/): Target states describe what should exist in an external system — files, rows, embeddings. Learn how to declare them through connector APIs, nest container targets, and rely on CocoIndex to sync minimal creates, updates, and deletes. - [Processing component](https://cocoindex.io/docs/programming_guide/processing_component/): Processing components are the units of incremental execution and the sync boundaries for target states. Covers mounting APIs (mount, use_mount, mount_each, mount_target), component paths, and granularity tradeoffs. - [Functions](https://cocoindex.io/docs/programming_guide/function/): The @coco.fn decorator makes Python functions participate in CocoIndex's change detection, memoization, and execution pipeline — with async adapters, batching, and GPU-aware runners included. - [Context](https://cocoindex.io/docs/programming_guide/context/): Use ContextKey, builder.provide(), and use_context() to share connections, models, and config across processing components. Covers change detection on context values and accessing context outside mount boundaries. - [Live mode](https://cocoindex.io/docs/programming_guide/live_mode/): Keep an App running after its initial sweep so it reacts to source changes continuously. Covers live=True on apps, watchers, and live-aware connectors like the local filesystem and Kafka. - [Serialization](https://cocoindex.io/docs/programming_guide/serialization/): How CocoIndex serializes memoized function returns with msgspec — supported types (primitives, collections, dataclasses, Pydantic, NumPy), required type annotations, custom type registration, and troubleshooting tips. - [SDK overview](https://cocoindex.io/docs/programming_guide/sdk_overview/): A tour of the CocoIndex Python SDK — package layout (core, connectors, resources, ops), common types like StableKey, and how async orchestration composes with sync leaf functions. ## Common Resources - [Overview](https://cocoindex.io/docs/common_resources/): Shared types and utilities used across connectors and operations: data models, vector schema, stable ID generation, and the in-memory LiveMap. - [Data types](https://cocoindex.io/docs/common_resources/data_types/): Data types shared across connectors and built-in operations — FileLike, FilePath, FilePathMatcher, Chunk with text positions, and the Embedder protocol for single-text async embedding. - [Vector schema](https://cocoindex.io/docs/common_resources/vector_schema/): Describe vector columns with VectorSchema and VectorSchemaProvider. Covers the three annotation patterns (ContextKey, embedder instance, explicit schema) and MultiVectorSchema for models like ColBERT. - [ID generation](https://cocoindex.io/docs/common_resources/id_generation/): Generate IDs and UUIDs that stay stable across incremental runs — generate_id and generate_uuid for pure derivation, and IdGenerator / UuidGenerator for stateful sequences that still reproduce across runs. - [LiveMap](https://cocoindex.io/docs/common_resources/live_map/): LiveMap is an in-memory keyed collection that bridges live producing and consuming logic — declare (key, value) entries as target states on one side, consume it as a LiveMapView with mount_each on the other. - [Rate limiting](https://cocoindex.io/docs/common_resources/rate_limiting/): Throttle outbound work with a token-bucket RateLimiter — a sustained rate plus a burst allowance, shared by reference so several callers run under one budget. ## Connectors - [Overview](https://cocoindex.io/docs/connectors/): The built-in connectors that move data in and out of a CocoIndex flow — object stores, message streams, and relational, vector, and graph databases. Many work as a source, a target, or both. - [Amazon S3](https://cocoindex.io/docs/connectors/amazon_s3/): Read objects from Amazon S3 buckets and S3-compatible services (e.g. MinIO, Tigris) — with prefix filters, path matchers, size limits, and stable S3FilePath for memoization. - [Azure Blob Storage](https://cocoindex.io/docs/connectors/azure_blob/): Read blobs from Azure Blob Storage containers with prefix filters, path matchers, size limits, and stable AzureBlobFilePath values for memoization. - [BigQuery](https://cocoindex.io/docs/connectors/bigquery/): Write CocoIndex target rows into BigQuery tables with managed DDL, MERGE upserts, deletes, and automatic mapping from Python row types. - [Discord](https://cocoindex.io/docs/connectors/discord/): Index the messages and threads of Discord text, announcement and forum channels with your own bot's token. Each run lists every channel, and only the messages and threads that changed are reprocessed. - [Apache Doris](https://cocoindex.io/docs/connectors/doris/): Write rows to Apache Doris tables via stream load with automatic upserts and deletions, HNSW/IVF vector indexes, and inverted indexes for full-text search — with optional schema enforcement. - [FalkorDB](https://cocoindex.io/docs/connectors/falkordb/): Write to FalkorDB (a Redis-backed graph database) with support for node tables, relationship tables (edges), per-graph multitenancy, and vector indexes with cosine / euclidean / inner-product distances. - [Google Docs](https://cocoindex.io/docs/connectors/google_docs/): Keep a Google Doc in step with Markdown your flow declares. The doc is updated in place, block by block, so unchanged paragraphs and the comments on them stay; a person's edits are kept and reported, and can be read back as Markdown. Signs in with the drive.file scope only. - [Google Drive](https://cocoindex.io/docs/connectors/google_drive/): Read files recursively from Google Drive folders, via a service account or a personal account signed in with OAuth. Supports MIME-type filtering and auto-exports Google Docs, Sheets, and Slides to text or CSV. - [Iggy](https://cocoindex.io/docs/connectors/iggy/): Consume Apache Iggy topics as live streams/maps and produce messages as target states. - [Kafka](https://cocoindex.io/docs/connectors/kafka/): Consume Kafka topics as live keyed maps (topic_as_map → LiveMapFeed) or as raw event streams (topic_as_stream → LiveStream), and produce messages as target states — with automatic offset commits and partition rebalancing at at-least-once semantics. - [LanceDB](https://cocoindex.io/docs/connectors/lancedb/): Write and upsert rows to LanceDB tables with automatic schema inference from Python classes, vector columns via VectorSchemaProvider, and both system-managed and user-managed table lifecycles. - [Local filesystem](https://cocoindex.io/docs/connectors/localfs/): Walk local directories with path-matcher filtering, watch for changes in live mode via watchdog, and write outputs with declare_file() and declare_dir_target() — with memo-stable FilePath across project moves. - [Neo4j](https://cocoindex.io/docs/connectors/neo4j/): Write to Neo4j (a property graph database) with support for node tables, relationship tables (edges), per-database multitenancy, atomic-batch writes via Bolt transactions, real CREATE CONSTRAINT uniqueness, and vector indexes with cosine / euclidean similarity. - [OCI Object Storage](https://cocoindex.io/docs/connectors/oci_object_storage/): Read objects from Oracle Cloud Infrastructure (OCI) Object Storage buckets — with prefix filters, path matchers, size limits, and an optional live mode driven by OCI Object Storage events delivered through OCI Streaming. - [Postgres](https://cocoindex.io/docs/connectors/postgres/): Read Postgres tables via PgTableSource and write with declare_table_target() — automatic schema inference, pgvector index management (ivfflat / hnsw), custom type overrides, and SQL attachments for triggers and indexes. - [Qdrant](https://cocoindex.io/docs/connectors/qdrant/): Write points to Qdrant collections with single or named dense vectors, sparse vectors, multi-vector support, and schemaless payloads — configured via QdrantVectorDef and QdrantSparseVectorDef. - [Snowflake](https://cocoindex.io/docs/connectors/snowflake/): Write CocoIndex target rows into Snowflake tables with managed DDL, MERGE upserts, deletes, and automatic mapping from Python row types. - [SQLite](https://cocoindex.io/docs/connectors/sqlite/): Write rows to SQLite databases with optional sqlite-vec vector support via float[N] columns — covers regular tables and vec0 virtual tables for optimized vector similarity search, with auto-loading of the vec extension. - [SurrealDB](https://cocoindex.io/docs/connectors/surrealdb/): Write to SurrealDB with support for normal and relation (graph edge) tables, typed values, array record IDs, bounded transactions, and HNSW vector indexes with cosine / euclidean / manhattan distances. - [Turbopuffer](https://cocoindex.io/docs/connectors/turbopuffer/): Write rows to Turbopuffer namespaces with single or named vectors, per-namespace distance metric, and schemaless attributes — configured via VectorDef and NamespaceSchema. - [Valkey](https://cocoindex.io/docs/connectors/valkey/): Write documents to Valkey search indexes with vector similarity search — configured via VectorDef for dimension, distance metric, and index algorithm (HNSW or FLAT). - [zvec](https://cocoindex.io/docs/connectors/zvec/): Write documents to zvec, an embedded in-process vector database. Covers collection setup, declaring documents with dense and sparse vectors plus scalar and full-text fields, schema-from-class type mapping, and lifecycle management. ## Built-in Operations - [Overview](https://cocoindex.io/docs/ops/): Overview of CocoIndex's built-in operations: text chunking and splitting, local and hosted embeddings, audio transcription, and entity resolution, with links to each operation module's reference. - [Entity resolution](https://cocoindex.io/docs/ops/entity_resolution/): Deduplicate entity names via FAISS embedding similarity and a pluggable LLM pair-resolver that confirms matches and chooses canonical forms — with PINNED / PREFERRED policies for existing canonicals and resolution callbacks. - [LiteLLM](https://cocoindex.io/docs/ops/litellm/): Embed text and transcribe audio through LiteLLM's unified API across 100+ providers (OpenAI, Azure, Vertex AI, Bedrock, Cohere, and more) — with VectorSchemaProvider for automatic vector column configuration. - [Sentence transformers](https://cocoindex.io/docs/ops/sentence_transformers/): Run sentence-transformers models locally for text embeddings with automatic model caching, thread-safe GPU access, and optional normalization — plus VectorSchemaProvider integration for connectors. - [Text ops](https://cocoindex.io/docs/ops/text/): Built-in text utilities — code language detection, regex-based SeparatorSplitter, and syntax-aware RecursiveSplitter that returns position-tracked Chunks with optional custom domain-specific splitting rules. ## Advanced Topics - [Overview](https://cocoindex.io/docs/advanced_topics/): Tune concurrency and storage, recover cleanly from failures, see deep into a running update, customize memoization, build live components, and connect CocoIndex to systems it doesn't ship with. - [Concurrency control](https://cocoindex.io/docs/advanced_topics/concurrency_control/): Tune how many processing components can run at the same time with `max_inflight_components` or the `COCOINDEX_MAX_INFLIGHT_COMPONENTS` environment variable, and understand how the limit bounds a hierarchy of components without deadlocking it. - [Timeouts](https://cocoindex.io/docs/advanced_topics/timeouts/): Use `coco.timeout()` to put a time budget around a piece of processing — one file, one LLM call — with cooperative checks, deadline-aware retries, and clean time-boxing of whole updates. - [Progress monitoring](https://cocoindex.io/docs/advanced_topics/progress_monitoring/): Beyond report_to_stdout — read structured update stats with UpdateHandle.stats() and watch(), and split a run into separately-reported scopes with stats_group(). - [Memoization keys](https://cocoindex.io/docs/advanced_topics/memoization_keys/): Customize how CocoIndex fingerprints memoized inputs via __coco_memo_key__, registered memo key functions, or stable type IDs, and layer state validation (e.g. mtime, then content hash) on top — plus NotMemoKeyable to opt out for stateful types. - [Error handling](https://cocoindex.io/docs/advanced_topics/exception_handlers/): How CocoIndex isolates component failures, recovers from interrupted updates via two-phase processing, and lets you register exception handlers globally via lifespan or scoped via context manager to observe background errors. - [Internal storage](https://cocoindex.io/docs/advanced_topics/internal_storage/): CocoIndex persists target states and memo results in LMDB. The database grows automatically when a write runs out of space; tune the initial map_size and max_dbs via environment variables or programmatic settings for large-scale deployments. - [Multiple environments](https://cocoindex.io/docs/advanced_topics/multiple_environments/): Run isolated CocoIndex environments side by side with explicit Environment and Settings objects and separate db_paths — for multi-tenancy, library development, and testing. The CLI targets named environments via @env_name. - [Live components](https://cocoindex.io/docs/advanced_topics/live_component/): Implement the LiveComponent protocol with process() for full scans and process_live(operator) for incremental updates — covers LiveComponentOperator (update_full, update, delete, mark_ready) and LiveMapFeed / LiveMapView abstractions over event sources. - [Custom target connector](https://cocoindex.io/docs/advanced_topics/custom_target_connector/): Connect CocoIndex's declarative target-state system to external systems. Covers TargetHandler, tracking records, actions, sinks, root vs container targets, attachment providers, and idempotent operations. ## Contributing - [Setup dev environment](https://cocoindex.io/docs/contributing/setup_dev_environment/): Install Rust, uv, and prek hooks, then build the native extension with `maturin develop` to get a local CocoIndex checkout ready for development. - [Contributing guide](https://cocoindex.io/docs/contributing/guide/): How to find good first issues, claim work, run prek checks, and submit a pull request to CocoIndex — with a one-business-day review target and squash-merge workflow. ## About - [Community](https://cocoindex.io/docs/about/community/): Find the Discord, GitHub, Twitter, LinkedIn, and YouTube channels where the CocoIndex community asks questions, shares ideas, and gets support. - [Anonymous usage telemetry](https://cocoindex.io/docs/about/telemetry/): What CocoIndex's anonymous usage tracking collects, what it doesn't, and how to opt out. ## Examples > 41 runnable examples in the monorepo. Clone the repo with `git clone https://github.com/cocoindex-io/cocoindex`, then `cd cocoindex/examples/