# Chunk a Document Into ChromaDB and Connect Your AI Agent (Free, Local)

> Upload a document, see how it is chunked and stored in ChromaDB, then connect your own AI agent to that vector database. Free, in Docker, no API key.

Page: https://datautility.in/blog/chunk-document-chromadb-connect-ai-agent-free
This is the Markdown copy of the page. The tool itself runs in the browser: your files are processed on your own device and are not uploaded.

Published 2026-11-28 · Analyze & protect · chromadb tutorial, chunk document into vector database, local vector database docker, connect ai agent to chromadb, rag chunking, chromadb playground

Short answer: upload a file to the Vector DB tab of the Evals Lab, pick a chunking method, and the lab cuts it into chunks, embeds each one and stores it in ChromaDB inside Docker. You then see every chunk with its position and vector, search it by meaning, and connect your own AI agent to the same database. It needs no API key.

Open the tool: [Evals Lab](https://datautility.in/ai-evals-lab)

## What happens when you press Store

1. The lab reads your document (TXT, Markdown, PDF, HTML, CSV or JSON).

2. It splits the text with the method you chose: recursive, Markdown, paragraph, sentence or fixed size. Size and overlap are in characters.

3. Each chunk is embedded on your computer with the all-MiniLM-L6-v2 model.

4. Chroma stores the chunk text, its vector and its position (start and end characters) in the collection `my_documents`.

The app shows the result: a table of chunks with the first numbers of each vector, a chunk map that paints each chunk on the document (overlap in amber), and a search box.

## Connect your own agent

Start the lab with port 8768 published (`-p 127.0.0.1:8768:8768`). Then, from any Python code:

```
import chromadb

client = chromadb.HttpClient(host="localhost", port=8768)
col = client.get_collection("my_documents")
res = col.query(query_texts=["your question"], n_results=3)
```

To give it to an agent, wrap the query in a function and register it as a tool in your framework. Use the same embedding model (Chroma's default) so your questions match the stored vectors.

## Take the database with you

The database is a folder in the Docker volume. Copy it out with `docker cp evals-lab:/workspace/chroma ./my_chroma` and open it with `chromadb.PersistentClient(path="./my_chroma")`.

## Why use it

You see chunking instead of guessing at it. Change the method or size, press Store again and watch the chunks, the map and the search results change. Then take the same database into your own project. See the [ChromaDB docs](https://docs.trychroma.com) for more.

## How to use the Evals Lab: step by step

1. Start the lab with port 8768 published
2. Open the Vector DB tab and upload a document
3. Pick a chunking method and press Store
4. Search it, then copy the connection code for your agent

## When to use the Evals Lab

- Seeing how chunking and embeddings work
- Building a local knowledge base for an AI agent
- Comparing chunk sizes by searching the same question
- Learning ChromaDB without installing anything but Docker

## Example

Input:

```
northwind_support_handbook.txt, chunked and stored in ChromaDB
```

Output:

```
A score and a reason for every answer, and each run logged in MLflow
```

## Frequently asked questions

### Which vector database does it use?
ChromaDB, an open-source vector database. It runs inside the lab container and keeps its data in a Docker volume.

### Do I need an API key?
No. Chunks are embedded locally with all-MiniLM-L6-v2. Only the evals, where a model answers and judges, need a key.

### Can my AI agent use the database?
Yes. Publish port 8768 and connect with chromadb.HttpClient(host="localhost", port=8768), then query the collection my_documents.

Tip: Try the same question at chunk size 250 and 1000 and compare which chunk comes back first.

## Related tool pages

- [LLM as a Judge Playground: Grade AI Answers Free](https://datautility.in/llm-as-a-judge-playground): Try LLM as a judge free on your laptop: write a judge prompt or a DeepEval G-Eval metric, run it on every test question and read a score and a reason for each answer.
- [RAG Evaluation Playground: Test Chunking and Retrieval](https://datautility.in/rag-evaluation-playground): Evaluate a RAG app free on your computer: chunk a document into ChromaDB, test retrieval by meaning, grade every answer and compare chunk sizes side by side in MLflow.
- [DeepEval Playground: Try G-Eval Free on Your Laptop](https://datautility.in/deepeval-playground): Learn DeepEval hands-on, free: a Python IDE with a ready G-Eval project, goldens.csv, your own Gemini, Claude or OpenAI key and MLflow tracking. Runs in Docker.
- [Chunk a Document Into ChromaDB: Free Local Vector DB](https://datautility.in/chromadb-playground): Upload a document, pick a chunking method and see every chunk and vector stored in ChromaDB, free in Docker. Then connect your own AI agent to that database. No API key.

## Also try

- [Free AI Evals Lab](https://datautility.in/blog/free-ai-evals-lab-docker-deepeval-chromadb-mlflow)
- [Which chunk size is best for RAG?](https://datautility.in/blog/rag-chunk-size-best-chunking-strategy-experiment)

## More guides

- [Data Profiler: Check Data Quality Before You Use It](https://datautility.in/blog/data-profiler-check-data-quality)
- [Compare Two CSV or Excel Files: Find Added, Removed and Changed Rows](https://datautility.in/blog/compare-two-csv-files-find-differences)
- [Data Masking: Hide Emails, Phones and Names Before Sharing](https://datautility.in/blog/data-masking-hide-emails-phones-pii)
