Skip to content

Commit 8ea59c6

Browse files
authored
Merge pull request opea-project#56 from cld2labs/cld2labs/MultiAgentQnA
cld2labs/MultiAgentQnA
2 parents 54dcf7f + 20faa02 commit 8ea59c6

31 files changed

Lines changed: 3331 additions & 0 deletions
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
env/
8+
venv/
9+
ENV/
10+
build/
11+
develop-eggs/
12+
dist/
13+
downloads/
14+
eggs/
15+
.eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
wheels/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
*.log
26+
27+
# Node
28+
node_modules/
29+
npm-debug.log*
30+
yarn-debug.log*
31+
yarn-error.log*
32+
.pnpm-debug.log*
33+
package-lock.json
34+
dist/
35+
.cache/
36+
37+
# Environment
38+
.env
39+
.env.local
40+
.env.*.local
41+
42+
# IDEs
43+
.vscode/
44+
.idea/
45+
*.swp
46+
*.swo
47+
*~
48+
49+
# OS
50+
.DS_Store
51+
Thumbs.db
52+
53+
# Build
54+
build/
55+
*.so
56+
57+
# Testing
58+
.coverage
59+
.pytest_cache/
60+
htmlcov/
61+
62+
# Application specific
63+
rag_index/
64+
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# Quick Start Guide
2+
3+
Get up and running with the Multi-Agent Q&A application in 5 minutes!
4+
5+
## Prerequisites
6+
7+
- Docker and Docker Compose installed
8+
- Valid enterprise-inference API credentials
9+
10+
## Step-by-Step Setup
11+
12+
### 1. Configure Environment Variables
13+
14+
Create the API environment file:
15+
16+
```bash
17+
cd MultiAgentQnA
18+
cp api/env.example api/.env
19+
```
20+
21+
Edit `api/.env` with your credentials:
22+
23+
```env
24+
BASE_URL=https://your-enterprise-inference-url.com
25+
KEYCLOAK_CLIENT_ID=your_client_id
26+
KEYCLOAK_CLIENT_SECRET=your_client_secret
27+
EMBEDDING_MODEL_ENDPOINT=bge-base-en-v1.5
28+
INFERENCE_MODEL_ENDPOINT=Llama-3.1-8B-Instruct
29+
EMBEDDING_MODEL_NAME=bge-base-en-v1.5
30+
INFERENCE_MODEL_NAME=meta-llama/Llama-3.1-8B-Instruct
31+
```
32+
33+
### 2. Start with Docker Compose
34+
35+
```bash
36+
cd MultiAgentQnA
37+
docker-compose up --build
38+
```
39+
40+
Wait for both services to start:
41+
- Backend API on http://localhost:5001
42+
- Frontend UI on http://localhost:3000
43+
44+
### 3. Access the Application
45+
46+
Open your browser and navigate to:
47+
48+
```
49+
http://localhost:3000
50+
```
51+
52+
You should see the Multi-Agent Q&A interface!
53+
54+
## Alternative: Local Development
55+
56+
### Backend
57+
58+
```bash
59+
cd MultiAgentQnA/api
60+
61+
# Create virtual environment (recommended)
62+
python -m venv venv
63+
source venv/bin/activate # On Windows: venv\Scripts\activate
64+
65+
# Install dependencies
66+
pip install -r requirements.txt
67+
68+
# Run the server
69+
uvicorn server:app --reload --host 0.0.0.0 --port 5001
70+
```
71+
72+
### Frontend
73+
74+
```bash
75+
cd MultiAgentQnA/ui
76+
77+
# Install dependencies
78+
npm install
79+
80+
# Run development server
81+
npm run dev
82+
```
83+
84+
## Testing the Application
85+
86+
### Test the Chat Interface
87+
88+
1. Navigate to the Chat page
89+
2. Type a question, for example:
90+
- **Code**: "How do I create a Python function?"
91+
- **RAG**: "Find information about machine learning"
92+
- **General**: "What is the weather like?"
93+
94+
3. The system will automatically route your question to the appropriate agent
95+
96+
### Test the Settings
97+
98+
1. Click on "Settings" in the header
99+
2. Modify agent configurations:
100+
- Change roles, goals, or backstories
101+
- Adjust max iterations
102+
- Toggle verbose mode
103+
3. Click "Save Configuration"
104+
4. Test with new questions
105+
106+
## Verify Everything Works
107+
108+
### Check API Health
109+
110+
```bash
111+
curl http://localhost:5001/health
112+
```
113+
114+
Expected response:
115+
```json
116+
{
117+
"status": "healthy",
118+
"api_configured": true
119+
}
120+
```
121+
122+
### Test Chat Endpoint
123+
124+
```bash
125+
curl -X POST http://localhost:5001/chat \
126+
-H "Content-Type: application/json" \
127+
-d '{"message": "Hello!"}'
128+
```
129+
130+
Expected response:
131+
```json
132+
{
133+
"response": "Response from agent...",
134+
"agent": "normal_agent"
135+
}
136+
```
137+
138+
## Common First-Time Issues
139+
140+
### Port Already in Use
141+
142+
**Error**: `Address already in use`
143+
144+
**Solution**:
145+
```bash
146+
# Find and kill process on port 5001
147+
lsof -ti:5001 | xargs kill -9
148+
149+
# Find and kill process on port 3000
150+
lsof -ti:3000 | xargs kill -9
151+
152+
# Or change ports in docker-compose.yml
153+
```
154+
155+
### Cannot Connect to Enterprise API
156+
157+
**Error**: `Authentication failed`
158+
159+
**Solution**:
160+
1. Double-check your `.env` credentials
161+
2. Verify BASE_URL is correct
162+
3. Ensure network access to enterprise-inference API
163+
164+
### UI Shows "Failed to get response"
165+
166+
**Solution**:
167+
1. Check backend logs: `docker logs multiagent-qna-backend`
168+
2. Verify API is running: `curl http://localhost:5001/health`
169+
3. Check browser console for errors
170+
171+
## Next Steps
172+
173+
- Read the [README.md](README.md) for detailed documentation
174+
- Check [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for more help
175+
- Customize agent configurations in the Settings page
176+
- Integrate with your own knowledge bases or APIs
177+
178+
## Architecture Overview
179+
180+
```
181+
User Query
182+
183+
Orchestration Agent (routes to appropriate specialist)
184+
185+
┌─────────────────────────────────────────┐
186+
│ │
187+
├─ Code Agent ─── For programming Q&A │
188+
├─ RAG Agent ──── For document retrieval │
189+
└─ Normal Agent ── For general questions │
190+
```
191+
192+
The system automatically detects query type and routes to the best agent!
193+
194+
## Need Help?
195+
196+
- Check logs: `docker logs multiagent-qna-backend`
197+
- Review [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
198+
- Verify environment variables are set correctly
199+
200+
Happy chatting! 🚀
201+

0 commit comments

Comments
 (0)