-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add configurable AI agents #318
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
base: main
Are you sure you want to change the base?
Conversation
This change introduces the basic framework for configurable AI agents that can be called for a collection. Backend: - Added `EXTERNAL_AGENT_MCP_URL` to `core.config` for configuring the external agent server. - Created a new `AgentService` in `rag_solution.services` to handle communication with the external MCP agent server. - Added `get_agents` and `invoke_agent` methods to the `AgentService`. - Created a new API router at `rag_solution/router/agent_router.py` with endpoints for listing and invoking agents. - Registered the new agent router in `main.py`. - Added unit tests for the `AgentService`. Frontend: - Created a new `AgentList.tsx` component to display available agents. - Updated the `apiClient` to include methods for fetching and invoking agents. - Integrated the `AgentList` component into the collection details view. - Added unit tests for the `AgentList` component. Encountered and resolved several issues during development: - Backend test environment setup issues with `pytest-asyncio` and `respx`. These were resolved by correcting the `pyproject.toml` file and reinstalling dependencies. - A typo in `agent_service.py` (`httpy` instead of `httpx`) was corrected. - Frontend test failures due to incorrect import of `apiClient` and missing Jest configuration for ES modules. These were resolved by correcting the import statement and adding `transformIgnorePatterns` to `package.json`.
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. |
🚀 Development Environment OptionsThis repository supports Dev Containers for a consistent development environment. Option 1: GitHub Codespaces (Recommended)Create a cloud-based development environment:
Option 2: VS Code Dev Containers (Local)Use Dev Containers on your local machine:
Option 3: Traditional Local SetupSet up the development environment manually: # Clone the repository
git clone https://github.com/manavgup/rag_modulo.git
cd rag_modulo
git checkout feature/agent-integration
# Initialize development environment
make dev-init
make dev-build
make dev-up
make dev-validate Available CommandsOnce in your development environment: make help # Show all available commands
make dev-validate # Validate environment setup
make test-atomic # Run atomic tests
make test-unit # Run unit tests
make lint # Run linting Services AvailableWhen running
This automated message helps reviewers quickly set up the development environment. |
PR Review: Add Configurable AI AgentsThank you for this contribution! I've reviewed the code and have the following feedback: ✅ Strengths
🔴 Critical Issues1. Missing File Ending Newline
|
@claude this PR is about introducing the basic framework for configurable AI agents that can be called for a collection. Think through this and write the epic and user stories. Users should be able to select one or more agents to be run against their collection. How to provide support for MCP mentioned in other issues as well? What backend services and API endpoints for managing agents? |
Claude finished @manavgup's task —— View job Agent Framework Epic and User Stories ✅I've analyzed the current agent implementation and created a comprehensive epic with user stories for the configurable AI agent framework. This provides a complete roadmap for integrating MCP-based agents with RAG Modulo collections. 🎯 Epic: Configurable AI Agent Framework for RAG CollectionsVision StatementEnable users to enhance their RAG collections with configurable AI agents that can perform specialized tasks like document analysis, summarization, data extraction, and custom workflows. The system will integrate with the Model Context Protocol (MCP) to provide a standardized interface for agent communication and orchestration. Business Value
📋 User Stories🔵 Epic 1: Agent Discovery and SelectionUS-1.1: View Available AgentsAs a RAG Modulo user Acceptance Criteria:
Technical Notes:
US-1.2: Multi-Agent Selection for CollectionsAs a RAG Modulo user Acceptance Criteria:
Technical Implementation: # Backend Schema Addition
class CollectionAgentAssociation(BaseModel):
collection_id: UUID4
agent_ids: list[str] # MCP tool IDs
enabled: bool = True
config: dict[str, Any] = {} # Agent-specific configuration
# New Repository Method
class CollectionRepository:
async def update_agent_associations(
self, collection_id: UUID, agent_ids: list[str]
) -> CollectionAgentAssociation: ...
# Frontend Component
interface AgentSelectorProps {
collectionId: string;
selectedAgents: string[];
onSelectionChange: (agentIds: string[]) => void;
} US-1.3: Agent Configuration UIAs a RAG Modulo user Acceptance Criteria:
Technical Notes:
🟢 Epic 2: Agent Execution and MonitoringUS-2.1: Execute Agent on CollectionAs a RAG Modulo user Acceptance Criteria:
Technical Implementation: # Backend Endpoint Enhancement
@router.post("/collections/{collection_id}/agents/{agent_id}/execute")
async def execute_agent_on_collection(
collection_id: UUID4,
agent_id: str,
params: dict[str, Any],
background_tasks: BackgroundTasks,
current_user: User = Depends(get_current_user)
) -> AgentExecutionResponse:
"""Execute an agent on a specific collection."""
# Create execution task
execution_id = await agent_execution_service.create_execution(
collection_id=collection_id,
agent_id=agent_id,
user_id=current_user.id,
params=params
)
# Execute in background
background_tasks.add_task(
agent_execution_service.execute_agent,
execution_id=execution_id
)
return AgentExecutionResponse(
execution_id=execution_id,
status="running",
message="Agent execution started"
) US-2.2: Agent Execution HistoryAs a RAG Modulo user Acceptance Criteria:
Database Schema: class AgentExecution(BaseModel):
id: UUID4
collection_id: UUID4
agent_id: str
user_id: UUID4
status: Literal["pending", "running", "completed", "failed"]
params: dict[str, Any]
result: dict[str, Any] | None
error_message: str | None
started_at: datetime
completed_at: datetime | None
execution_time_ms: int | None US-2.3: Real-time Agent Execution StatusAs a RAG Modulo user Acceptance Criteria:
🟣 Epic 3: MCP Integration and StandardizationUS-3.1: MCP Protocol SupportAs a platform developer Acceptance Criteria:
MCP Integration Points: class MCPClient:
"""Client for communicating with MCP-compatible servers."""
async def list_tools(self) -> list[MCPTool]:
"""Get available tools from MCP server."""
async def get_tool_schema(self, tool_id: str) -> dict[str, Any]:
"""Get parameter schema for a specific tool."""
async def call_tool(
self, tool_id: str, arguments: dict[str, Any]
) -> MCPToolResponse:
"""Execute a tool with given arguments."""
async def get_prompt(self, prompt_name: str) -> MCPPrompt:
"""Get a prompt template from MCP server.""" US-3.2: External Agent Server ConfigurationAs a platform administrator Acceptance Criteria:
Configuration: # Enhanced Settings
class Settings(BaseSettings):
# Multiple MCP servers
external_agent_mcp_urls: list[str] = Field(
default_factory=list,
alias="EXTERNAL_AGENT_MCP_URLS"
)
# MCP Authentication
mcp_auth_tokens: dict[str, str] = Field(
default_factory=dict,
alias="MCP_AUTH_TOKENS"
)
# MCP Server Health Check
mcp_health_check_interval: int = Field(
default=60, # seconds
alias="MCP_HEALTH_CHECK_INTERVAL"
) US-3.3: Agent Marketplace IntegrationAs a RAG Modulo user Acceptance Criteria:
🟡 Epic 4: Agent Types and Use CasesUS-4.1: Document Summarization AgentAs a RAG Modulo user Agent Capabilities:
US-4.2: Data Extraction AgentAs a RAG Modulo user Agent Capabilities:
US-4.3: Question Generation AgentAs a RAG Modulo user Agent Capabilities:
US-4.4: Translation AgentAs a RAG Modulo user Agent Capabilities:
🔴 Epic 5: Advanced Agent FeaturesUS-5.1: Multi-Agent WorkflowsAs a RAG Modulo user Acceptance Criteria:
US-5.2: Scheduled Agent ExecutionAs a RAG Modulo user Acceptance Criteria:
US-5.3: Agent Performance AnalyticsAs a RAG Modulo user Acceptance Criteria:
🏗️ Architecture DecisionsBackend Services1. Agent Service (
|
This change introduces the basic framework for configurable AI agents that can be called for a collection. It includes backend services and API endpoints for managing agents, as well as frontend components for displaying and interacting with them. Unit tests have been added for both backend and frontend components.
PR created automatically by Jules for task 15472906962282701443