Kalshi multi-agent trading desk — Google ADK + Gemini with quant, risk, execution, and sentiment agents. Public market data out of the box; optional authenticated trading via the Kalshi SDK.
Architecture · Design · Web UI · ADK docs
Requirements: Python 3.10+, Node 20+, a Google AI Studio API key.
git clone https://github.com/JasonMun7/ProbDesk.git
cd ProbDesk
./scripts/setup.shEdit .env at the repo root and set GOOGLE_API_KEY, then:
cd ui && npm run dev| Service | URL |
|---|---|
| Web desk | http://localhost:3000 |
| Agent (AG-UI) | http://127.0.0.1:8000 |
The setup script installs pip install -e ".[ui]", copies .env.example → .env if needed, and runs npm install under ui/.
prob-desk web # same as cd ui && npm run dev| Area | What you get |
|---|---|
| CopilotKit desk | Chat with the trading_director ADK agent; tool calls stream in the sidebar |
| Generative panels | Kalshi search, order book, portfolio, and trade receipts render in the center panel |
| HITL trading | approve_kalshi_order — Approve / Deny in chat before execution |
| Chat welcome | Starter suggestions and follow-ups tuned to desk workflows |
| Thread history | New chat, switch threads, delete — persisted in the browser |
| Get Started | Onboarding modal for first-time setup |
| Settings | Kalshi API, Google key, and AgentPhone status (reads repo-root .env + local desk settings) |
| Help | ? in the desk header — shortcuts and demo prompts |
Public search and order books work against the demo API without keys. For portfolio, orders, and live execution, create demo API credentials and add them to .env.
| Step | Action |
|---|---|
| 1 | Follow the Kalshi demo setup walkthrough (Google Slides) |
| 2 | Save your RSA private key as secrets/kalshi/private_key.pem (see secrets/kalshi/README.md) |
| 3 | Set KALSHI_API_KEY_ID, KALSHI_PRIVATE_KEY_PATH, and keep KALSHI_TRADE_API_BASE on the demo host |
| 4 | Restart the agent (cd ui && npm run dev) and confirm Settings → Kalshi API → Connected |
Voice / SMS via AgentPhone MCP tools on the trading director.
| Config | Where |
|---|---|
AGENTPHONE_API_KEY |
.env at repo root |
Agent ID (agt_…) |
Settings → AgentPhone (saved under .prob-desk/desk-settings.json, gitignored) |
Use the Kalshi demo setup slides for demo API keys before wiring AgentPhone flows in the desk.
Copy .env.example → .env at the repo root (the Next.js app loads this file automatically).
| Variable | Required | Purpose |
|---|---|---|
GOOGLE_API_KEY |
Yes | Gemini via ADK |
GOOGLE_GENAI_USE_VERTEXAI |
— | Keep false for AI Studio |
KALSHI_API_KEY_ID |
For trading / portfolio | Authenticated Kalshi SDK |
KALSHI_PRIVATE_KEY_PATH |
For trading / portfolio | Path to RSA PEM (see secrets/kalshi/) |
KALSHI_TRADE_API_BASE |
— | Demo vs production API host |
AGENTPHONE_API_KEY |
No | AgentPhone MCP |
AGENTPHONE_AGENT_ID |
No | Optional in .env; prefer Settings UI |
PROB_DESK_AGUI_URL |
No | Override AG-UI URL (default http://127.0.0.1:8000/) |
| Mode | Command | Use when |
|---|---|---|
| Web desk | cd ui && npm run dev or prob-desk web |
Primary UI — chat, generative panels, trade approval |
| AG-UI only | prob-desk serve |
Backend API for the UI (port 8000) |
| Terminal REPL | prob-desk |
Quick prompts without the browser |
| ADK Web | prob-desk adk or ./scripts/run-adk-web.sh |
Stock Google ADK dev UI (port 8501, not 8000) |
Do not run ADK Web and the CopilotKit AG-UI server on the same port. Default layout: AG-UI on 8000, ADK Web on 8501.
More UI detail: ui/README.md.
Use market KXPGATOUR-PGC26-SSCH (Scottie Scheffler PGA) in chat:
- Order book —
Show the orderbook for KXPGATOUR-PGC26-SSCH - ~$1 yes buy — ask to spend about $1 on yes, use the book for price/size,
approve_kalshi_orderin chat, thenkalshi_sdk_create_orderafter approval - Risk —
For KXPGATOUR-PGC26-SSCH, check my portfolio and transfer_to_agent(agent_name='risk_manager') for a short risk summary
Trade flow: request in chat → Approve / Deny in the sidebar → executed trade receipt in the center panel.
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[ui]"
cp .env.example .env
cd ui && npm install && npm run devConda alternative: conda env create -f environment.yml && conda activate prob-desk.
pip install -e .
pip install pytest
pytest tests/ -vProbDesk/
├── prob_desk/ # ADK agents, Kalshi tools, AG-UI server
├── ui/ # Next.js + CopilotKit web desk
├── docs/readme-logo.png # README header logo
├── ui/public/brand/ # Web UI logo assets
├── scripts/setup.sh # One-shot local setup
├── .env.example
└── DESIGN.md
| Topic | Doc |
|---|---|
| Agent graph & tools | docs/adk-agents-architecture.md |
| Execution RL scripts | docs/tactical-policy-cli-scripts.md |
MIT — see pyproject.toml.