CocoIndex
Type: ../types/agent-memory-system-review.md · Status: current
CocoIndex, from cocoindex-io, is a Python/Rust framework for declaring AI data pipelines as target state and letting an incremental engine keep derived stores fresh. At the reviewed commit it persists internal target/memo tracking in LMDB, exposes a Python SDK and cocoindex CLI, ships connectors for file systems, databases, vector stores, graph stores, object storage, and streams, and includes an official Markdown skill that helps coding agents write correct CocoIndex v1 pipelines.
Repository: https://github.com/cocoindex-io/cocoindex
Reviewed commit: fea514024a9ac8d6d85d2026024b23f7948904f2
Last checked: 2026-06-04
Core Ideas
The central memory mechanism is incremental materialization, not conversational recall. CocoIndex users write Python functions that declare what target state should exist, then the engine compares the new declarations with prior state and applies minimal creates, updates, and deletes (docs/src/content/docs/getting_started/overview.mdx, docs/src/content/docs/programming_guide/target_state.mdx). For agent-memory comparison, CocoIndex is best read as memory infrastructure: it keeps retrieval and knowledge stores current for an agent or LLM app, but it does not itself run the agent loop.
The system separates source truth, internal state, and serving stores. User sources may be files, Google Drive, S3, Postgres, Kafka, and similar connectors; internal state records component existence, target ownership, function memoization, and user states in LMDB; target connectors then maintain files, rows, points, collections, graph records, messages, or other external artifacts (docs/src/content/docs/advanced_topics/internal_storage.mdx, rust/core/src/state_store/storage.rs, python/cocoindex/connectors/postgres/_target.py, python/cocoindex/connectors/qdrant/_target.py).
Context efficiency is upstream of the prompt. CocoIndex reduces the volume and staleness of downstream context by avoiding unnecessary reprocessing: component memoization, function memoization, stable paths, live-map feeds, target-state diffs, and source watches keep indexes current without re-embedding or re-extracting unchanged material (python/cocoindex/_internal/function.py, rust/core/src/engine/execution.rs, docs/src/content/docs/advanced_topics/live_component.mdx). It does not choose a token budget for an agent prompt; it makes the retrieval substrate fresher and cheaper before a host agent asks.
Live mode is write-side freshness, not pushed memory. Local file watching and Kafka feeds can trigger incremental target updates while the app stays running, and app.update(live=True) leaves live components processing after readiness (python/cocoindex/connectors/localfs/_source.py, python/cocoindex/connectors/kafka/_source.py, python/cocoindex/_internal/app.py). That freshness matters to agents, but the memory still enters model context only when a downstream app, query script, MCP server, or agent harness reads the target store.
Agent adoption is handled through a shipped skill. The repository includes skills/cocoindex/SKILL.md plus references, and the docs explain installation into Claude Code, Cursor rules, generic AGENTS.md/CLAUDE.md, or custom RAG stacks (docs/src/content/docs/getting_started/ai_coding_agents.mdx, skills/cocoindex/SKILL.md). That is a separate system-definition artifact: it teaches agents how to build with CocoIndex, while the engine maintains data stores those agents may later query.
Lineage is implementation-visible but source semantics are user-defined. The engine records stable paths, target ownership, memo fingerprints, context state, pending tokens, and child-existence reconciliation; connector handlers compute fingerprints and decide target actions (rust/core/src/state_store/submit_session.rs, python/cocoindex/_internal/target_state.py). The framework can show which component produced a target state, but truth, relevance, and retrieval quality depend on the user's pipeline and target query logic.
Artifact analysis
- Storage substrate:
files— The primary CocoIndex-managed state is file-backed LMDB under the configureddb_path, used for app state, component paths, target-state ownership, function memoization, and user state. Secondary stores are user-selected targets: local files, relational databases, vector stores such as Qdrant/LanceDB/Postgres pgvector, graph stores such as Neo4j/FalkorDB/SurrealDB, Kafka topics, and object/blob sources. - Representational form:
prosesymbolicparametric— Pipeline code, examples, generated docs, and skill text carry prose and authored procedural guidance; app configs, stable paths, target-state records, schemas, connector handlers, fingerprints, table/collection/graph definitions, and CLI/MCP-adjacent command surfaces are symbolic; embeddings and vector indexes in user pipelines add parametric retrieval state. - Lineage:
authoredimported— Users author pipeline code, schemas, target declarations, and the agent skill is shipped with the repo; source data is imported from external corpora and transformed into derived targets. I did not find a framework-level mechanism that derives durable behavior-shaping rules from agent session traces, so the lineage is not trace-extracted in the review sense. - Behavioral authority:
knowledgeinstructionroutingvalidationranking— Derived target stores are knowledge artifacts when a downstream agent or app queries them; the CocoIndex skill and pipeline code instruct agents/developers; stable paths, component mounts, source connectors, and target schemas route writes; type checks, identifier validators, schema validation, target reconciliation, and LMDB commit phases validate/update state; vector distances, graph traversal, SQL ordering, and user query code rank read-back when present.
Pipeline definitions. Storage substrate: authored Python modules plus optional project files created by cocoindex init. Representational form: symbolic program structure with prose comments and docs. Lineage: authored by a developer or agent, often with help from the shipped skill. Behavioral authority: instruction and routing, because these declarations decide what sources are read, which transformations run, and which target states are maintained (python/cocoindex/cli.py, skills/cocoindex/SKILL.md).
Internal LMDB state. Storage substrate: db_path/mdb, one environment with per-app sub-databases. Representational form: symbolic stable-path, target-owner, tracking-info, memo, and user-state records. Lineage: derived from app execution, source metadata, code fingerprints, and declared target states. Behavioral authority: validation and routing for future updates; it decides what can be reused, what must be reprocessed, what should be claimed, and what should be garbage-collected (docs/src/content/docs/advanced_topics/internal_storage.mdx, rust/core/src/state_store/storage.rs, rust/core/src/state_store/submit_session.rs).
External target stores. Storage substrate: target-specific systems selected by the pipeline. Representational form: symbolic rows/files/graph records/messages plus parametric vectors when the pipeline embeds chunks or entities. Lineage: derived from source data and transformation code, with connector tracking records and fingerprints deciding whether an action is necessary. Behavioral authority: knowledge and ranking for downstream retrieval; in the code-embedding example, chunks become pgvector rows and a separate query function performs vector search over them (examples/code_embedding/main.py, python/cocoindex/connectors/postgres/_target.py, python/cocoindex/connectors/neo4j/_target.py).
Live source feeds. Storage substrate: source systems and transient event streams, not durable memory by themselves. Representational form: symbolic keyed changes and file/message metadata. Lineage: imported from watches, queues, or source connectors. Behavioral authority: write-side routing; they cause mounted components to update/delete child paths, which then refreshes target stores (docs/src/content/docs/advanced_topics/live_component.mdx, python/cocoindex/_internal/live_component.py).
Agent skill. Storage substrate: repository files under skills/cocoindex/. Representational form: prose and symbolic snippets. Lineage: authored and versioned with the framework. Behavioral authority: instruction when an agent host loads it; it does not store learned memory, but it shapes future agent behavior while building or modifying CocoIndex pipelines (docs/src/content/docs/getting_started/ai_coding_agents.mdx, skills/cocoindex/).
Promotion path: CocoIndex can move authored/imported source material into stronger serving surfaces: raw files or messages become chunks, typed rows, vectors, graph nodes, summaries, or extracted entities. That promotion is specified by user pipeline code, not inferred by CocoIndex's own semantic judge.
Comparison with Our System
| Dimension | CocoIndex | Commonplace |
|---|---|---|
| Primary purpose | Incrementally maintain AI data pipelines and indexes | Git-native methodology KB for agent-operated knowledge bases |
| Canonical artifact | Python app plus LMDB tracking state and external target stores | Typed Markdown artifact plus generated indexes/reports |
| Source of truth | User source data and pipeline declarations | Repository artifacts with collection/type contracts |
| Write path | Engine-driven target reconciliation, memoization, live updates, connector actions | Human/agent-authored notes, snapshots, validation, semantic review |
| Read path | Downstream apps query maintained stores or load shipped skill | Agents pull with rg, indexes, links, skills, and instructions |
| Governance | Type/schema checks, stable paths, target handlers, fingerprints, transactional state | Frontmatter/type validation, link checks, review gates, git history |
CocoIndex is stronger than Commonplace as an incremental serving substrate. It has a real engine for detecting changes, memoizing expensive transformations, and reconciling external stores. Commonplace is stronger as a semantic review corpus: its artifacts are designed to be read, cited, reviewed, and connected as durable claims.
The systems meet at the point where a KB needs fresh derived indexes. CocoIndex could maintain embeddings, graph projections, or extracted source indexes for a Commonplace-like repository, but it would not replace the collection contracts, review sections, or semantic gates that decide what the artifacts mean.
Borrowable Ideas
Target state as an explicit contract. Ready as a design model. Commonplace already has generated indexes and validation reports; describing them as declared target state could make invalidation and cleanup rules clearer.
Stable paths for processing components. Ready for automation internals. CocoIndex's stable component paths are a useful analogue for review runs, generated reports, and source snapshots that need repeatable ownership and cleanup.
Preview mode for generated changes. Needs a concrete workflow. CocoIndex can compute target actions without applying them; Commonplace generation tools could expose similar previews before index/report rewrites.
Keep freshness machinery separate from semantic authority. Ready as a constraint. CocoIndex can keep an index current, but it does not prove that retrieved content is true or worth using; Commonplace should keep semantic review outside any incremental indexing layer.
Version agent-facing guidance with the API it describes. Ready now. The CocoIndex skill is bundled with the repo, which is a good pattern for keeping agent instructions close to implementation changes.
Write side
Write agency: manual automatic — Developers and agents manually author pipeline code, schemas, examples, and skill files; the framework automatically writes LMDB tracking state, memo entries, user-state records, target ownership records, and connector actions that create/update/delete files, rows, vectors, graph records, collections, topics, and other target states.
Curation operations: none — CocoIndex has automatic write-side maintenance, but I did not find a framework-level controlled curation operation over retained memories beyond freshness, memoization, target reconciliation, and target cleanup.
CocoIndex does not have a framework-level semantic curation loop over agent traces. Its automatic write side is incremental maintenance: source scans, file watches, Kafka feeds, memo invalidation, target reconciliation, and target cleanup. Those are behaviorally important for freshness, but they are not automatic consolidation, deduplication, synthesis, decay, or promotion of memories in the review taxonomy; user pipelines may implement such operations, but the framework does not impose them.
Read-back
Read-back: pull — CocoIndex-maintained stores re-enter an agent's context only when a downstream agent, application, query script, MCP server, RAG layer, or loaded skill deliberately reads them. I found no implemented CocoIndex agent loop or hook that injects retained memory into a model prompt without such a host-side retrieval step.
The main edge case is live mode: file-system and stream changes can update target stores continuously, but that is write-side freshness. It does not push memory into a receiving model context. The code-embedding example illustrates the boundary: cocoindex update -L keeps pgvector rows fresh, while python main.py "query" performs explicit vector retrieval (examples/code_embedding/main.py).
Selection, scope, and complexity are host-defined. A CocoIndex pipeline can maintain top-k vector stores, graph stores, entity tables, generated summaries, or file outputs, but prompt budgets, query formation, result formatting, and faithfulness tests live outside the framework unless the user writes them into the downstream app.
The shipped skill is also pull or host-loaded instruction, not learned read-back. When Claude Code, Cursor, AGENTS.md, or a custom RAG stack loads skills/cocoindex/, that guidance can instruct an agent, but it is static authored context rather than retained memory accumulated from use.
Curiosity Pass
The system is highly relevant to agent memory without being a memory agent. It solves the stale-index problem that many memory systems hand-wave, but it leaves read-back and behavioral authority to whatever application queries the maintained store.
The primary correctness claim is operational, not semantic. CocoIndex can know whether a target state declaration changed and whether an action is needed. It cannot know whether an extracted entity, embedding neighbor, or generated summary is the right thing for an agent to believe.
LMDB internal state is a hidden dependency of fresh context. The visible memory may be a vector DB or graph DB, but the freshness guarantee depends on the file-backed internal state that tracks memoization and ownership.
The official skill is the most direct agent-facing artifact. It is not memory in the adaptive sense, but it is a clean example of versioned system-definition context for coding agents.
CocoIndex's "lineage" is stronger for processing provenance than for review provenance. Stable paths and target ownership explain how a row was produced, but they do not carry Commonplace-style source citations or semantic review status unless the user pipeline encodes them.
What to Watch
- Whether CocoIndex-code or another repository component adds an MCP server that directly serves maintained code context to agents; that would turn the framework's pull surface into a concrete agent read-back product.
- Whether examples begin recording source citations and review metadata into target rows; that would make CocoIndex more useful for high-trust KB-derived RAG.
- Whether live-mode connectors add more source types with durable checkpoint semantics; that affects how suitable CocoIndex is for long-running enterprise memory stores.
- Whether the agent skill gains generated or API-checked freshness guarantees; that would strengthen its role as versioned system-definition context.
- Whether target-store query templates become first-class; that would move CocoIndex closer to read-back design rather than write-side indexing alone.
Relevant Notes:
- Knowledge storage does not imply contextual activation - distinguishes: CocoIndex maintains stores, but a downstream app still has to query or load them.
- Axes of artifact analysis - applies: pipeline code, LMDB state, target stores, source feeds, and skill files have different forms and authority.
- Knowledge artifact - classifies: target rows, vectors, graph records, and generated files advise downstream agents as evidence or context.
- System-definition artifact - classifies: pipeline declarations, connector handlers, target schemas, and the shipped skill shape behavior with instruction, routing, validation, and ranking force.
- Keep compiled views aligned - relates: CocoIndex is mostly a freshness and incremental-update mechanism for derived context stores.