diff --git a/README.md b/README.md index f026a1d..7ed1950 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,29 @@ if __name__ == "__main__": ### ChromaDB -``` +```python +from swarms_memory import ChromaDB + +chromadb = ChromaDB( + metric="cosine", + output_dir="results", + limit_tokens=1000, + n_results=2, + docs_folder="path/to/docs", + verbose=True, +) + +# Add a document +doc_id = chromadb.add("This is a test document.") + +# Query the document +result = chromadb.query("This is a test query.") + +# Traverse a directory +chromadb.traverse_directory() + +# Display the result +print(result) ``` diff --git a/chroma_db.py b/chroma_db.py new file mode 100644 index 0000000..10c2057 --- /dev/null +++ b/chroma_db.py @@ -0,0 +1,22 @@ +from swarms_memory import ChromaDB + +chromadb = ChromaDB( + metric="cosine", + output_dir="results", + limit_tokens=1000, + n_results=2, + docs_folder="path/to/docs", + verbose=True, +) + +# Add a document +doc_id = chromadb.add("This is a test document.") + +# Query the document +result = chromadb.query("This is a test query.") + +# Traverse a directory +chromadb.traverse_directory() + +# Display the result +print(result) diff --git a/example.py b/example.py deleted file mode 100644 index e69de29..0000000