avocado
avocado · AvocadoDB PostgreSQL extension for deterministic context compilation for AI agents.
Overview
PostgreSQL · 16
| Relationships | |
|---|---|
| Requires | vector |
Usage
Sources:
- Pinned upstream PostgreSQL extension guide
- Pinned extension control file
- Pinned extension schema
- Pinned SQL function source
avocado version 2.2.0 is a pgrx PostgreSQL extension for ingesting text artifacts, generating embeddings, retrieving relevant spans, and compiling citation-bearing context for AI agents. It stores data in ordinary PostgreSQL tables under schema avocado and uses vector for its 1,024-dimensional HNSW index.
Core Workflow
The control file requires vector, marks installation as superuser-only, and makes the extension non-relocatable. After installation, initialize the tables before ingesting content:
FastEmbed with all-MiniLM-L6-v2 is the default embedding provider. An Ollama endpoint can be selected for the current backend before ingestion or search:
Important Objects
avocado_ingest_artifact(path, content, metadata): chunks text by lines, embeds each span, and stores the artifact and spans.avocado_search_spans(query, limit): returns matching spans and cosine-similarity scores asjsonb.avocado_compile(query, config): applies vector search, optional MMR diversification, token-budget packing, deterministic path/line ordering, and returns context plus citations asjsonb.avocado_create_session(),avocado_add_message(), andavocado_get_conversation_history(): maintain conversation state.avocado_register_agent()and relation functions: maintain agent metadata and agreement/disagreement records.avocado_stats()andavocado_version(): report stored-object counts, embedding configuration, and extension version.
Operational Notes
The reviewed build exposes only a PostgreSQL 16 pgrx feature and its container is based on PostgreSQL 16; verify any other server version independently. The default FastEmbed model can require a model download and substantial backend memory, while Ollama performs synchronous HTTP calls from a PostgreSQL backend. Restrict execution privileges, outbound access, and provider configuration accordingly, and set statement timeouts appropriate for embedding latency.
Embeddings are padded or truncated to vector(1024), so changing providers can mix models and dimensions in one store; re-ingest data rather than comparing incompatible embeddings. The reviewed 2.2.0 ingestion path creates a new artifact identifier before upserting by unique path, so test repeated ingestion of the same path and span replacement before relying on updates. Back up the avocado tables as normal database data and validate HNSW build cost, model reproducibility, and retrieval quality on the actual corpus.