Skip to main content

Chroma Plugin

The genkitx-chroma plugin provides integration with ChromaDB, an open-source vector database for building AI applications with embeddings. Use it for retrieval-augmented generation (RAG) and semantic search.

Installation

Prerequisites

Install and run ChromaDB:
Default server: http://localhost:8000

Basic Setup

Configuration

Plugin Configuration

Custom Client Configuration

Usage

Indexing Documents

Retrieving Documents

RAG with Retrieved Context

Advanced Usage

Filtering with Metadata

Creating Collections Manually

Deleting Collections

Complete RAG Example

Best Practices

Choose the Right Embedder

Chunk Large Documents

Error Handling

Collection Naming

Configuration Options

Retriever Options

Where Filters

Troubleshooting

ChromaDB Not Running

Error: ECONNREFUSED Solution: Start ChromaDB server:

Collection Not Found

Error: Collection 'name' not found Solution: Set createCollectionIfMissing: true or create manually.

Slow Retrieval

Solutions:
  • Reduce k value (return fewer results)
  • Use more specific metadata filters
  • Optimize collection size
  • Use smaller embeddings