You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/playground/memory/chroma_usage_example.py

17 lines
258 B

from swarms.memory import ChromaDB
# Initialize the memory
chroma = ChromaDB(
metric="cosine",
limit_tokens=1000,
verbose=True,
)
# Add text
text = "This is a test"
chroma.add(text)
# Search for similar text
similar_text = chroma.query(text)