dexter README

The project's README from github.com/virattt/dexter. As one markdown file: README.md.

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 2026-04-02 at 4 16 57 PM

Table of Contents

⚠️ Disclaimer

This project is for educational, entertainment, and informational purposes only. It is not intended for real trading or investment.

By using this software, you agree to use it solely for learning and informational purposes and accept all risks associated with its use.

👋 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:

Twitter Follow Discord

Screenshot 2026-02-18 at 12 21 25 PM

✅ Prerequisites

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

💻 How to Install

  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
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 (optional)
# GOOGLE_API_KEY=your-google-api-key (optional)
# XAI_API_KEY=your-xai-api-key (optional)
# OPENROUTER_API_KEY=your-openrouter-api-key (optional)

# Institutional-grade market data for agents
# FINANCIAL_DATASETS_API_KEY=your-financial-datasets-api-key

# (Optional) If using Ollama locally
# OLLAMA_BASE_URL=http://127.0.0.1:11434

# Web Search (Exa preferred, Tavily fallback)
# EXASEARCH_API_KEY=your-exa-api-key
# TAVILY_API_KEY=your-tavily-api-key

🚀 How to Run

Run Dexter in interactive mode:

bun start

Or with watch mode for development:

bun dev

📊 How to Evaluate

Dexter 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.

Run on all questions:

bun run src/evals/run.ts

Run on a random sample of data:

bun run src/evals/run.ts --sample 10

The eval runner displays a real-time UI showing progress, current question, and running accuracy statistics. Results are logged to LangSmith for analysis.

🐛 How to Debug

Dexter logs all tool calls to a scratchpad file for debugging and history tracking. Each query creates a new JSONL file in .dexter/scratchpad/.

Scratchpad location:

.dexter/scratchpad/
├── 2026-01-30-111400_9a8f10723f79.jsonl
├── 2026-01-30-143022_a1b2c3d4e5f6.jsonl
└── ...

Each file contains newline-delimited JSON entries tracking:

Example scratchpad entry:

{"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"}

This makes it easy to inspect exactly what data the agent gathered and how it interpreted results.

📱 How to Use with WhatsApp

Chat 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.

Quick start:

# Link your WhatsApp account (scan QR code)
bun run gateway:login

# Start the gateway
bun run gateway

Then open WhatsApp, go to your own chat (message yourself), and ask Dexter a question.

For detailed setup instructions, configuration options, and troubleshooting, see the WhatsApp Gateway README.

🤝 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.

dexter (virattt/dexter)

Searching Database…

27.7K ·GitHub
这是什么?Dexter 是一个自主智能体,能独立研究金融问题:它会自己规划研究步骤,获取实时市场数据,例如利润表和现金流量表,检查自己的工作,并不断完善答案,直到有足够把握。
它只是个简单的聊天机器人,还是真的能自己做多步分析?它更接近自主编程智能体,而不是聊天机器人:它会把复杂的金融问题拆解成结构化计划,自行选择并运行合适的工具,并在给出最终答案前进行自我验证。
我该怎么把它跑起来?安装 Bun 运行时,克隆仓库,运行 Bun 安装步骤,设置环境变量,然后以交互模式启动(开发时也可以用 watch 模式)。
使用之前我需要准备哪些 API 密钥?你需要一个 OpenAI API 密钥和一个 Financial Datasets API 密钥;Exa API 密钥是可选的,仅在需要网络搜索时才用。
它的研究结果能用来做真实的交易决策吗?不能。README 明确说明,输出可能有误或不完整,本项目仅供教育和娱乐用途,不构成金融、投资、税务或法律建议。
我能通过 WhatsApp 和 Dexter 聊天吗?可以,项目包含一个 WhatsApp 网关,你可以把它关联到自己的手机上;你在 WhatsApp 里发给自己的消息会由 Dexter 处理,并在同一个聊天中回复。
这个项目怎么衡量它的回答是否真的正确?项目附带一套评估程序,让智能体基于一组金融问题数据集运行,并用 LLM-as-judge(以大模型作为评判者)对正确性打分,结果记录到 LangSmith 以便分析。
我怎样才能看到智能体为得出答案都做了什么?每次查询都会在 .dexter/scratchpad/ 下写入一个 JSONL 草稿文件,记录原始查询、每次工具调用及其参数和结果,以及智能体的推理步骤。
有什么安全机制防止智能体无休止地运行?Dexter 内置了循环检测和步数限制,专门用于防止自主研究过程中出现失控执行。
Creator
virattt
Size
1.7 MB
Stars
27.7K
Age
1y
Commits · 90 Days