Skip to content

Repository files navigation

SilkRoad Agents

Cross-Border Investment Analysis powered by ERNIE 4.5 + CAMEL-AI + PaddleOCR

A 3-agent system that generates structured Investment Memos for US/EU investors evaluating Chinese tech markets.

ERNIE AI Developer Challenge Powered by CAMEL-AI PaddleOCR


Table of Contents


Overview

SilkRoad Agents is an AI-powered investment analysis platform that bridges the information gap between Western investors and the Chinese tech ecosystem. Using ERNIE 4.5's superior bilingual capabilities, it orchestrates a 3-agent debate system to generate professional-grade Investment Memos.

Why SilkRoad Agents?

Method Time Cost
Traditional Consulting 2-4 weeks $5,000-$20,000
In-house Research 1 week $2,000
SilkRoad Agents 2 minutes $0.15

Judges Quick Start

  1. Run locally (see Quick Start below) or use demo video
  2. Click "Humanoid Robots" example button
  3. Watch 3 agents debate (Chinese Scout vs Western Analyst)
  4. See Investment Memo appear in right panel
  5. Click Download to export as Markdown

Problem Statement

Target Users: Venture Capitalists, Corp-Dev Teams, and Market Researchers.

Pain Point: When evaluating Chinese deep-tech companies (AI chips, EVs, robotics), Western investors lack:

  • Access to local regulatory context (MIIT, NDRC policies)
  • Knowledge of domestic Chinese competitors
  • Ability to analyze Chinese-language documents

Architecture

+-------------------+     +-------------------+     +-------------------+
|   Next.js UI      |     |   FastAPI API     |     |   ERNIE 4.5       |
|                   |     |                   |     |   (via Novita)    |
|  - Chat Interface |<--->|  - /start_task    |<--->|                   |
|  - Doc Upload     |     |  - /upload_doc    |     |  Bilingual LLM    |
|  - Report Panel   |     |  - /health        |     |                   |
+-------------------+     +-------------------+     +-------------------+
                                   |
                    +--------------+---------------+
                    |              |               |
            +-------v------+ +-----v-----+ +------v-------+
            | Chinese Tech | | Western   | | Investment   |
            | Scout        | | Analyst   | | Synthesis    |
            | (ERNIE)      | | (ERNIE)   | | Manager      |
            +--------------+ +-----------+ +--------------+
                    |              |               |
                    +--------------+---------------+
                                   |
                           +-------v-------+
                           | PaddleOCR     |
                           | (Document     |
                           |  Intelligence)|
                           +---------------+

3-Agent Pipeline

  1. Chinese Tech Scout: Provides domestic market data, key players (with Chinese names), regulations (MIIT, NDRC), and local trends.

  2. Western Market Analyst: Compares with US/EU equivalents, identifies risks, and rates insights.

  3. Investment Synthesis Manager: Generates structured Investment Memo with BUY/HOLD/PASS recommendation.


Key Features

Feature Description
3-Agent Pipeline Scout -> Analyst -> Synthesizer with structured debate
PaddleOCR Integration Upload Chinese PDFs/images for analysis
Confidence Scores Each response includes 75-95% confidence + sources
Structured Output Risk tables, scores, and BUY/HOLD/PASS recommendations
Voice Input Speak your research topic
Risk Weight Sliders Customize analysis focus
Download Reports Export Investment Memo as .md or .html
Docker Ready One-command deployment with docker-compose up

Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Novita AI API Key (or Baidu Access Token)

1. Clone and Setup

git clone https://github.com/your-repo/silkroad-agents.git
cd silkroad-agents

2. Backend Setup

cd backend

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure API key
cp .env.example .env
# Edit .env and add your NOVITA_API_KEY

3. Frontend Setup

cd ernie-agent-ui
npm install

4. Run the Application

# Terminal 1 - Backend
cd backend && source .venv/bin/activate
uvicorn main:app --reload --host 0.0.0.0 --port 8000

# Terminal 2 - Frontend
cd ernie-agent-ui
npm run dev

Open http://localhost:3000 in your browser.


API Reference

Base URL

http://localhost:8000

Endpoints

GET /

Returns service information.

Response:

{
  "service": "SilkRoad Agents",
  "version": "3.0.0",
  "features": ["3-agent-pipeline", "paddle-ocr", "investment-memo"],
  "endpoints": ["/start_task", "/upload_document", "/health"]
}

GET /health

Health check endpoint.

Response:

{
  "status": "healthy",
  "api_configured": true,
  "provider": "novita",
  "paddle_ocr": true
}

POST /start_task

Starts the cross-border analysis pipeline.

Request Body:

{
  "prompt": "Humanoid Robots market: Chinese players vs USA",
  "document_context": null
}

