-
Notifications
You must be signed in to change notification settings - Fork 466
feat: Add a tool to search a Chroma database #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
bbc4cea
to
d53416e
Compare
There was a problem hiding this 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?
@kylediaz I think bumping to > 1.0.0 is currently blocked by the |
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 |
d53416e
to
b2e5383
Compare
bump on this |
b2e5383
to
10f1ffb
Compare
@lucasgomide hi! bump on this :) |
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.