feat. Integrated agent_rag_handler with the agent class #903
+366
−57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive integration of Retrieval-Augmented Generation (RAG) functionality into the Swarms framework. It includes a new example script (
simple_rag_example.py
), updates to theAgent
class to support RAG operations, and enhancements to theAgentRAGHandler
. These changes aim to improve the framework's ability to retrieve and utilize external knowledge dynamically.RAG Integration Enhancements:
simple_rag_example.py
, demonstrating the usage of RAG with a simple memory store and Swarms Agent. The example includes memory querying, manual saves, and integration of RAG into agent workflows.Agent
class with methods for enabling, disabling, and managing RAG functionality, including memory queries, saving to memory, and retrieving statistics. Legacy methods were replaced with new RAG-specific handlers. [1] [2] [3]AgentRAGHandler
to ensure default relevance keywords are used when none are provided in the RAG configuration.Code Refactoring:
Agent
initialization to support RAG configuration directly and ensure proper setup of the RAG handler. Legacy methods for memory querying and handling were deprecated. [1] [2]_run
and related methods inAgent
to incorporate RAG operations seamlessly during task execution and final memory consolidation. [1] [2]Framework Updates:
RAGConfig
to the Swarmsstructs
module to facilitate RAG configuration management. [1] [2]_save_additional_components
and_reinitialize_after_load
methods to support saving and reinitializing RAG handler statistics. [1] [2] [FEAT] [Integrate AgentRAGHandler] #880📚 Documentation preview 📚: https://swarms--903.org.readthedocs.build/en/903/