Commit Graph

45 Commits

Author SHA1 Message Date
20506a379d docs: rewrite README for API-first architecture
Complete rewrite of README.md to reflect the new REST API service
architecture and remove batch mode references.

Changes:
- Focus on REST API deployment and usage
- Updated architecture diagram showing FastAPI → Worker → Database flow
- Comprehensive API endpoint documentation with examples
- Docker-first quick start guide
- Integration examples (Windmill.dev, Python client)
- Database schema documentation
- Simplified configuration guide
- Updated project structure
- Removed batch mode references
- Removed web UI mentions

The new README positions AI-Trader as an API service for autonomous
trading simulations, not a standalone batch application.

Key additions:
- Complete API reference (/trigger, /status, /results, /health)
- Integration patterns for external orchestration
- Database querying examples
- Testing and validation procedures
- Production deployment guidance
2025-10-31 14:57:29 -04:00
d587a5f213 refactor: remove unnecessary MCP service port configuration
MCP services are completely internal to the container and accessed
only via localhost. They should not be configurable or exposed.

Changes:
- Remove MATH_HTTP_PORT, SEARCH_HTTP_PORT, TRADE_HTTP_PORT,
  GETPRICE_HTTP_PORT from docker-compose.yml environment
- Remove MCP service port mappings from docker-compose.yml
- Remove MCP port configuration from .env.example
- Update README.md to remove MCP port configuration
- Update CLAUDE.md to clarify MCP services use fixed internal ports
- Update CHANGELOG.md with these simplifications

Technical details:
- MCP services hardcode to ports 8000-8003 via os.getenv() defaults
- Services only accessed via localhost URLs within container:
  - http://localhost:8000/mcp (math)
  - http://localhost:8001/mcp (search)
  - http://localhost:8002/mcp (trade)
  - http://localhost:8003/mcp (price)
- No external access needed or desired for these services
- Only API (8080) and web dashboard (8888) should be exposed

Benefits:
- Simpler configuration (4 fewer environment variables)
- Reduced attack surface (4 fewer exposed ports)
- Clearer architecture (internal vs external services)
- Prevents accidental misconfiguration of internal services
2025-10-31 14:41:07 -04:00
849e7bffa2 refactor: remove unnecessary RUNTIME_ENV_PATH environment variable
Simplifies deployment configuration by removing the RUNTIME_ENV_PATH
environment variable, which is no longer needed for API mode.

Changes:
- Remove RUNTIME_ENV_PATH from docker-compose.yml
- Remove RUNTIME_ENV_PATH from .env.example
- Update CLAUDE.md to reflect API-managed runtime configs
- Update README.md to remove RUNTIME_ENV_PATH from config examples
- Update CHANGELOG.md with this simplification

Technical details:
- API mode dynamically creates isolated runtime config files via
  RuntimeConfigManager (data/runtime_env_{job_id}_{model}_{date}.json)
- tools/general_tools.py already handles missing RUNTIME_ENV_PATH
  gracefully, returning empty dict and warning on writes
- No functional impact - all tests pass without this variable set
- Reduces configuration complexity for new deployments

Breaking change: None - variable was vestigial from batch mode era
2025-10-31 14:37:00 -04:00
357e561b1f refactor: remove batch mode, simplify to API-only deployment
Removes dual-mode deployment complexity, focusing on REST API service only.

Changes:
- Removed batch mode from docker-compose.yml (now single ai-trader service)
- Deleted scripts/test_batch_mode.sh validation script
- Renamed entrypoint-api.sh to entrypoint.sh (now default)
- Simplified Dockerfile (single entrypoint, removed CMD)
- Updated validation scripts to use 'ai-trader' service name
- Updated documentation (README.md, TESTING_GUIDE.md, CHANGELOG.md)

Benefits:
- Eliminates port conflicts between batch and API services
- Simpler configuration and deployment
- API-first architecture aligned with Windmill integration
- Reduced maintenance complexity

Breaking Changes:
- Batch mode no longer available
- All simulations must use REST API endpoints
2025-10-31 13:54:14 -04:00
fb9583b374 feat: transform to REST API service with SQLite persistence (v0.3.0)
Major architecture transformation from batch-only to API service with
database persistence for Windmill integration.

## REST API Implementation
- POST /simulate/trigger - Start simulation jobs
- GET /simulate/status/{job_id} - Monitor job progress
- GET /results - Query results with filters (job_id, date, model)
- GET /health - Service health checks

## Database Layer
- SQLite persistence with 6 tables (jobs, job_details, positions,
  holdings, reasoning_logs, tool_usage)
- Foreign key constraints with cascade deletes
- Replaces JSONL file storage

## Backend Components
- JobManager: Job lifecycle management with concurrency control
- RuntimeConfigManager: Thread-safe isolated runtime configs
- ModelDayExecutor: Single model-day execution engine
- SimulationWorker: Date-sequential, model-parallel orchestration

## Testing
- 102 unit and integration tests (85% coverage)
- Database: 98% coverage
- Job manager: 98% coverage
- API endpoints: 81% coverage
- Pydantic models: 100% coverage
- TDD approach throughout

## Docker Deployment
- Dual-mode: API server (persistent) + batch (one-time)
- Health checks with 30s interval
- Volume persistence for database and logs
- Separate entrypoints for each mode

## Validation Tools
- scripts/validate_docker_build.sh - Build validation
- scripts/test_api_endpoints.sh - Complete API testing
- scripts/test_batch_mode.sh - Batch mode validation
- DOCKER_API.md - Deployment guide
- TESTING_GUIDE.md - Testing procedures

## Configuration
- API_PORT environment variable (default: 8080)
- Backwards compatible with existing configs
- FastAPI, uvicorn, pydantic>=2.0 dependencies

Co-Authored-By: AI Assistant <noreply@example.com>
2025-10-31 11:47:10 -04:00
a4bc4fd0de fix: update repository URLs to Xe138/AI-Trader fork
Update all GitHub URLs in README from HKUDS/AI-Trader to
Xe138/AI-Trader including:
- Clone URLs (2 locations)
- Support & Community links (Discussions, Issues)
- Badge URLs (stars, forks)
2025-10-30 21:06:28 -04:00
6af1808c2f Add Docker deployment section to README
Include quick start with Docker Compose
Add pre-built image usage instructions
Link to detailed Docker documentation
2025-10-30 18:44:04 -04:00
tianyufan
d30fb072bd update README 2025-10-30 10:57:22 +08:00
tianyufan
2c5072f66f update python version 2025-10-29 21:33:46 +08:00
tianyufan
53a5e5c46d update leadboard 2025-10-29 12:19:24 +08:00
chaohuang-ai
9a52263d74 Update README.md 2025-10-29 01:22:31 +08:00
chaohuang-ai
a2173cf1c9 Update README.md 2025-10-29 00:08:34 +08:00
tianyufan
8a3445d9f8 update README 2025-10-28 21:27:23 +08:00
tianyufan
beb8d7b393 update Disclaimer 2025-10-28 15:33:47 +08:00
tianyufan
1a41923ece update leaderboard 2025-10-28 11:46:58 +08:00
tianyufan
825e89858c Merge branch 'main' of https://github.com/HKUDS/AI-Trader 2025-10-28 11:43:56 +08:00
tianyufan
a27838a1fc update leaderboard 2025-10-28 11:42:52 +08:00
chaohuang-ai
4ae1818467 Update README.md 2025-10-28 11:35:08 +08:00
tianyufan
49723c2b5e update TODO 2025-10-27 21:43:34 +08:00
tianyufan
3cfd89dd93 update README 2025-10-25 22:03:34 +08:00
tianyufan
2a0b3c986e update readme 2025-10-24 23:04:50 +08:00
tianyufan
9455ee7944 update README 2025-10-24 23:02:22 +08:00
ZzMeei
6e5cc56e44 upload communication 2025-10-24 16:44:57 +08:00
chaohuang-ai
2be115206a Update README.md 2025-10-24 11:42:50 +08:00
chaohuang-ai
928cc88c63 Update README.md 2025-10-24 10:06:24 +08:00
chaohuang-ai
d607114bc2 Update README.md 2025-10-24 03:17:31 +08:00
chaohuang-ai
cf50505868 Update README.md 2025-10-24 03:16:31 +08:00
chaohuang-ai
a7458d88f8 Update README.md 2025-10-24 03:13:48 +08:00
chaohuang-ai
1f6478ac0e Update README.md 2025-10-24 03:13:06 +08:00
chaohuang-ai
6fb0ed8dc3 Update README.md 2025-10-24 02:52:16 +08:00
tianyufan
bd01a477ef update link 2025-10-24 02:35:13 +08:00
tianyufan
4997a3ba62 Merge branch 'main' of https://github.com/HKUDS/AI-Trader 2025-10-24 02:26:58 +08:00
chaohuang-ai
e544ac1d97 Update README.md 2025-10-24 02:25:40 +08:00
tianyufan
d1971234bc update data and assets 2025-10-24 02:24:26 +08:00
chaohuang-ai
0ba30bbcf8 Update README.md 2025-10-24 02:23:43 +08:00
chaohuang-ai
46af2f056a Update README.md 2025-10-24 02:13:21 +08:00
chaohuang-ai
289c07935d Update README.md 2025-10-24 02:08:19 +08:00
chaohuang-ai
e6478c3704 Update README.md 2025-10-24 02:07:42 +08:00
chaohuang-ai
e4ee3e7fee Update README.md 2025-10-24 02:07:00 +08:00
tianyufan
3a3938ea58 updateREADME 2025-10-24 02:05:02 +08:00
tianyufan
ab9acd078c update 2025-10-24 01:52:47 +08:00
tianyufan
7b2b91120b update readme 2025-10-24 01:46:51 +08:00
tianyufan
cf47ce1105 update README 2025-10-24 01:45:32 +08:00
tianyufan
c6cbaca0d7 update data 2025-10-24 01:43:23 +08:00
tianyufan
df5c25c98d init update 2025-10-24 00:35:21 +08:00