retrieve
Method
This is a method of the Agent class in the agent module.Retrieve context from knowledge without LLM generation. Returns a ContextPack that can be passed to chat_with_context(). This enables conditional retrieval - only retrieve when needed.
Signature
Parameters
Search query **kwargs: Additional arguments (top_k, rerank, etc.)
Returns
ContextPack with context string and citations (no LLM call)
Exceptions
ValueError
ValueError
If no knowledge is configured
ImportError
ImportError
If RAG module is not available
Usage
Uses
ValueErrorImportErrorkwargs.setdefaultretrieve
Used By
Source
View on GitHub
praisonaiagents/agent/agent.py at line 3060
