agent-squad icon indicating copy to clipboard operation
agent-squad copied to clipboard

Add Chroma Retrieval #323

Open ailunc opened this issue 7 months ago • 2 comments

Issue Link (REQUIRED)

https://github.com/awslabs/agent-squad/issues/323 Fixes #323

Summary

Changes

  • Added Python implementation of Chroma Retriever
    • Created ChromaRetriever class and ChromaRetrieverOptions class
    • Implemented all necessary retrieval methods
    • Added unit tests
    • Updated dependencies and exports
  • Added TypeScript implementation of Chroma Retriever
    • Created ChromaRetriever class and ChromaRetrieverOptions interface
    • Implemented all necessary retrieval methods
    • Added unit tests
    • Updated dependencies and exports
    • Configured testing environment

User experience

Before:

  • Users could not use ChromaDB as a retriever
  • Manual implementation of ChromaDB integration was required

After:

  • Users can directly use Chroma Retriever
  • Support for both local and remote ChromaDB instances
  • Support for custom embedding functions
  • Support for persistent storage
  • Support for SSL connections
  • Support for custom result count
  • Support for metadata retrieval

Usage examples:

Python:

from agent_squad.retrievers import ChromaRetriever, ChromaRetrieverOptions

# Create retriever
options = ChromaRetrieverOptions(
    collection_name="my_collection",
    persist_directory="./data"
)
retriever = ChromaRetriever(options)

# Retrieve documents
results = await retriever.retrieve("query text")
combined_results = await retriever.retrieve_and_combine_results("query text")

TypeScript:

import { ChromaRetriever, ChromaRetrieverOptions } from 'agent-squad';

// Create retriever
const options: ChromaRetrieverOptions = {
    collectionName: "my_collection",
    persistDirectory: "./data"
};
const retriever = new ChromaRetriever(options);

// Retrieve documents
const results = await retriever.retrieve("query text");
const combinedResults = await retriever.retrieveAndCombineResults("query text");

Checklist

  • [x] I have performed a self-review of this change
  • [x] Changes have been tested
  • [x] Changes are documented
  • [x] I have linked this PR to an existing issue (required)
Is this a breaking change?

RFC issue number: N/A

Checklist:

  • [x] Migration process documented
  • [x] Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

ailunc avatar May 07 '25 02:05 ailunc

Hey @ailunc ! Are you still working on this? If not, I can take over and compete this PR

kylediaz avatar Aug 19 '25 23:08 kylediaz

Occupied by other code :) Feel free to take over!

ailunc avatar Aug 20 '25 02:08 ailunc