AIDB is an EDB-maintained PostgreSQL extension that brings AI data workflows directly into your Postgres database. Define pipelines in SQL to parse, chunk, embed, and index your data — then query it with semantic search, hybrid search, and LLM-powered retrieval. Common use cases include retrieval-augmented generation (RAG), semantic search over documents and images, and automated document ingestion pipelines from S3 or local storage.
Using AIDB with an AI coding agent
If you work with AIDB through an AI coding agent such as Claude Code, install the AIDB Agent Skill so the agent has built-in, validated knowledge of AIDB.
Where to start
If you're new to AIDB, follow this end-to-end workflow:
Overview — Learn the core concepts: what pipelines and knowledge bases are, and how they fit together.
Install — Install the
aidbpackage, configureshared_preload_libraries, and enable the extension in your database.Integrating models — Register the AI model that will power your pipeline. Every pipeline step that generates embeddings or processes text requires a model — either a default local model (no setup needed) or an external API model that you register with
aidb.create_model(). Do this before creating pipelines.External storage (optional) — If your source data lives in S3 or a local file system rather than a Postgres table, configure a volume using PGFS so pipelines can read from it.
Agents (optional) — Build an in-database agent that reasons over multiple steps and calls tools — AIDB's own operations, your own SQL queries, or tools imported from an external MCP server.
AI pipelines — Define a pipeline that reads from your data source, transforms it (chunk, parse, embed), and writes the output to a knowledge base. This is where the model you registered in step 3 is put to work.
Knowledge bases — Query the vector embeddings your pipeline produced. Use
aidb.retrieve_text()oraidb.retrieve_key()for semantic search, or combine vector and keyword search with hybrid search.Semantic knowledge bases (optional) — Index your schema — tables, views, columns, and comments — for natural-language schema search and text-to-SQL, so questions map to the right relations and to reusable, parameterized queries.
Documentation map
| Section | What it covers |
|---|---|
| Release notes | What changed in each version |
| Compatibility | Supported platforms and Postgres versions for AIDB and PGFS |
| Install | How to install and configure the AIDB extension |
| Integrating models | Local models, external APIs (OpenAI, NIM, Gemini, OpenRouter), and supported model variants |
| External storage | Using S3-compatible object stores and local file systems as pipeline data sources |
| Agents | Building in-database agents, invoking them, and delegation |
| Tools | The unified tool catalog: native tools, custom SQL tools, and MCP tools |
| MCP endpoint | Serving AIDB's tool catalog to external MCP clients over HTTP |
| AI pipelines | Defining pipelines, pipeline steps, orchestration, and examples |
| Knowledge bases | Semantic search, hybrid search, and vector index options |
| Semantic knowledge bases | Schema-metadata search and text-to-SQL: semantic KBs, semantic aliases, and agent tools |
| SQL functions | Standalone SQL functions for chunking, parsing, OCR, summarization, and embedding |
| Reference | Full API reference for all AIDB functions and views |
| Observability | Built-in OpenTelemetry tracing: the aidb_otel schema, storage format, background workers, and traced attributes |