How polymarket/agents works
Main System Components
a) Interface Layer:
• CLI Interface (scripts/python/cli.py)
• Server Component (scripts/python/server.py)
b) Application Core:
• Trade Execution System (agents/application/trade.py)
• Agent Creator (agents/application/creator.py)
• Execution Engine (agents/application/executor.py)
• Prompt Management (agents/application/prompts.py)
c) Integration Layer:
• Polymarket Integration (agents/polymarket/)
• Data Connectors (agents/connectors/)
• Vector Database (Chroma)
Component Relationships
a) External Systems Integration:
• Connections to external APIs (News, Search, Polymarket CLOB)
• Integration with Chroma DB for vector storage
• Connection to OpenAI API for LLM operations
b) Internal Flow:
• CLI/Server → Application Core
• Application Core → Connectors
• Connectors → External Services
• Trade Execution → Polymarket API
Specific Design Elements
Use these visual elements:
• Blue rectangles: Core application components
• Green rectangles: External services
• Yellow rectangles: Data stores
• Purple rectangles: API interfaces
Key Architectural Patterns to Highlight
a) Modular Architecture:
• Separate connectors for different data sources
• Isolated trading logic
• Independent prompt management
b) RAG (Retrieval-Augmented Generation) Pipeline:
• Data flow from sources to vector DB
• LLM integration points
• Knowledge retrieval process
Implementation Details
• User Interface |
• (CLI/Server Layer) |
• ↓
• Application Core |
• (Agent/Trading Logic) |
• ↓
• Integration Layer |
• (Connectors/APIs) |
• ↓
• External Services |
• (Polymarket/Data/LLM) |
Technical Stack Indicators
• Python 3.9 runtime
• OpenAI API integration
• Chroma DB vector storage
• Polymarket CLOB client
• Docker containerization