GStars
    virattt

    virattt/dexter

    An autonomous agent for deep financial research

    ai-agents
    TypeScript
    16.6K stars
    2.0K forks
    16.6K watching
    Updated 2/27/2026
    View on GitHub
    Backblaze Advertisement

    Loading star history...

    Health Score

    75

    Weekly Growth

    +0

    +0.0% this week

    Contributors

    1

    Total contributors

    Open Issues

    42

    Generated Insights

    About dexter

    Dexter ๐Ÿค–

    Dexter is an autonomous financial research agent that thinks, plans, and learns as it works. It performs analysis using task planning, self-reflection, and real-time market data. Think Claude Code, but built specifically for financial research.

    Screenshot 2025-10-14 at 6 12 35 PM

    Overview

    Dexter takes complex financial questions and turns them into clear, step-by-step research plans. It runs those tasks using live market data, checks its own work, and refines the results until it has a confident, data-backed answer.

    Key Capabilities:

    • Intelligent Task Planning: Automatically decomposes complex queries into structured research steps
    • Autonomous Execution: Selects and executes the right tools to gather financial data
    • Self-Validation: Checks its own work and iterates until tasks are complete
    • Real-Time Financial Data: Access to income statements, balance sheets, and cash flow statements
    • Safety Features: Built-in loop detection and step limits to prevent runaway execution

    Twitter Follow

    Screenshot 2025-11-22 at 1 45 07 PM

    Prerequisites

    • Bun runtime (v1.0 or higher)
    • OpenAI API key (get here)
    • Financial Datasets API key (get here)
    • Tavily API key (get here) - optional, for web search

    Installing Bun

    If you don't have Bun installed, you can install it using curl:

    macOS/Linux:

    curl -fsSL https://bun.com/install | bash
    

    Windows:

    powershell -c "irm bun.sh/install.ps1|iex"
    

    After installation, restart your terminal and verify Bun is installed:

    bun --version
    

    Installing Dexter

    1. Clone the repository:
    git clone https://github.com/virattt/dexter.git
    cd dexter
    
    1. Install dependencies with Bun:
    bun install
    
    1. Set up your environment variables:
    # Copy the example environment file (from parent directory)
    cp env.example .env
    
    # Edit .env and add your API keys (if using cloud providers)
    # OPENAI_API_KEY=your-openai-api-key
    # ANTHROPIC_API_KEY=your-anthropic-api-key
    # GOOGLE_API_KEY=your-google-api-key
    
    # (Optional) If using Ollama locally
    # OLLAMA_BASE_URL=http://127.0.0.1:11434
    
    # Other required keys
    # FINANCIAL_DATASETS_API_KEY=your-financial-datasets-api-key
    # TAVILY_API_KEY=your-tavily-api-key
    

    Usage

    Run Dexter in interactive mode:

    bun start
    

    Or with watch mode for development:

    bun dev
    

    Example Queries

    Try asking Dexter questions like:

    • "What was Apple's revenue growth over the last 4 quarters?"
    • "Compare Microsoft and Google's operating margins for 2023"
    • "Analyze Tesla's cash flow trends over the past year"
    • "What is Amazon's debt-to-equity ratio based on recent financials?"

    Dexter will automatically:

    1. Break down your question into research tasks
    2. Fetch the necessary financial data
    3. Perform calculations and analysis
    4. Provide a comprehensive, data-rich answer

    Architecture

    Dexter uses a multi-agent architecture with specialized components:

    • Planning Agent: Analyzes queries and creates structured task lists
    • Action Agent: Selects appropriate tools and executes research steps
    • Validation Agent: Verifies task completion and data sufficiency
    • Answer Agent: Synthesizes findings into comprehensive responses

    Tech Stack

    • Runtime: Bun
    • UI Framework: React + Ink (terminal UI)
    • LLM Integration: LangChain.js with multi-provider support (OpenAI, Anthropic, Google)
    • Schema Validation: Zod
    • Language: TypeScript

    Changing Models

    Type /model in the CLI to switch between:

    • GPT 4.1 (OpenAI)
    • Claude Sonnet 4.5 (Anthropic)
    • Gemini 3 (Google)

    How to Contribute

    1. Fork the repository
    2. Create a feature branch
    3. Commit your changes
    4. Push to the branch
    5. Create a Pull Request

    Important: Please keep your pull requests small and focused. This will make it easier to review and merge.

    License

    This project is licensed under the MIT License.

    Discover Repositories

    Search across tracked repositories by name or description