Generate quantum code, inspect live IBM Quantum backends, execute circuits on real hardware, and retrieve job results through one coordinated interface.
Quick start Β· Architecture Β· Try it Β· Repositories
This repository contains the complete multi-agent system. The Quantum Lab Agent is the main entry point: it coordinates the Developer, Status, Computing, and development-stage Experiment agents through the Agent-to-Agent protocol.
Local inference uses IBM Granite 4.2 8B through Ollama by default.
Important
Full functionality requires all five agents to be running. Start the four specialized agents before the Lab Agent, or simply use ./start_all.sh.
| Agent | Responsibility | Port | Public repository |
|---|---|---|---|
| π― Quantum Lab Agent | Main orchestrator coordinating all agents | 8000 |
quantum_lab_agent |
| π» Quantum Developer Agent | Code generation specialist | 8001 |
quantum-developer-agent |
| π Quantum Status Agent | Status monitoring specialist | 8002 |
quantum-status-agent |
| β‘ Quantum Computing Agent | Circuit execution specialist | 8003 |
quantum-computing-agent |
| π§ͺ Quantum Experiment Agent (Development) | Hybrid experiment and optimization specialist | 8004 |
quantum-experiment-agent |
Grover circuit generation, coordinated execution, measurement results, and circuit visualization in Agent Stack Canvas.
End-to-end QAOA Max-Cut: exact classical validation, experiment Canvas, execution on ibm_marrakesh, tagged Job ID, and live results from 1,024 shots.
Run the QAOA Max-Cut experiment on a 5-node graph and execute the optimized circuit once on the least busy real IBM Quantum backend with 1024 shots. Always create a new job and return the backend name and Job ID.
flowchart TB
USER([User]) <-->|Request / response| LAB["Quantum Lab Agent<br/>:8000<br/><small>BeeAI orchestration Β· IBM Granite 4.2</small>"]
LAB -->|A2A| DEV["Quantum Developer Agent<br/>:8001<br/><small>QASM and Qiskit code</small>"]
LAB -->|A2A| STATUS["Quantum Status Agent<br/>:8002<br/><small>Backends and jobs</small>"]
LAB -->|A2A| COMPUTE["Quantum Computing Agent<br/>:8003<br/><small>Fresh quantum jobs</small>"]
LAB -->|A2A| EXPERIMENT["Quantum Experiment Agent<br/>:8004 Β· Development<br/><small>QAOA and VQE studies</small>"]
EXPERIMENT -.->|Delegates real execution| COMPUTE
STATUS -->|Qiskit| IBMQ["IBM Quantum Platform<br/><small>Live backends and real QPUs</small>"]
COMPUTE -->|Qiskit| IBMQ
classDef user fill:#f4f4f4,stroke:#525252,color:#161616,stroke-width:1px;
classDef orchestrator fill:#31135e,stroke:#6929c4,color:#ffffff,stroke-width:2px;
classDef agent fill:#f7f5ff,stroke:#8a3ffc,color:#161616,stroke-width:1.5px;
classDef development fill:#fff7e6,stroke:#f1c21b,color:#161616,stroke-width:1.5px,stroke-dasharray:5 4;
classDef platform fill:#001d6c,stroke:#0f62fe,color:#ffffff,stroke-width:2px;
class USER user;
class LAB orchestrator;
class DEV,STATUS,COMPUTE agent;
class EXPERIMENT development;
class IBMQ platform;
The Lab Agent combines the specialized responses into a single answer containing the generated circuit, selected backend, IBM Quantum Job ID, status, or measurement results.
| Capability | What it provides |
|---|---|
| π― Intelligent routing | Selects the correct specialized agent for each prompt |
| π» Code generation | Produces OpenQASM, Qiskit code, and common quantum algorithms |
| β‘ Real execution | Submits circuits to accessible IBM Quantum hardware |
| π Live monitoring | Retrieves backend availability, queues, job state, and results |
| πΊοΈ Backend Canvas | Shows a live topology and health dashboard for specific ibm_* backend queries |
| π Execution Canvas | Presents fresh job results, readable multi-row circuits, QASM, and local query timestamps |
| π Multi-agent workflows | Chains generation β execution β result inspection |
| π§ͺ Hybrid experiments | Runs QAOA Max-Cut optimization, exact validation, Canvas analysis, and optional QPU evaluation (development) |
| π§ Local inference | Runs IBM Granite 4.2 8B through Ollama |
- Python
3.11+ - uv
- Ollama with
granite4.2:8b - An IBM Quantum account
git clone https://github.com/BrUn3y/quantum_lab_agent.git
cd quantum_lab_agent
uv sync
ollama pull granite4.2:8bcp .env.example .envAdd your IBM Quantum token to .env. The default model configuration is:
QISKIT_IBM_TOKEN=your_ibm_quantum_token
OLLAMA_API_BASE=http://127.0.0.1:11434
LAB_MODEL=ollama:granite4.2:8b
DEVELOPER_MODEL=ollama:granite4.2:8b
STATUS_MODEL=ollama:granite4.2:8b
COMPUTING_MODEL=ollama:granite4.2:8bWatsonx remains available as an optional fallback through the WATSONX_* variables documented in .env.example.
./start_all.shOr start each service in a separate terminal:
./start_developer.sh # Port 8001
./start_status.sh # Port 8002
./start_computing.sh # Port 8003
./start_experiment.sh # Port 8004 β development
./start_lab.sh # Port 8000 β start lastThe start scripts write separate logs to .logs/. Follow every agent in one terminal:
./view_logs.shSelect one agent or print a snapshot without following new output:
./view_logs.sh lab
./view_logs.sh computing -n 200
./view_logs.sh all --no-followfor port in 8000 8001 8002 8003 8004; do
curl -fsS "http://127.0.0.1:${port}/.well-known/agent-card.json" \
| jq -r '.name'
doneAll requests enter through the Lab Agent's A2A JSON-RPC endpoint:
curl -X POST http://127.0.0.1:8000/jsonrpc/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "quantum-demo",
"method": "message/send",
"params": {
"message": {
"kind": "message",
"messageId": "11111111-1111-4111-8111-111111111111",
"role": "user",
"parts": [{
"kind": "text",
"text": "Create a Bell state and execute it once on the least busy real IBM Quantum backend."
}]
}
}
}'| Goal | Prompt |
|---|---|
| Bell state end-to-end | Create a Bell state, execute it on the local simulator with 1024 shots, and explain the results |
| Grover search | Create Grover's algorithm for 3 qubits and run it on the local simulator |
| Real QPU execution | Create a Bell state and execute it once on the least busy real IBM Quantum backend |
| List available QPUs | What quantum computers are available? |
| Inspect a backend | Give me detailed information about ibm_fez |
| DeutschβJozsa | Create and execute a Deutsch-Jozsa circuit for a balanced oracle |
| QAOA Max-Cut (development) | Use QAOA to solve Max-Cut on a 5-node graph using the local simulator |
| Explain a concept | Explain what quantum entanglement is |
| Check a job | Show me the status and results of job <job-id> |
Backend availability depends on the IBM Quantum account. The agent queries the live service and chooses among the backends actually accessible to the configured account.
Run the live suite to verify all five services, execute Bell, CX, Grover, and DeutschβJozsa circuits through the Lab β Developer β Computing flow, and validate a QAOA Max-Cut experiment through the Experiment Agent:
./test_e2e.shThe suite uses the agents already running on ports 8000β8004. If none are running, it starts all five with granite4.2:8b, waits for their agent cards, runs every circuit and experiment on local simulators, and stops only the processes it started. Logs from an automatic startup are written to .logs/e2e/.
Useful options:
./test_e2e.sh --no-start # Require an existing five-agent system
./test_e2e.sh --shots 256 # Change the number of simulator shots
./test_e2e.sh --timeout 300 # Allow slower local environmentsCustom --lab-port, --developer-port, --status-port, --computing-port, and --experiment-port options are available for isolated or parallel test environments.
| Variable | Default | Purpose |
|---|---|---|
OLLAMA_API_BASE |
http://127.0.0.1:11434 |
Ollama endpoint |
LAB_MODEL |
ollama:granite4.2:8b |
Lab orchestrator model |
DEVELOPER_MODEL |
ollama:granite4.2:8b |
Code generation model |
STATUS_MODEL |
ollama:granite4.2:8b |
Status model |
COMPUTING_MODEL |
ollama:granite4.2:8b |
Execution model |
LAB_PORT |
8000 |
Lab Agent port |
DEVELOPER_PORT |
8001 |
Developer Agent port |
STATUS_PORT |
8002 |
Status Agent port |
COMPUTING_PORT |
8003 |
Computing Agent port |
EXPERIMENT_PORT |
8004 |
Experiment Agent port (development) |
| Request | Agents involved |
|---|---|
| βGenerate a teleportation circuitβ | Developer |
| βCreate a Bell state and run itβ | Developer β Computing |
| βWhich backends are available?β | Status |
βCheck job β¦ and show its resultsβ |
Status |
| βCreate, execute, and inspect the resultβ | Developer β Computing β Status |
| βUse QAOA to solve a 5-node Max-Cut problemβ | Experiment β Computing (when QPU execution is requested) |
The included image runs the Lab Agent. Start the four specialized agents on the host, then build and run the orchestrator:
docker build -t quantum-lab-agent .
docker run --env-file .env -p 8000:8000 quantum-lab-agentThe Developer, Status, Computing, and Experiment agents must remain reachable through the host and port values configured in .env. For an all-local setup, ./start_all.sh is the recommended option.
| Problem | Check |
|---|---|
| A workflow is incomplete | Confirm that all five agent cards respond |
| Ollama cannot be reached | Run ollama list and confirm granite4.2:8b is installed |
| IBM Quantum authentication fails | Verify QISKIT_IBM_TOKEN in .env |
| A port is already occupied | Run lsof -nP -iTCP:<port> -sTCP:LISTEN |
| A named backend is unavailable | List the live backends and use one accessible to the account |
quantum_lab_agent/
βββ docs/images/quantum-lab-demo.gif
βββ docs/images/quantum-experiment-real-hardware.gif
βββ src/beeai_agents/
β βββ quantum_lab_agent.py
β βββ quantum_developer_agent.py
β βββ quantum_status_agent.py
β βββ quantum_computing_agent.py
β βββ quantum_experiment_agent.py
β βββ tools/
βββ .env.example
βββ Dockerfile
βββ start_all.sh
βββ start_lab.sh
βββ start_developer.sh
βββ start_status.sh
βββ start_computing.sh
βββ start_experiment.sh
βββ view_logs.sh
βββ pyproject.toml
| Repository | Role |
|---|---|
| Quantum Computing Agent | Circuit execution specialist |
| Quantum Status Agent | Status monitoring and job tracking |
| Quantum Developer Agent | Code generation and algorithm implementation |
| Quantum Lab Agent | Main orchestrator coordinating all agents |
| Quantum Experiment Agent | Hybrid optimization and experiment analysis (in development) |
Issues and pull requests are welcome. When changing a workflow, validate all five agent endpoints and include an end-to-end prompt test.
Built with BeeAI Framework, IBM Granite, Qiskit, and IBM Quantum.