Response: Server-Sent Events (SSE) stream containing:

  • Agent dialogue messages
  • Final Investment Memo

POST /upload_document

Upload a document for OCR extraction.

Request: Multipart form with file (PNG, JPG, PDF)

Response:

{
  "success": true,
  "document_id": "abc123",
  "extracted_text": "...",
  "confidence": 92.5,
  "document_type": "financial_report",
  "char_count": 2500
}

Technology Stack

Technology Role Why This Choice
ERNIE 4.5 LLM backbone Superior Chinese-English bilingual; knows MIIT/NDRC policies
CAMEL-AI Agent orchestration Role-playing framework for structured debate
PaddleOCR Document intelligence Extract text from Chinese financial reports
Novita AI API access OpenAI-compatible endpoint; $25 free credits
FastAPI Backend API Async Python, automatic OpenAPI docs, SSE support
Next.js Frontend React-based, server-side rendering, excellent DX

Project Structure

silkroad-agents/
|-- backend/
|   |-- main.py                # FastAPI application entry point
|   |-- agent_manager.py       # 3-agent pipeline orchestration
|   |-- ernie_model.py         # ERNIE 4.5 model backend
|   |-- document_processor.py  # PaddleOCR integration
|   |-- requirements.txt       # Python dependencies
|   |-- .env.example           # Environment template
|   +-- tests/
|       +-- test_agent_flow.py # Unit tests
|
|-- ernie-agent-ui/
|   |-- app/
|   |   |-- page.js            # Main application page
|   |   |-- layout.js          # Root layout
|   |   |-- globals.css        # Global styles
|   |   +-- components/
|   |       |-- ChatInput.js       # Text input component
|   |       |-- DocumentUpload.js  # File upload with OCR
|   |       |-- ErnieBadge.js      # ERNIE branding badge
|   |       |-- LoadingSkeleton.js # Loading states
|   |       |-- Message.js         # Chat message display
|   |       |-- RecentAnalyses.js  # History tracking
|   |       |-- RiskSliders.js     # Risk weight controls
|   |       +-- VoiceInput.js      # Voice recognition
|   |-- package.json
|   +-- next.config.mjs
|
|-- Dockerfile.backend         # Backend container
|-- Dockerfile.frontend        # Frontend container
|-- docker-compose.yml         # Multi-container setup
|-- README.md                  # This file
|-- ERNIE_Context.md           # Technical context
+-- project.md                 # Product requirements

Hackathon Alignment

Target Tracks

Track Alignment
Best Agent System 3-agent CAMEL-AI pipeline with structured debate
Best ERNIE Application Leverages ERNIE's bilingual capabilities

Judging Criteria (20% each)

Criterion How We Score
Application of Model ERNIE 4.5 bilingual for cross-border analysis
Potential Impact VCs, Corp-Dev teams; $5,000 -> $0.15 cost savings
Creativity 3-agent debate + structured Investment Memo
Documentation Quality Comprehensive README, API docs, code comments
Demo Video Quality Clear demo showing end-to-end workflow

Docker Deployment

# Build and run all services
docker-compose up -d

# Check health
curl http://localhost:8000/health

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Environment Variables

Variable Required Description
NOVITA_API_KEY Yes* Novita AI API key for ERNIE access
BAIDU_ACCESS_TOKEN Yes* Baidu AI Studio token (alternative)
LOG_LEVEL No Logging level (default: INFO)

*One of NOVITA_API_KEY or BAIDU_ACCESS_TOKEN is required.


Sample Output

Topic: Humanoid Robots in China vs USA

Executive Summary

The Chinese humanoid robot market is led by Unitree (宇树科技) and Fourier Intelligence (傅利叶智能), with strong MIIT support for domestic manufacturing. Western competitors include Tesla Optimus and Figure AI. Recommendation: HOLD - Wait for AI chip supply clarity before Series B.

Risk Assessment

Factor Score Analysis
Tech Maturity 4/5 Bipedal locomotion advanced; Chinese firms lead in cost efficiency
Regulatory Risk 3/5 US chip export controls affect NVIDIA H100 supply
Supply Chain 2/5 Critical dependence on imported semiconductors
Market Access 4/5 Strong domestic demand; government procurement contracts

Limitations

  • OCR works best on printed text (handwriting has lower accuracy)
  • Analysis based on LLM knowledge cutoff, not real-time data
  • Single document context per analysis session
  • Requires internet connection for ERNIE API calls

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/improvement)
  3. Commit changes (git commit -am 'Add new feature')
  4. Push to branch (git push origin feature/improvement)
  5. Open a Pull Request

License

MIT License - see LICENSE file for details.


Acknowledgments


Built for the ERNIE AI Developer Challenge 2024

Author: Solo Developer

ernie-ai-dev-challenge

ernie-ai-dev-challenge

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages