Skip to content

feat. Integrated agent_rag_handler with the agent class #903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

harshalmore31
Copy link
Collaborator

@harshalmore31 harshalmore31 commented Jun 18, 2025

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 the Agent class to support RAG operations, and enhancements to the AgentRAGHandler. These changes aim to improve the framework's ability to retrieve and utilize external knowledge dynamically.

RAG Integration Enhancements:

  • New Example Script: Added 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 Updates: Extended the 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]
  • RAG Handler Enhancements: Improved the AgentRAGHandler to ensure default relevance keywords are used when none are provided in the RAG configuration.

Code Refactoring:

  • Initialization Improvements: Refactored 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]
  • Memory and Tool Handling: Updated _run and related methods in Agent to incorporate RAG operations seamlessly during task execution and final memory consolidation. [1] [2]

Framework Updates:

  • Structs Module: Added RAGConfig to the Swarms structs module to facilitate RAG configuration management. [1] [2]
  • Agent Persistence: Enhanced _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/

- Introduced a new example demonstrating RAG integration with Swarms framework.
- Added SimpleMemoryStore class for in-memory storage and querying.
- Enhanced Agent class with RAG configuration and methods for RAG operations.
- Updated RAGConfig to include default relevance keywords for insights extraction.
@harshalmore31 harshalmore31 changed the title Integrated agent_rag_handler with the agent class feat. Integrated agent_rag_handler with the agent class Jun 18, 2025
@harshalmore31 harshalmore31 linked an issue Jun 19, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] [Integrate AgentRAGHandler]
1 participant