Skip to main content

Table of Contents

Module spoon_ai.agents.rag

RetrievalMixin Objects​

class RetrievalMixin()

Mixin class for retrieval-augmented generation functionality

initialize_retrieval_client​

def initialize_retrieval_client(backend: str = 'chroma', **kwargs)

Initialize the retrieval client if it doesn't exist

add_documents​

def add_documents(documents, backend: str = 'chroma', **kwargs)

Add documents to the retrieval system

retrieve_relevant_documents​

def retrieve_relevant_documents(query, k=5, backend: str = 'chroma', **kwargs)

Retrieve relevant documents for a query

get_context_from_query​

def get_context_from_query(query)

Get context string from relevant documents for a query