Skip to content

Commit d6b2630

Browse files
committed
Merge branch 'feature/agent-hq' into 'develop'
Merging "agent hq" into develop See merge request genaiic-reusable-assets/engagement-artifacts/genaiic-idp-accelerator!272
2 parents 29ae0fa + cebf522 commit d6b2630

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2804
-836
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ rvl_cdip_*
2222
notebooks/examples/data
2323
.idea/
2424
.dsr/
25+
*tmp-dev-assets*

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ For detailed deployment and testing instructions, see the [Deployment Guide](./d
124124
- [Deployment](./docs/deployment.md) - Build, publish, deploy, and test instructions
125125
- [Web UI](./docs/web-ui.md) - Web interface features and usage
126126
- [Agent Analysis](./docs/agent-analysis.md) - Natural language analytics and data visualization feature
127+
- [Custom MCP Agent](./docs/custom-MCP-agent.md) - Integrating external MCP servers for custom tools and capabilities
127128
- [Configuration](./docs/configuration.md) - Configuration and customization options
128129
- [Classification](./docs/classification.md) - Customizing document classification
129130
- [Extraction](./docs/extraction.md) - Customizing information extraction

docs/agent-analysis.md

Lines changed: 68 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,69 @@ SPDX-License-Identifier: MIT-0
33

44
# Agent Analysis Feature
55

6-
The GenAIIDP solution includes an integrated Agent Analysis feature that enables you to interactively query and analyze your processed document data using natural language. This feature leverages AI agents to convert natural language questions into SQL queries, execute them against your document analytics database, and generate visualizations or tables to answer your questions.
6+
The GenAIIDP solution includes an integrated Agent Analysis feature that provides intelligent document analysis capabilities through multiple specialized AI agents. This feature enables you to interactively query and analyze your processed document data using natural language, with an intelligent orchestrator that routes queries to the most appropriate specialized agent.
77

88
## Overview
99

10-
The Agent Analysis feature provides intelligent data exploration capabilities that allow users to:
10+
The Agent Analysis feature provides intelligent data exploration and analysis capabilities through:
1111

12+
- **Multi-Agent Architecture**: Multiple specialized agents handle different types of queries
13+
- **Intelligent Orchestration**: Automatic routing of queries to the most appropriate agent
1214
- **Natural Language Querying**: Ask questions about your document data in plain English
13-
- **Automated SQL Generation**: AI agents convert your questions into optimized SQL queries
15+
- **Automated SQL Generation**: Analytics agents convert questions into optimized SQL queries
1416
- **Interactive Visualizations**: Generate charts, graphs, and tables from query results
1517
- **Real-time Analysis**: Get insights from your processed documents without manual data analysis
1618
- **Secure Code Execution**: Python visualization code runs in isolated AWS Bedrock AgentCore sandboxes
19+
- **MCP Integration**: Connect external systems and tools via Model Context Protocol (MCP) servers
1720

1821

1922
https://github.com/user-attachments/assets/e2dea2c5-5eb1-42f6-9af5-469afd2135a7
2023

2124

2225
## Key Features
2326

24-
- **Multi-Modal AI Agent**: Uses advanced language models (Claude 3.7 Sonnet by default) for intelligent query understanding
27+
- **Multi-Agent System**: Specialized agents for different types of queries (analytics, calculations, etc.)
28+
- **Intelligent Orchestration**: Automatic query routing based on content analysis and agent capabilities
29+
- **Multi-Agent Selection**: Select multiple agents simultaneously for complex analysis workflows
30+
- **MCP External Integration**: Connect custom external tools and systems via MCP servers
2531
- **Secure Architecture**: All code execution happens in AWS Bedrock AgentCore sandboxes, not in Lambda functions
26-
- **Database Schema Discovery**: Agents automatically explore and understand your database structure
32+
- **Database Schema Discovery**: Analytics agents automatically explore and understand your database structure
2733
- **Flexible Visualization**: Supports multiple chart types including bar charts, line charts, pie charts, and data tables
28-
- **Query History**: Track and manage previous analytics queries through the web interface
29-
- **Real-time Progress**: Live display of agent thought processes and SQL query execution
34+
- **Query History**: Track and manage previous questions through the web interface with agent selection memory
35+
- **Real-time Progress**: Live display of agent thought processes and execution steps
3036
- **Error Handling**: Intelligent retry logic for failed queries with automatic corrections
3137

3238
## Architecture
3339

40+
### Multi-Agent System
41+
42+
The Agent Analysis feature uses a multi-agent architecture with:
43+
44+
1. **Orchestrator Agent**: Routes queries to appropriate specialized agents based on query content and agent capabilities
45+
2. **Analytics Agent**: Handles data analysis, SQL generation, and visualization creation
46+
3. **Dummy Agent**: Provides simple calculations and development testing capabilities
47+
4. **External MCP Agents**: Custom agents connected via Model Context Protocol servers
48+
5. **Extensible Framework**: Easy addition of new specialized agents for specific use cases
49+
3450
### Agent Workflow
3551

3652
1. **Question Processing**: User submits a natural language question through the web UI
37-
2. **Database Discovery**: Agent explores database schema using `get_database_info` tool
38-
3. **SQL Generation**: Agent converts the question into optimized SQL queries with proper column quoting
39-
4. **Query Execution**: SQL queries are executed against Amazon Athena with results stored in S3
40-
5. **Data Processing**: Query results are securely transferred to AWS Bedrock AgentCore sandbox
41-
6. **Visualization Generation**: Python code generates charts or tables from the data
42-
7. **Result Display**: Final visualizations are displayed in the web interface
53+
2. **Agent Selection**: User can choose multiple specific agents or let the orchestrator decide automatically
54+
3. **Query Routing**: Orchestrator analyzes the query and routes it to the most appropriate specialized agent
55+
4. **Specialized Processing**: Selected agent processes the query using its specific tools and capabilities
56+
5. **Result Generation**: Agent generates appropriate responses (visualizations, calculations, text, etc.)
57+
6. **Result Display**: Final results are displayed in the web interface with agent conversation history
58+
59+
### Analytics Agent Workflow
60+
61+
For data analysis queries, the Analytics Agent follows this workflow:
62+
63+
1. **Database Discovery**: Agent explores database schema using `get_database_info` tool
64+
2. **SQL Generation**: Agent converts the question into optimized SQL queries with proper column quoting
65+
3. **Query Execution**: SQL queries are executed against Amazon Athena with results stored in S3
66+
4. **Data Processing**: Query results are securely transferred to AWS Bedrock AgentCore sandbox
67+
5. **Visualization Generation**: Python code generates charts or tables from the data
68+
6. **Result Display**: Final visualizations are displayed in the web interface
4369

4470
### Security Architecture
4571

@@ -95,9 +121,37 @@ The analytics agent has access to four specialized tools:
95121
### Accessing the Feature
96122

97123
1. Log in to the GenAIIDP Web UI
98-
2. Navigate to the "Document Analytics" section in the main navigation
124+
2. Navigate to the "Agent Analysis" section in the main navigation
99125
3. You'll see a chat-like interface for querying your document data
100126

127+
### Agent Selection
128+
129+
The Agent Analysis interface allows you to select from multiple available agents:
130+
131+
**Multi-Agent Selection:**
132+
- Select multiple agents simultaneously for complex analysis workflows
133+
- Use "Select All Agents" / "Deselect All Agents" for bulk selection
134+
- Each agent brings specialized capabilities to your analysis
135+
136+
**Available Agent Types:**
137+
- **Analytics Agent**: Database queries, SQL generation, and data visualization
138+
- **Dummy Agent**: Simple calculations and testing capabilities
139+
- **External MCP Agents**: Custom tools and systems integrated via MCP servers
140+
141+
**Agent Selection Tips:**
142+
- Select specific agents when you know what type of analysis you need
143+
- Choose multiple agents for comprehensive analysis requiring different capabilities
144+
- The system intelligently routes your question to the most appropriate selected agents
145+
146+
### MCP Integration
147+
148+
**Custom System Integration:**
149+
- Click "🚀 NEW: Integrate your own systems with MCP!" to learn about connecting external tools
150+
- Add custom agents without code changes or redeployments
151+
- Integrate APIs, databases, and specialized tools via Model Context Protocol servers
152+
153+
For detailed MCP setup instructions, see the [Custom MCP Agent Documentation](./custom-MCP-agent.md).
154+
101155
### Asking Questions
102156

103157
The agent can answer various types of questions about your processed documents:

0 commit comments

Comments
 (0)