https://github.com/mikko-lab/qubit-harness
LangGraph-based agentic harness for qubit calibration — portfolio demo
https://github.com/mikko-lab/qubit-harness
agentic ai-safety anthropic claude langfuse langgraph llm pydantic python
Last synced: about 1 month ago
JSON representation
LangGraph-based agentic harness for qubit calibration — portfolio demo
- Host: GitHub
- URL: https://github.com/mikko-lab/qubit-harness
- Owner: mikko-lab
- License: mit
- Created: 2026-05-24T12:04:10.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-07-04T12:25:35.000Z (about 1 month ago)
- Last Synced: 2026-07-04T14:13:28.647Z (about 1 month ago)
- Topics: agentic, ai-safety, anthropic, claude, langfuse, langgraph, llm, pydantic, python
- Language: Python
- Size: 136 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qubit-harness
[](https://github.com/mikko-lab/qubit-harness/actions/workflows/ci.yml)
[](LICENSE)
A LangGraph-based agentic harness that calibrates a simulated qubit. Built as a portfolio demo for agentic systems work — the same closed-loop pattern applies to real hardware.
## Architecture
The agent proposes; the harness decides whether the proposal is safe to execute.
```
┌─────────────────────────────────────────────┐
│ LangGraph loop │
│ │
│ ┌──────────────┐ ┌──────────────────┐ │
│ │ propose │────▶│ execute │ │
│ │ (Claude) │ │ (harness) │ │
│ └──────────────┘ └────────┬─────────┘ │
│ ▲ │ │
│ │ ┌────────▼─────────┐ │
│ │ │ analyze │ │
│ loop │ │ (update best) │ │
│ │ └────────┬─────────┘ │
│ │ │ │
│ │ ┌────────▼─────────┐ │
│ └────────────│ decide_next │ │
│ │ budget? done? │──▶ END
│ └──────────────────┘ │
└─────────────────────────────────────────────┘
Harness layer (deterministic):
• amplitude bounds [0.0, 1.0]
• rate limit 100 ms between calls
• session budget (default 15)
```
The harness layer is plain Python — no LLM judgement on safety checks. Langfuse traces every LLM call and tool invocation.
## Install
```bash
git clone https://github.com/mikko-lab/qubit-harness
cd qubit-harness
uv sync
cp .env.example .env # add ANTHROPIC_API_KEY
```
## Run
```bash
uv run python -m qubit_harness.main
uv run python -m qubit_harness.main --budget 10 --no-trace
uv run python -m qubit_harness.main --budget 5 --seed 42
```
`--seed` pins the simulator's measurement noise: the same seed gives the same noise draw for a given amplitude sequence. It does not make a full run deterministic — the agent's amplitude proposals come from the LLM and remain non-deterministic.
Example output:
```
Starting calibration budget=5 trace=off
── Calibration complete ──────────────────────────────
Best amplitude : 0.7500
Best fidelity : 1.0000
Measurements used: 3
Budget remaining : 2
──────────────────────────────────────────────────────
```
## Tests
```bash
uv run pytest
uv run mypy src/
uv run ruff check src/
```
## Natural extensions
**GraphRAG** — store measurement history in a graph database; let the agent query similar past calibrations across qubit instances.
**MCP server** — expose the harness as an MCP tool so any MCP-compatible agent can drive calibration without custom integration code.