AI applications need open data infrastructure that keeps their context correct. For an agent or a RAG system, the data is the context the model reasons over. Stale or poorly chunked context grounds the model in the wrong facts, and prompt engineering does not recover from that. This post explains why existing data pipelines fall short for that job, and the design choices we made in CocoIndex.
From data for humans to data for AI
Most data frameworks were built to prepare data for people: reports, dashboards and analytics. Analytics platforms such as Spark and Flink changed how the industry processes and transforms data at scale.
AI adds requirements and capabilities that call for a different kind of data transformation.
What has changed?
- AI can process new types of data, for example by running models over unstructured data.
- AI can handle high data throughput, and AI agents need high-quality, fresh data to make good decisions.
- Data preparation for AI happens continuously, with flexible schemas and sources that keep changing.
- Developers need a faster iteration cycle: they change transformation heuristics, add computations and add columns, and should not wait hours or days to see the result.
Why AI needs quality and freshness
For analytics, slightly stale or noisy data makes a dashboard a little less accurate. For AI, a retrieval pipeline built on poorly chunked or out-of-date content gives the model wrong facts to work from, and an agent that acts on stale state takes the wrong action. So quality and freshness are correctness requirements. When a source document changes, the embeddings and structured fields derived from it must update within seconds instead of waiting for a nightly rebuild. Until they do, the system answers from outdated facts. Keeping an agent’s context in sync with live mode shows this with a running example.
What the infrastructure must handle
The new patterns need infrastructure that can:
- Process data beyond tables: videos, images, PDFs and deeply nested structures, where one input fans out into many outputs.
- Run AI workloads inside the pipeline. Models on your own GPUs and large numbers of calls to remote LLMs bring new problems: scheduling work across CPUs and GPUs, and respecting remote rate limits and backpressure.
- Explain what the pipeline did with the data.
- Handle changes to the data, the schema and the logic.
In addition, we need to:
- Do it at scale, with what we have learned from building scalable data pipelines.
- Make it usable by developers who are not data engineers.
Why isn’t patching existing data pipelines enough?
Many traditional data frameworks fall short for AI data in these ways:
- They are limited to tabular data models, which fit hierarchical or nested data poorly.
- They require determinism. Many AI operations are not fully deterministic, for example LLM calls, or an OCR service whose version changes.
- They need more than one language. Many use SQL, and transformations that SQL does not support fall back to Python UDFs. Users switch between two languages with overlapping features. One general-purpose language should handle all transformations.
- They target CPU-bound workloads and do not reach the best throughput with GPU work and remote API calls.
- They do not handle change. A schema change, data change or logic change usually means rebuilding the output from scratch.
So developers handle AI data by hand: they write Python and wrap it in an orchestrator. That works for a demo; then they must handle scale, backend failures, restarts from where a run stopped, rate limits and backpressure, integrations for fresh data, and purging output whose source is gone. Each of these gets harder at scale. Patching existing systems does not solve this; the design has to start from these needs.
The design choices in CocoIndex
State-driven data pipeline
You declare the target state as a function of the source state, and CocoIndex computes and applies the changes that make the targets match (see core concepts). CocoIndex sets up the targets and processes changes incrementally. Runtime controls handle retries, concurrency limits, and batching for supported operations.
Persistent computing model
Most data pipelines are transient: they stop once all data is processed. If the data or the code changes, you process everything again. CocoIndex treats a pipeline as long-lived. It keeps the state of earlier runs and reprocesses only what a data or code change affects, so the output keeps up with the latest input data and code.
This model supports incremental processing as input data and code change.
Clear data ownership with fine-grained lineage
Pipeline output is derived from source data by transformation logic. Each row the pipeline creates traces back to specific rows or files in the source, and to specific pieces of logic. This is what makes refreshes correct when data or logic changes, and it makes the output explainable.
Everything in the target is derived data; nothing in the index is maintained by hand.
Every chunk, embedding and extracted field exists only as the output of your logic applied to one source item.
This is why incremental updates can be correct: CocoIndex knows which source item and which logic produced each output row, so a change to one document recomputes only the rows it owns, and the rows of a deleted source item are deleted instead of staying behind as stale context.
It also makes the pipeline auditable: for any indexed value, you can ask where it came from.
In CocoIndex v1, cocoindex show --target-states lists each target row with the component that owns it.
Core concepts and the overview cover this state-driven model.
Typed Python
Each processing step is a plain Python function decorated with @coco.fn, with ordinary type hints.
A target’s schema comes from a Python class: a connector’s TableSchema.from_class() reads the class, including the vector dimension of an embedding column, and CocoIndex creates the table to match.
See data types and vector schema.
Open ecosystem
Developers should be able to plug in the building blocks they choose. AI agents are specific to their domains, and each team makes different choices of source, storage and domain-specific processing. So the data stack must be open, easy to customize, and able to take the user’s own building blocks.
The ecosystem grows fast: new sources, targets, data formats and transformation building blocks. The system should not be tied to any one of them. Instead of waiting for a connector, anyone should be able to build a pipeline from flexible building blocks that work directly with internal APIs or external systems.
Why the data stack should be open
We believe the AI-native data stack must be open. The space moves too fast for closed systems to keep up. Open infrastructure gives:
- A transparent design and fast iteration
- A community that works on shared problems
- Composability with other open ecosystems (agents, analytics, compute, real-time and orchestration frameworks)
- No lock-in for developers or companies experimenting at the frontier
Anyone should be able to contribute to it and build on it.
Build with the ecosystem
CocoIndex provides data transformations for orchestration frameworks, agent systems and analytical pipelines. Developers combine their own sources, transformations and targets in one app.
Community
Thank you to our community for the contributions, feedback and suggestions. This post marked CocoIndex reaching 3,000 stars on GitHub. On November 6, 2026, the repository had 11,831 stars.
Build fresh context for your agents.
CocoIndex keeps derived data in sync with its sources. Only what changed re-runs.


