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

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 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.

Open the Evals Lab

Related tool pages

Also try

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.