An AI-Native Quantitative Trading Agent & Research Platform
Features • Architecture • Getting Started • Documentation • Roadmap • Contributing
Kurisu is an open-source project designed to bridge the gap between Quantitative Finance and Modern AI Agents. It serves as:
- A Trading Bot: Capable of automating strategies with risk management.
- A Research Lab: For experimenting with LLM-based agents (ReAct, Plan-and-Solve) in financial markets.
- A Learning Platform: Helping developers and traders understand the math and code behind strategies.
Note: This project is currently in the initial design and development phase. The codebase is being actively developed.
- 🧠 Cognitive AI Agent: Built on LangGraph, the agent can plan, use tools, and "think" before trading. It explains why it made a decision.
- 📊 Modular Strategy Engine: Write strategies in Python or let the AI generate them. Supports event-driven backtesting.
- 📈 Modern Dashboard: A beautiful, responsive UI built with Next.js and ShadcnUI for real-time monitoring and backtest visualization.
- ⚡ High Performance: Powered by FastAPI (Async Python) and TimescaleDB for efficient time-series data handling.
- 🛡️ Risk Management: Built-in paper trading mode, hard stops, and position limits.
Kurisu follows a Microservices-ready Monolith architecture:
┌─────────────────────────────────────────────────────────────┐
│ Frontend (Next.js) │
│ Dashboard │ Agent Chat │ Backtest Lab │ Strategy Editor │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Backend (FastAPI) │
├─────────────────────────────────────────────────────────────┤
│ API Gateway │ Auth │ WebSocket Server │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Quant Engine│ │ AI Agent │ │ Execution Service │ │
│ │ - Strategies│ │ - LangGraph │ │ - Paper Trading │ │
│ │ - Backtest │ │ - Memory │ │ - Live Trading │ │
│ │ - Indicators│ │ - Tools │ │ - Risk Management │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Data Layer │
│ PostgreSQL + TimescaleDB │ Redis │ Vector DB (pgvector) │
└─────────────────────────────────────────────────────────────┘
| Component | Technology | Purpose |
|---|---|---|
| Frontend | Next.js, TypeScript, Tailwind CSS, ShadcnUI | Modern responsive UI |
| Backend | FastAPI (Python 3.10+), Celery | Async API & task processing |
| AI Framework | LangChain, LangGraph | Agent orchestration |
| Database | PostgreSQL + TimescaleDB | Time-series market data |
| Vector Store | pgvector / ChromaDB | AI memory (RAG) |
| Cache | Redis | Real-time data & task queue |
| Exchange API | CCXT | Multi-exchange support |
See Architecture Design for details.
- Requirements Document - Project goals and feature specifications
- Architecture Design - System architecture and module design
- Tech Stack Rationale - Technology choices and rationale
- Agent Architecture - Deep dive into AI agent design
- Python 3.10+
- Node.js 18+
- Bun or npm (JavaScript package manager)
# Clone the repository
git clone https://github.com/yourusername/kurisu.git
cd kurisu
# Backend setup
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Configure environment
cp .env.example .env
${EDITOR:-nano} .env
# Run backend
uvicorn app.main:app --reload
# Frontend setup (in a new terminal)
cd ../frontend
npm install
npm run devCreate a .env file in the backend/ directory:
# Database
POSTGRES_SERVER=pgm-xxxx.pg.rds.aliyuncs.com
POSTGRES_PORT=5432
POSTGRES_USER=your_user
POSTGRES_PASSWORD=your_password
POSTGRES_DB=kurisu
DB_POOL_PRE_PING=true
DB_POOL_RECYCLE_SECONDS=1800
# Redis
REDIS_HOST=r-xxxx.redis.rds.aliyuncs.com
REDIS_PORT=6379
REDIS_PASSWORD=your_password
REDIS_DB=0
REDIS_SOCKET_CONNECT_TIMEOUT=5
REDIS_SOCKET_TIMEOUT=5
# LLM API Keys (choose one or more)
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
# Exchange API Keys (for live trading)
BINANCE_API_KEY=your_binance_key
BINANCE_API_SECRET=your_binance_secret# Run backend in development mode with hot reload
cd backend
source venv/bin/activate
uvicorn app.main:app --reload
# Run frontend in development mode
cd ../frontend
npm run dev
# Run tests
cd ../backend
source venv/bin/activate
pytest
cd ../frontend
npm run test- Project structure setup
- Database schema design
- Basic data ingestion (CCXT integration)
- Simple backtesting engine
- Basic UI dashboard
- LLM integration (OpenAI/Anthropic/Ollama)
- Agent chat interface
- Market sentiment analysis
- Strategy code generation
- Paper trading system
- Exchange API integration
- Risk management module
- Real-time monitoring
- Long-term memory (RAG)
- Multi-agent collaboration
- Autonomous strategy optimization
- Self-reflection and learning
We welcome contributions! Please see CONTRIBUTING.md for details.
- Follow the code style guidelines (Black for Python, Prettier for TypeScript)
- Write meaningful commit messages following Conventional Commits
- Add tests for new features
- Update documentation for API changes
Note: The project is currently in the design phase. The following structure will be implemented during development.
kurisu/
├── frontend/ # Next.js Application
│ ├── app/ # App router pages
│ ├── components/ # React components
│ ├── lib/ # Utilities and hooks
│ └── public/ # Static assets
├── backend/ # FastAPI Application
│ ├── app/
│ │ ├── api/ # API Routes (v1)
│ │ ├── core/ # Config, Security, DB Connections
│ │ ├── services/ # Business Logic (MarketData, TradeExec)
│ │ ├── agents/ # AI Agent Logic (Prompts, Tools, Memory)
│ │ ├── strategies/ # Strategy Implementations
│ │ └── models/ # Pydantic & SQL Models
│ └── tests/
├── docs/ # Documentation
├── docker-compose.yml # Container orchestration
└── README.md
This software is for educational and research purposes only. Do not use it for live trading unless you fully understand the risks. The authors are not responsible for any financial losses incurred.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by the Kurisu Team