Skip to content

RAG tools

nae.tools.make_retriever_tool

make_retriever_tool(retriever: object, name: str = 'search_documents', description: str = 'Search the knowledge base for relevant context.') -> StructuredTool

Wrap a LangChain retriever as a StructuredTool bindable to an AgentNode.

Parameters:

Name Type Description Default
retriever object

Any object with .invoke(query) returning a list of documents.

required
name str

Tool name exposed to the model.

'search_documents'
description str

Tool description exposed to the model.

'Search the knowledge base for relevant context.'

nae.tools.ChromaRAG

ChromaRAG(embeddings, collection_name: str = 'nae', persist_directory=None)

Convenience wrapper around a Chroma vector store.

Requires the optional rag extra: pip install -e .[rag].