Skip to content

Conversation

kylediaz
Copy link

Hello from the Chroma team 👋

This adds a basic tool that lets agents query their data in Chroma.

We also unpinned the chromadb version. Ideally, we'd like to get you on >1.0.0 because CrewAI uses ChromaDB for short-term memory. Since we rewrote it in rust, upgrading to 1.0.0 should make Chroma 4x faster, instantly.

import chromadb
from crewai_tools import ChromaSearchTool

client = chromadb.PersistentClient(path="./chroma_db")
collection = client.get_or_create_collection(name="my_documents")

tool = ChromaSearchTool(
    collection=collection,
)

@kylediaz kylediaz force-pushed the kylediaz/crewai-chroma-tool branch from bbc4cea to d53416e Compare August 26, 2025 22:41
@kylediaz kylediaz requested a review from lorenzejay August 26, 2025 22:42
Copy link
Contributor

@lucasgomide lucasgomide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kylediaz , could you record a Loom showing this tool in action with a Crew?

@greysonlalonde
Copy link
Contributor

@kylediaz I think bumping to > 1.0.0 is currently blocked by the embedchain dependency

@kylediaz
Copy link
Author

Hey @kylediaz , could you record a Loom showing this tool in action with a Crew?

uv init
uv add chromadb crewai
cd [crewai-tools repo]
uv pip install -e .
import os
import crewai
from crewai_tools import ChromaSearchTool
import chromadb

client = chromadb.CloudClient(
  api_key=os.getenv('CHROMA_API_KEY'),
  tenant=os.getenv('CHROMA_TENANT'),
  database='test-db'
)

collection = client.get_collection(name="demo-data-upload")

search_tool = ChromaSearchTool(collection=collection)


rag_agent = crewai.Agent(
    role="RAG Agent",
    goal="You are a helpful assistant that can answer questions about the documents in the collection.",
    backstory="You are a helpful assistant that can answer questions about the documents in the collection.",
    verbose=True,
    model='openai/gpt-4o',
    api_key=os.getenv('OPENAI_API_KEY'),
    tools=[search_tool],
)

task = crewai.Task(
    description="Answer the question: Tell me about the user's preferences?",
    expected_output="The user's preferences",
    agent=rag_agent,
)

crew = crewai.Crew(
    agents=[rag_agent],
    tasks=[task],
    verbose=True,
)

crew.kickoff()
crewai-tool-demo.mp4

@kylediaz kylediaz force-pushed the kylediaz/crewai-chroma-tool branch from d53416e to b2e5383 Compare August 28, 2025 18:53
@kylediaz
Copy link
Author

bump on this

@kylediaz kylediaz force-pushed the kylediaz/crewai-chroma-tool branch from b2e5383 to 10f1ffb Compare September 16, 2025 00:46
@kylediaz
Copy link
Author

kylediaz commented Oct 1, 2025

@lucasgomide hi! bump on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants