im-amrith/nerve
0
Agentic Brokerage OS
An intelligence-first brokerage layer that governs trading through autonomous AI agents.
๐ฏ Core Philosophy
Problem: Brittle execution-only models lead to retail losses through emotional trading and lack of behavioral guardrails.
Solution: Self-healing adaptive automation using Vision Language Models and multi-agent orchestration.
๏ฟฝ Interactive Dashboard (Recommended for Judges)
We've built a beautiful web-based dashboard to showcase all features interactively!
One-Click Launch (Windows):
run_dashboard.batOne-Click Launch (Linux/Mac):
chmod +x run_dashboard.sh
./run_dashboard.shManual Launch:
# Install Streamlit
pip install streamlit>=1.30.0
# Launch dashboard
streamlit run dashboard.pyThen open your browser to: http://localhost:8501
The dashboard provides:
- โ Interactive demos of all 4 core features
- โ Real-time visualization of AI agents
- โ Live code generation and execution
- โ Beautiful UI for judges to evaluate
- โ One-click feature switching
๏ฟฝ๐๏ธ Architecture
Perception (CV + Groq VLM) โ Reasoning (LangGraph) โ Action (Trading APIs)Core Components
- Orchestrator: LangGraph-based multi-agent coordination
- Perception Engine: Computer Vision + Groq for UI understanding (no DOM selectors)
- Reasoning Engine: LLM-based planning and decision-making
- Pre-Trade Sentinel: Sub-50ms safety checks and kill switch
- Strategy Engine: Natural language to executable trading algorithms
- RAG Journaling: Context-aware trade autopsy system
๐ Quick Start
Prerequisites
Python 3.10+
pip install -r requirements.txtEnvironment Setup
Create a .env file:
GROQ_API_KEY=your_groq_api_key
PINECONE_API_KEY=your_pinecone_key
PINECONE_ENV=your_environmentRun the System
# Start the orchestrator
python src/main.py
# Run demos
python demos/ui_adaptation_demo.py
python demos/strategy_generation_demo.py๐ Project Structure
zerodha/
โโโ src/
โ โโโ agents/ # Specialized agents
โ โ โโโ perception_agent.py
โ โ โโโ reasoning_agent.py
โ โ โโโ sentinel_agent.py
โ โ โโโ strategy_agent.py
โ โโโ core/ # Core systems
โ โ โโโ orchestrator.py # LangGraph workflow
โ โ โโโ perception.py # CV + VLM perception
โ โ โโโ state.py # Agent state definitions
โ โโโ engines/ # Business logic
โ โ โโโ pre_trade_sentinel.py
โ โ โโโ strategy_engine.py
โ โ โโโ rag_journal.py
โ โโโ utils/ # Utilities
โ โ โโโ vision.py
โ โ โโโ memory.py
โ โ โโโ validators.py
โ โโโ main.py # Entry point
โโโ demos/ # Demonstrations
โโโ tests/ # Test suite
โโโ config/ # Configuration files
โโโ docs/ # Documentation๐ช Demos
1. UI Adaptation Demo ("Sabotage Test")
Demonstrates self-healing when UI elements are moved/modified.
python demos/ui_adaptation_demo.py2. Strategy Generation
Convert natural language to backtested trading algorithms.
python demos/strategy_generation_demo.py3. Pre-Trade Sentinel
Live demonstration of the kill switch blocking risky trades.
python demos/sentinel_demo.py๐ Security Features
- Zero-Knowledge ML: Verifiable inference without data exposure
- User Constitution: Personalized trading rules and guardrails
- Kill Switch: Hard blocks on rule violations (<50ms latency)
๐ Key Metrics
- Perception Latency: <200ms for screen-to-JSON mapping
- Sentinel Response: <50ms for trade safety checks
- UI Adaptation: Real-time self-healing without code changes
๐ ๏ธ Technology Stack
- VLM: Groq (llama-3.2-90b-vision-preview)
- Agent Framework: LangGraph
- Vector DB: Pinecone
- Computer Vision: OpenCV + Pillow
- API Layer: FastAPI (future)
๐ License
MIT
๐ค Contributing
See CONTRIBUTING.md
