{
  "markdown": "# Dexter 🤖\n\nDexter 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.\n\n<img width=\"665\" height=\"452\" alt=\"Screenshot 2026-04-02 at 4 16 57 PM\" src=\"https://github.com/user-attachments/assets/02418111-5f48-4a66-be5d-dc9bf9806284\" />\n\n## Table of Contents\n\n- [👋 Overview](#-overview)\n- [✅ Prerequisites](#-prerequisites)\n- [💻 How to Install](#-how-to-install)\n- [🚀 How to Run](#-how-to-run)\n- [📊 How to Evaluate](#-how-to-evaluate)\n- [🐛 How to Debug](#-how-to-debug)\n- [📱 How to Use with WhatsApp](#-how-to-use-with-whatsapp)\n- [🤝 How to Contribute](#-how-to-contribute)\n- [📄 License](#-license)\n\n## ⚠️ Disclaimer\n\nThis project is for **educational, entertainment, and informational purposes only**. It is not intended for real trading or investment.\n\n- Not financial, investment, tax, or legal advice\n- No guarantees of accuracy, completeness, or fitness for any purpose\n- Outputs may be incorrect, incomplete, or out of date\n- Creator and contributors assume no liability for any financial losses or damages\n- Consult a licensed financial advisor before making investment decisions\n- Past performance does not indicate future results\n\nBy using this software, you agree to use it solely for learning and informational purposes and accept all risks associated with its use.\n\n## 👋 Overview\n\nDexter 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.  \n\n**Key Capabilities:**\n- **Intelligent Task Planning**: Automatically decomposes complex queries into structured research steps\n- **Autonomous Execution**: Selects and executes the right tools to gather financial data\n- **Self-Validation**: Checks its own work and iterates until tasks are complete\n- **Real-Time Financial Data**: Access to income statements, balance sheets, and cash flow statements\n- **Safety Features**: Built-in loop detection and step limits to prevent runaway execution\n\n[![Twitter Follow](https://img.shields.io/twitter/follow/virattt?style=social)](https://twitter.com/virattt) [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=social&logo=discord)](https://discord.gg/jpGHv2XB6T)\n\n<img width=\"1042\" height=\"638\" alt=\"Screenshot 2026-02-18 at 12 21 25 PM\" src=\"https://github.com/user-attachments/assets/2a6334f9-863f-4bd2-a56f-923e42f4711e\" />\n\n\n## ✅ Prerequisites\n\n- [Bun](https://bun.com) runtime (v1.0 or higher)\n- OpenAI API key (get [here](https://platform.openai.com/api-keys))\n- Financial Datasets API key (get [here](https://financialdatasets.ai))\n- Exa API key (get [here](https://exa.ai)) - optional, for web search\n\n#### Installing Bun\n\nIf you don't have Bun installed, you can install it using curl:\n\n**macOS/Linux:**\n```bash\ncurl -fsSL https://bun.com/install | bash\n```\n\n**Windows:**\n```bash\npowershell -c \"irm bun.sh/install.ps1|iex\"\n```\n\nAfter installation, restart your terminal and verify Bun is installed:\n```bash\nbun --version\n```\n\n## 💻 How to Install\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/virattt/dexter.git\ncd dexter\n```\n\n2. Install dependencies with Bun:\n```bash\nbun install\n```\n\n3. Set up your environment variables:\n```bash\n# Copy the example environment file\ncp env.example .env\n\n# Edit .env and add your API keys (if using cloud providers)\n# OPENAI_API_KEY=your-openai-api-key\n# ANTHROPIC_API_KEY=your-anthropic-api-key (optional)\n# GOOGLE_API_KEY=your-google-api-key (optional)\n# XAI_API_KEY=your-xai-api-key (optional)\n# OPENROUTER_API_KEY=your-openrouter-api-key (optional)\n\n# Institutional-grade market data for agents\n# FINANCIAL_DATASETS_API_KEY=your-financial-datasets-api-key\n\n# (Optional) If using Ollama locally\n# OLLAMA_BASE_URL=http://127.0.0.1:11434\n\n# Web Search (Exa preferred, Tavily fallback)\n# EXASEARCH_API_KEY=your-exa-api-key\n# TAVILY_API_KEY=your-tavily-api-key\n```\n\n## 🚀 How to Run\n\nRun Dexter in interactive mode:\n```bash\nbun start\n```\n\nOr with watch mode for development:\n```bash\nbun dev\n```\n\n## 📊 How to Evaluate\n\nDexter includes an evaluation suite that tests the agent against a dataset of financial questions. Evals use LangSmith for tracking and an LLM-as-judge approach for scoring correctness.\n\n**Run on all questions:**\n```bash\nbun run src/evals/run.ts\n```\n\n**Run on a random sample of data:**\n```bash\nbun run src/evals/run.ts --sample 10\n```\n\nThe eval runner displays a real-time UI showing progress, current question, and running accuracy statistics. Results are logged to LangSmith for analysis.\n\n## 🐛 How to Debug\n\nDexter logs all tool calls to a scratchpad file for debugging and history tracking. Each query creates a new JSONL file in `.dexter/scratchpad/`.\n\n**Scratchpad location:**\n```\n.dexter/scratchpad/\n├── 2026-01-30-111400_9a8f10723f79.jsonl\n├── 2026-01-30-143022_a1b2c3d4e5f6.jsonl\n└── ...\n```\n\nEach file contains newline-delimited JSON entries tracking:\n- **init**: The original query\n- **tool_result**: Each tool call with arguments, raw result, and LLM summary\n- **thinking**: Agent reasoning steps\n\n**Example scratchpad entry:**\n```json\n{\"type\":\"tool_result\",\"timestamp\":\"2026-01-30T11:14:05.123Z\",\"toolName\":\"get_income_statements\",\"args\":{\"ticker\":\"AAPL\",\"period\":\"annual\",\"limit\":5},\"result\":{...},\"llmSummary\":\"Retrieved 5 years of Apple annual income statements showing revenue growth from $274B to $394B\"}\n```\n\nThis makes it easy to inspect exactly what data the agent gathered and how it interpreted results.\n\n## 📱 How to Use with WhatsApp\n\nChat with Dexter through WhatsApp by linking your phone to the gateway. Messages you send to yourself are processed by Dexter and responses are sent back to the same chat.\n\n**Quick start:**\n```bash\n# Link your WhatsApp account (scan QR code)\nbun run gateway:login\n\n# Start the gateway\nbun run gateway\n```\n\nThen open WhatsApp, go to your own chat (message yourself), and ask Dexter a question.\n\nFor detailed setup instructions, configuration options, and troubleshooting, see the [WhatsApp Gateway README](src/gateway/channels/whatsapp/README.md).\n\n## 🤝 How to Contribute\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n**Important**: Please keep your pull requests small and focused.  This will make it easier to review and merge.\n\n\n## 📄 License\n\nThis project is licensed under the MIT License.\n",
  "bytes": 6599,
  "sha": "982f4294335c2941b01297d00f4da6756a1b73dd9c02cdad705e58db767e3a09",
  "repo_slug": "virattt/dexter",
  "fonte": "repo",
  "truncated": false,
  "api": "https://api.agentalog.com/api/listings/skl_virattt_dexter_dcf_valuation_b449b5d5/readme"
}