-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Summary
Enable users to select MCP tools at search time to generate artifacts (PowerPoint, charts, PDFs, etc.) from search results. This uses a temporal/per-request selection model - no database persistence required.
Key Design Decision: Tools are selected per-search request, not configured per-collection. This simplifies implementation and provides maximum flexibility.
Background
This issue implements a simplified approach to agentic RAG that builds on the recently merged MCP Context Forge integration (PR #684). Instead of the database-backed agent configuration described in #697, we start with temporal tool selection and can add persistence later if needed.
Why Temporal First?
| Approach | Pros | Cons |
|---|---|---|
| Temporal (this issue) | Simple, no DB changes, maximum flexibility | Users re-select tools each time |
| Persistent (#697) | "Remember my preferences" | Complex, requires DB schema, migrations |
We can add optional persistence in a future phase once the core flow is validated.
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Search Interface │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ 🔍 What were Q4 revenue projections? [Search] │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │
│ Available Tools: (live from MCP Context Forge) │
│ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
│ │ ☑️ PPT Gen │ │ ☑️ Chart │ │ ☐ PDF │ │
│ └────────────┘ └────────────┘ └────────────┘ │
└──────────────────────────┬──────────────────────────────────────┘
│
POST /api/search │ { question, collection_id,
│ selected_tools: ["ppt-gen", "chart-gen"] }
▼
┌─────────────────────────────────────────────────────────────────┐
│ SearchService │
│ 1. Core RAG pipeline → answer + sources │
│ 2. Execute selected tools (parallel) → artifacts │
│ 3. Return answer + artifacts │
└──────────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ MCP Context Forge (already integrated) │
│ Tools: ppt-generator, chart-generator, etc. │
└─────────────────────────────────────────────────────────────────┘
Implementation Tasks
Phase 1: Backend (3-4 days)
- Update
SearchInputschema to acceptselected_tools: list[str] - Create
ToolArtifactandToolExecutionschemas - Update
SearchResponseto includeartifactsandtool_executions - Create
ToolExecutorServicefor parallel tool execution - Integrate tool execution into
SearchService(after answer generation) - Add
GET /api/mcp/tools/availableendpoint for tool discovery - Unit tests for ToolExecutorService (80%+ coverage)
- Integration tests with mock MCP tools
Phase 2: Frontend (2-3 days)
- Create
ToolPickercomponent (fetches available tools, toggle selection) - Create
ArtifactPanelcomponent (display generated artifacts) - Create
ArtifactCardcomponent (preview + download button) - Integrate
ToolPickerinto search interface - Integrate
ArtifactPanelinto search results - Handle loading states and errors gracefully
- Responsive design (mobile-friendly)
Phase 3: Sample Tools (2-3 days)
- Create
ppt-generatorMCP tool for PowerPoint generation - Create
chart-generatorMCP tool for data visualization - Deploy sample tools to MCP Context Forge
- End-to-end testing with real tool invocation
- Documentation for creating custom tools
Dependencies
- PR feat(mcp): Implement MCP Gateway integration for extensibility #684 - MCP Context Forge integration (merged)
- PR feat: SPIFFE/SPIRE Integration Architecture for Agent Identity #695 - SPIFFE/SPIRE agent identity (merged)
Related Issues
- Epic: [EPIC] Future: Agentic AI Platform v2 (Phase 4) #691 - Agentic AI Platform v2
- Supersedes parts of: feat: Implement SearchService 3-stage agent execution hooks #697 (agent hooks - simplified to temporal)
- Defers: feat: Expose RAG Modulo as MCP Server #698 (MCP server exposure - future phase)
- Simplifies: feat: Agentic UI components for agent configuration and artifacts #699 (UI - focused on tool picker + artifacts only)
Acceptance Criteria
- User can see available MCP tools in search interface
- User can select one or more tools before searching
- Search executes normally, then runs selected tools
- Generated artifacts appear in search results
- User can download artifacts (PowerPoint, charts, etc.)
- Tool failures don't break search (graceful degradation)
- Tool execution is parallel (performance)
- Works on desktop and mobile
Future Enhancements (Not in Scope)
These can be added in future issues:
- Optional persistence of tool preferences per collection
- Tool categories in UI
- Tool-specific configuration options
- Pre-search and post-search agent stages (feat: Implement SearchService 3-stage agent execution hooks #697)
- Expose RAG Modulo as MCP server (feat: Expose RAG Modulo as MCP Server #698)
References
- Planning doc:
docs/planning/agentic-rag-implementation-plan.md - MCP integration:
docs/features/mcp-integration.md - Architecture:
docs/architecture/search-agent-hooks-architecture.md