-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArchitecture_Flowchart.txt
More file actions
139 lines (120 loc) · 10.2 KB
/
Architecture_Flowchart.txt
File metadata and controls
139 lines (120 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
Architecture Flowchart
=====================================
┌─────────────────────────────────────────────────────────────────────────────────┐
│ CLIENT (React App) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ AgentManager │ │ Chat Interface│ │ AgentCardModal │ │
│ │ │ │ │ │ │ │
│ │ • Agent Discovery│ │ • Message Display│ │ • Agent Details │ │
│ │ • Registration │ │ • User Input │ │ • Skills View │ │
│ │ • A2AClient │ │ • Streaming │ │ • Capabilities │ │
│ │ • Card Fetching │ │ • File Downloads│ │ • Examples │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────┬─────────────────────────────────────────────────────────┘
│ HTTP Requests (Registration & Routing)
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ ROUTING SERVICE (Port 3000) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ /register │ │ /route │ │ /stream-fallback│ │
│ │ │ │ │ │ │ │
│ │ • Agent Registry│ │ • AI-Powered │ │ • LLM Fallback │ │
│ │ • Skills Storage│ │ Routing │ │ • Gemini API │ │
│ │ • Tags Index │ │ • Agent Selection│ │ • Streaming │ │
│ │ • Capabilities │ │ • Fallback Logic│ │ • Context Mgmt │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────┬─────────────────────────────────────────────────────────┘
│ Routes to Selected Agent
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ AGENTS ECOSYSTEM │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ CODER AGENT │ │ YOUTUBE/IMAGE │ │ AUDIO/DOCUMENT │ │
│ │ (Port 3002) │ │ (Port 3003) │ │ (Port 3004) │ │
│ │ │ │ │ │ │ │
│ │ • Code Generation│ │ • YouTube API │ │ • Audio Generation│ │
│ │ • File Streaming│ │ • DALL-E Images │ │ • Document Retrieval│ │
│ │ • Genkit AI │ │ • Video Embed │ │ • MCP Tools │ │
│ │ • Artifact Updates│ │ • Image Display │ │ • Tavily Search │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ EXA MCP │ │ MCP SERVER │ │
│ │ (Port 3005) │ │ (Port 3001) │ │
│ │ │ │ │ │
│ │ • Web Search │ │ • Audio Tools │ │
│ │ • Exa API │ │ • Document Tools│ │
│ │ • MCP Protocol │ │ • Static Files │ │
│ │ • Tool Selection│ │ • File Serving │ │
│ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ EXTERNAL SERVICES │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Google AI │ │ OpenAI API │ │ YouTube API │ │
│ │ (Gemini) │ │ (DALL-E) │ │ (Search) │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Exa API │ │ Tavily API │ │ Google TTS │ │
│ │ (Web Search) │ │ (Documents) │ │ (Audio) │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘
Detailed Data Flow Process
==========================
1. Agent Registration Flow:
Agent Startup → Fetch Agent Card → Register with Routing Service → Available for Routing
2. Message Processing Flow:
User Input → Route Decision (AI) → Selected Agent → Task Execution → Streaming Response → Client Display
3. Fallback Flow:
No Agent Match → LLM Fallback → Gemini API → Streaming Response → Client Display
Key Components
==============
Client Side:
- AgentManager: Discovers agents, fetches cards, manages connections
- Chat Interface: Handles user input, message display, file downloads
- AgentCardModal: Shows agent details, skills, and capabilities
Server Side:
- Routing Service: AI-powered agent selection using Gemini
- Individual Agents: Specialized task processors with streaming
- MCP Server: Tool integration and static file serving
Agent Types & Capabilities:
===========================
1. Coder Agent (Port 3002):
- Code generation with file streaming
- Artifact updates for multiple files
- Genkit AI integration
2. YouTube/Image Agent (Port 3003):
- YouTube video search and embedding
- DALL-E image generation
- Multimedia content display
3. Audio/Document Agent (Port 3004):
- Text-to-speech with Google TTS
- Document retrieval with Tavily
- MCP tool integration
4. Exa MCP Agent (Port 3005):
- Web search with Exa API
- MCP protocol implementation
- Tool selection logic
5. MCP Server (Port 3001):
- Audio and document tools
- Static file serving
- MP3 file hosting
Communication Patterns
======================
- HTTP REST APIs for agent communication
- Server-Sent Events (SSE) for streaming responses
- MCP Protocol for tool integration
- A2A SDK for standardized agent communication
- Real-time streaming for live updates
Key Features
============
- AI-Powered Routing: Uses Gemini to select the best agent
- Streaming Responses: Real-time message updates
- File Artifacts: Code files, images, audio files
- Fallback System: LLM fallback when no agent matches
- Context Management: Conversation history tracking
- Tool Integration: MCP protocol for extensible tools
This architecture provides a flexible, scalable system where specialized agents can be easily added and the routing service intelligently directs requests based on user intent.