CocoIndex is a Python library that automatically maintains search indexes derived from declarative transformations. Users define how to transform source data into an index, and CocoIndex incrementally updates the index when sources change, minimizing recomputation. As of version 1.0.2, it requires Python >= 3.11 and is under active development with monthly releases.
pip install cocoindexVerified import paths — ran on the pinned version, not inferred.
Minimal example: define a DataFlow subclass, transform data, and build a persistent index.
Use cocoindex.rebuild() or cocoindex.update() after changing source data.
Provide a valid embedding vector (list of floats) for each document in the 'embedding' column.
Use public API imports: from cocoindex import DataFlow, build, rebuild, etc.
Run pip install cocoindex --upgrade in the correct Python environment (>=3.11).
Ensure transform() method always creates an index by calling self.create_index() even if no data.
No dependency data recorded yet.