Skip to content
/ kurisu Public

An AI-Native Quantitative Trading Agent & Research Platform

License

Notifications You must be signed in to change notification settings

mistbit/kurisu

Repository files navigation

Kurisu

Kurisu Logo

An AI-Native Quantitative Trading Agent & Research Platform

Status License Python TypeScript

FeaturesArchitectureGetting StartedDocumentationRoadmapContributing

中文 README


🚀 Vision

Kurisu is an open-source project designed to bridge the gap between Quantitative Finance and Modern AI Agents. It serves as:

  1. A Trading Bot: Capable of automating strategies with risk management.
  2. A Research Lab: For experimenting with LLM-based agents (ReAct, Plan-and-Solve) in financial markets.
  3. 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.

✨ Key Features

  • 🧠 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.

🏗️ Architecture

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)    │
└─────────────────────────────────────────────────────────────┘

Tech Stack

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.

📚 Documentation

🚀 Getting Started

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Bun or npm (JavaScript package manager)

Quick Start

# 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 dev

Environment Variables

Create 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

Development Mode

# 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

🗺️ Roadmap

Phase 1: Foundation (Current)

  • Project structure setup
  • Database schema design
  • Basic data ingestion (CCXT integration)
  • Simple backtesting engine
  • Basic UI dashboard

Phase 2: AI Integration

  • LLM integration (OpenAI/Anthropic/Ollama)
  • Agent chat interface
  • Market sentiment analysis
  • Strategy code generation

Phase 3: Live Execution

  • Paper trading system
  • Exchange API integration
  • Risk management module
  • Real-time monitoring

Phase 4: Advanced Agent

  • Long-term memory (RAG)
  • Multi-agent collaboration
  • Autonomous strategy optimization
  • Self-reflection and learning

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Development Guidelines

  • 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

📁 Project Structure

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

⚠️ Disclaimer

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.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


⬆ Back to Top

Made with ❤️ by the Kurisu Team

About

An AI-Native Quantitative Trading Agent & Research Platform

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors