# Repository Briefing: HKUDS/Vibe-Trading
> Source: https://repoforai.com/repo/HKUDS/Vibe-Trading (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/HKUDS/Vibe-Trading
- **Official Docs / Website**: https://vibetrading.wiki/
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (100/100 · Maintenance 35/35 · Adoption 25/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.1.20 (2026-12-02) — https://github.com/HKUDS/Vibe-Trading/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, CLI, MCP, API
- **Momentum**: 39,577 ★ total (+25 24h / +490 7d) · 6,435 forks
- **Topics**: `ai-agent`, `algorithmic-trading`, `backtesting`, `fintech`, `llm`, `mcp`, `multi-agent`, `python`, `quantitative-finance`, `trading`
- **When to Use**: Best for: Researchers and small teams that want to turn natural-language questions into evidence-linked reports, inspectable backtests, and paper portfolios before considering live orders. Skip if: You only need a deterministic backtest runner, require an end-to-end offline workflow without first validating every dependency, or need production order execution on a broker whose permissions have not been verified.

## Overview
```text
### Architecture & Core Mechanics
Vibe-Trading is a Python 3.11+ research agent with a web interface and CLI. Its manifest lists LangChain, LangChain Core, LangChain OpenAI, LangGraph, and LangGraph Checkpoint; the tree separates `agent/` from `frontend/`. A backtest request moves from interpreting the strategy and benchmark to fetching historical bars and running the strategy. The run directory preserves the strategy, trades, and equity curve, allowing a reviewer to inspect the work rather than rely on the generated summary.

In v0.1.20 the session kernel replays an append-only `thread.jsonl` so that a follow-up can see prior tool calls and results. Messages arriving during execution queue instead of being rejected; sessions can be forked, compacted on demand, or assigned their own model. This working state is distinct from versioned research artifacts, which preserve conclusions and evidence for comparison over time. REST supports workflows such as Alpha Zoo, while MCP exposes callable tools such as `portfolio_risk_xray`.

### Key Capabilities & Differentiators
The workflow spans SEC filing excerpts with original links, uploaded documents, factor research, strategy backtests, and paper portfolios. Alpha Zoo can benchmark libraries such as Alpha101 and GTJA across horizons; Research Lab adds cost and walk-forward studies to completed runs. Backtests can model A-share price limits, crypto funding, or futures margin. Options Lab adds multi-leg payoff analysis, Greeks, implied-volatility surfaces, and strategy comparison.

The loader supports 27 market-data sources. In automatic mode it chooses a fallback chain by market; during backtests it retries only symbols left without bars after validation and aggregation. Explicit `local` sources and `local:` symbols never fall back to the network. Paper trading tracks fills and NAV separately from live execution, which requires a supported broker and an authorized, stoppable mandate. Connector count is not execution coverage: OpenAlgo is the 20th connector and is read-only.

### Trade-offs & Limitations
Compared with a standalone backtester, Vibe-Trading reduces the handoffs between research, code execution, validation, and follow-up. The cost is a larger reproducibility surface: prompt interpretation, model choice, data routing, and engine changes can all affect comparisons. Pin the strategy, data source and date range, and application version for a repeatable study. Unlike a broker-first terminal, the agent is most useful as a research and simulation workspace; live use calls for separate verification of connector permissions and mandate limits.

Risk X-Ray illustrates why output semantics matter. Its drawdowns describe a constant-weight return model, not account NAV or strategy P&L; for backtests it uses average executed basket weights and excludes fees and cash flows. Missing interior returns or invalid model wealth make drawdown periods unavailable rather than indicating zero risk. Also, v0.1.20 no longer rewrites or redacts answers through the grounding gate. Evidence references and saved run artifacts remain useful for review, but are not a substitute for checking conclusions before acting on them.

### Hardware & Deployment Guide
For a direct install, use Python 3.11+, `pip install vibe-trading-ai`, `vibe-trading init`, then `vibe-trading`. Compose builds from the repository, reads `agent/.env`, binds `127.0.0.1:8899` on the host, and mounts the `vibe-runs` volume at `/app/agent/runs`. Its host-side Ollama default is `http://host.docker.internal:11434`, overridable with `OLLAMA_BASE_URL`; the supplied Linux host-gateway mapping requires Docker Engine 20.10+ and Compose v2.

With a remote model endpoint, size the application host for backtests, history storage, and concurrent jobs. With Ollama, budget inference resources separately based on the selected model and concurrency; there is no fixed VRAM figure. Local bars can keep backtest data loading off the network, but the model and other tools still determine whether the full workflow is offline. For v0.1.20, back up `~/.vibe-trading/sessions` before first start and rebaseline affected benchmark, RSI/Bollinger, and Alpha Zoo comparisons; v0.1.19 introduced versioned research artifacts.
```

## Key Capabilities
```text
- Session kernel: v0.1.20 uses one append-only `thread.jsonl` per session, with replay, queued messages, forks, compaction, and per-session model selection.
- Data provenance: 27 market-data sources with market-specific fallback; explicit `local` sources and `local:` symbols never fall back to the network.
- Backtest validation: Run Detail exposes trades and equity curves; Research Lab adds transaction-cost and walk-forward studies to completed runs.
- Portfolio diagnostics: Risk X-Ray exports `artifacts/risk_xray.json` and `artifacts/risk_xray.md` and exposes the analysis through `portfolio_risk_xray` over MCP.
- Research revisions: Saved conclusions retain evidence references; users can compare revisions and export a full series or a selected comparison as JSON or Markdown.
- Execution permissions: Paper portfolios are separate from mandate-bound live orders; connector coverage does not imply order placement, as shown by read-only OpenAlgo.
```

## Quick Start / Clone
```bash
pip install vibe-trading-ai
vibe-trading init
vibe-trading
```
