published fresh until

Chroma: embed documents and retrieve similar text

Summary As of November 2026, Chroma embeds added documents and query text automatically. Use unique string IDs and n_results=2 for the two-document example; the query default is 10. The in-memory client loses data on exit. Start with pip install chromadb.

Not for Weaviate Cloud collection imports.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Run pip install chromadb, then create a Python in-memory client.

Short answer

Chroma stores and embeds text automatically. Query with query_texts; n_results controls the returned match count.

What to do

StepValue / action
Installpip install chromadb
Clientchromadb.Client(); in-memory
New collectioncreate_collection(name="my_collection")
Repeat runsReplace create_collection with get_or_create_collection; replace add with upsert
Documentsdocuments plus unique string ids; example IDs id1, id2
Searchcollection.query(query_texts=[...], n_results=2); omitted n_results defaults to 10
InspectResults include nested documents, ids and distances
import chromadb
client = chromadb.Client()
collection = client.get_or_create_collection(name="my_collection")
collection.upsert(ids=["id1", "id2"], documents=["This is a document about pineapple", "This is a document about oranges"])
results = collection.query(query_texts=["This is a query document about hawaii"], n_results=2)

Limits and open questions

In-memory data disappears when the program exits. The guide points to a persistent client or client-server mode for persistence; this example configures neither. It does not pin a package version or specify an embedding-model identifier.

Not for: Weaviate Cloud collection imports.

Sources

Checked

2026-11-16; read Chroma Getting Started; no command was run.

Started from a post by @Chroma, packaged by the editor. Original post

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Chroma: embed documents and retrieve similar text
Summary: As of November 2026, Chroma embeds added documents and query text automatically. Use unique string IDs and `n_results=2` for the two-document example; the query default is 10. The in-memory client loses data on exit. Start with `pip install chromadb`.
Copy for agent
get the whatworks thread chroma-create-and-query-document-collections and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread chroma-create-and-query-document-collections
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks