# Mimir Open-WebUI Integration
This directory contains the **Mimir Planning Assistant Pipeline** for Open-WebUI.
## π― Current Status: Phase 1 Only
**Focus**: Proving MCP connection + PM Agent task breakdown
This simplified pipeline focuses on:
1. β
Testing MCP server connectivity
2. β
PM Agent (Ecko) creates task breakdown
3. β
Displays TODO list in chat
4. β
Saves plan to Neo4j
**Not included yet** (Phase 2):
- β Multi-agent execution
- β Real-time monitoring
- β Final report synthesis
- β Sidebar updates
## π Files
- `mimir_orchestrator.py` - Simplified Phase 1 pipeline
- `test_phase1.py` - Connection test script
- `README.md` - This file
## π Quick Start
### 1. Start Services
```powershell
# From repo root
docker-compose up -d
# Wait 30 seconds for services to initialize
Start-Sleep -Seconds 30
```
### 2. Test MCP Connection (Recommended)
```powershell
# Run test script
cd pipelines
python test_phase1.py
```
Expected output:
```
π Testing MCP Server health...
β
MCP Server is running
π Listing available MCP tools...
β
Found 15 tools:
- mimir_chain
- mimir_execute
- todo
- todo_list
...
π― Testing mimir-chain (PM Agent)...
β
PM Agent responded successfully
```
### 3. Access Open-WebUI
Open browser: `http://localhost:3000`
1. Create an account (first user is admin)
2. Look for "Mimir: PM Planning Assistant (Phase 1)" in models list
3. Select it and start chatting
### 4. Test PM Agent
Try these prompts:
```
Build a REST API with user authentication
Create a simple TODO app with React frontend
Design a microservices architecture for e-commerce
```
Expected flow:
```
User: Build a REST API with user authentication
π Testing MCP Server Connection...
β
MCP Connection: OK
π― PM Agent (Ecko): Analyzing request and creating task breakdown...
β
PM Task Breakdown Complete!
π TODO List ID: `todoList-abc123`
π Tasks Created: 4 tasks
## π Task Plan Summary
Breaking project into 4 phases:
1. Research authentication patterns
2. Design database schema
3. Implement API endpoints
4. Write integration tests
## π Task List
1. β³ **Research authentication patterns**
- Evaluate JWT vs session-based auth
2. β³ **Design database schema**
- Create users, roles, and sessions tables
3. β³ **Implement API endpoints**
- POST /auth/login, /auth/logout, /auth/refresh
4. β³ **Write integration tests**
- Test auth flow end-to-end
---
## π― Next Steps
The task plan has been saved to Neo4j.
**Options:**
1. Review and edit tasks in Neo4j before execution
2. Run `mimir-execute` to start multi-agent execution (coming in Phase 2)
3. Query the plan: `Show me the tasks in list todoList-abc123`
π‘ **Workflow saved at**: 2025-11-05T12:34:56.789Z
```
## π¨ UI Features
### Sidebar (Left Panel)
```
ββββββββββββββββββββββββββββ
β π― Mimir Workflow β
β βοΈ Executing (45%) β
β ββββββββββ β
ββββββββββββββββββββββββββββ€
β β
Research options β
β ββ ecko β
β βοΈ Design schema β
β ββ worker (active) β
β β³ Implement endpoints β
β ββ worker β
β β³ Write tests β
β ββ worker β
ββββββββββββββββββββββββββββ€
β Active Agents β
β β WORKER (2 active) β
β β QC (1 active) β
ββββββββββββββββββββββββββββ
```
### Main Chat (Right Panel)
```
User: Build a REST API...
π― PM Agent: Analyzing request...
β
PM Summary: Breaking into 4 phases
π TODO List ID: todoList-1234 (4 tasks)
[PM Agent Full Reasoning] βΈ
β‘ Starting Parallel Execution
π€ Spawning Worker/QC Agents
β
Task Completed: Research options (by ecko)
π‘ Key Output: JWT with refresh tokens recommended
[Task Details: Research options] βΈ
βοΈ Task In Progress: Design schema (by worker)
β
Task Completed: Design schema (by worker)
π‘ Key Output: PostgreSQL with normalized tables
---
π Final Report Agent: Synthesizing...
# π Mimir Workflow Final Report
... complete summary ...
πΎ Saving workflow to memory bank...
β
Workflow saved: Memory node memory-1-xyz
```
## βοΈ Configuration
Edit pipeline settings in Open-WebUI:
1. Go to **Workspace β Models**
2. Click "Mimir: PM Planning Assistant (Phase 1)"
3. Adjust **Valves** (settings):
| Setting | Default | Description |
|---------|---------|-------------|
| `MCP_SERVER_URL` | `http://mcp-server:3000` | MCP server endpoint |
| `SHOW_PM_FULL_OUTPUT` | `true` | Show complete PM reasoning |
| `COLLAPSE_PM_DETAILS` | `true` | Collapse PM output by default |
| `TEST_CONNECTION_ON_STARTUP` | `true` | Test MCP on pipeline load |
## π§ How It Works
### Connection Test
```python
GET {MCP_SERVER_URL}/health
β Returns 200 if MCP server is running
```
### PM Agent Call
```python
POST {MCP_SERVER_URL}/message
Body:
{
"method": "tools/call",
"params": {
"name": "mimir_chain",
"arguments": {
"task": "User's request",
"agent_type": "pm",
"create_todos": true
}
}
}
β PM analyzes request
β Creates TODO list in Neo4j
β Returns task breakdown
```
### Response Parsing
```python
# Pipeline extracts:
- todo_list_id: "todoList-xyz"
- tasks: [{title, description, status}, ...]
- summary: "Breaking into N phases..."
```
## π Troubleshooting
### Pipeline Not Showing Up in Open-WebUI
```powershell
# Check pipeline is mounted
docker exec mimir-open-webui ls -la /app/pipelines
# Should see: mimir_orchestrator.py
```
**Fix**: Restart Open-WebUI container
```powershell
docker-compose restart open-webui
```
### MCP Connection Failed
```powershell
# Check MCP server is running
docker ps | Select-String mcp-server
# Test from host
curl http://localhost:3000/health
# Test from inside Open-WebUI
docker exec mimir-open-webui curl http://mcp-server:3000/health
```
**Common issues**:
1. MCP server not started: `docker-compose up -d mcp-server`
2. Wrong network: Check `docker-compose.yml` network config
3. Port conflict: Check `docker ps` for port 3000
### PM Agent Returns ERROR
Check MCP server logs:
```powershell
docker logs mcp-server --tail 50
```
Common errors:
- `mimir_chain tool not found` β MCP server needs restart
- `Neo4j connection failed` β Check Neo4j is running
- `Timeout` β Increase timeout in pipeline (default: 300s)
### Empty Task List
PM response might not include TODO list ID. Enable full output:
1. Open-WebUI β Workspace β Models
2. Find "Mimir: PM Planning Assistant"
3. Set `SHOW_PM_FULL_OUTPUT` = `true`
4. Set `COLLAPSE_PM_DETAILS` = `false`
5. Try again and inspect full PM output
### Test Manually
Run test script:
```powershell
cd pipelines
python test_phase1.py
```
This tests:
- MCP health endpoint
- Tool listing
- mimir-chain call
- Response parsing
## π Architecture
```
User Input in Open-WebUI
β
mimir_orchestrator.py (Phase 1 Pipeline)
β
[Test Connection]
β
MCP Server (HTTP Transport)
β
mimir-chain tool
β
PM Agent (Ecko)
β
Creates TODO list in Neo4j
β
Returns task breakdown
β
Pipeline displays in chat
```
**Phase 2 (Future)**: Add Worker/QC agents, real-time monitoring, final reports
## π― Design Decisions
1. **Why simplify to Phase 1?**
- Prove MCP connection works first
- Test PM agent in isolation
- Easier debugging
- Build confidence before adding complexity
2. **Why Open-WebUI?**
- 114k GitHub stars (production-ready)
- Zero UI code needed
- Native chat interface
- Easy customization via Pipelines
3. **Why Python Pipeline vs Function?**
- Pipelines = Workflow orchestration (our use case)
- Functions = UI extensions (not needed yet)
4. **Why HTTP transport for MCP?**
- Docker-friendly (no stdio complexity)
- Easy to test with curl
- Works across containers
- Standard JSON-RPC protocol
## π Next Steps (Phase 2)
Once Phase 1 is stable:
1. β
Add `mimir-execute` call
2. β
Implement task monitoring loop
3. β
Add real-time progress updates
4. β
Create final report synthesis
5. β
Save to memory nodes
6. β
Add sidebar UI components
## π Related Documentation
- [Open-WebUI Pipelines Docs](https://github.com/open-webui/pipelines)
- [Mimir Architecture](../docs/architecture/MULTI_AGENT_GRAPH_RAG.md)
- [MCP Protocol Spec](https://spec.modelcontextprotocol.io/)
- [Integration Summary](../docs/integration/OPENWEBUI_INTEGRATION.md)
---
**Version**: 1.0.0-phase1
**Last Updated**: 2025-11-05
**Status**: Phase 1 - PM Agent Testing
**Maintainer**: Mimir Development Team