virattt / dexter
virattt / 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. Dexter 🤖 是一个自主金融研究智能体,它能在工作中进行思考、规划和学习。它通过任务规划、自我反思和实时市场数据进行分析。可以将其理解为专为金融研究打造的 Claude Code。
Table of Contents
目录
👋 Overview | ✅ Prerequisites | 💻 How to Install | 🚀 How to Run | 📊 How to Evaluate | 🐛 How to Debug | 📱 How to Use with WhatsApp | 🤝 How to Contribute | 📄 License 👋 概述 | ✅ 前置要求 | 💻 如何安装 | 🚀 如何运行 | 📊 如何评估 | 🐛 如何调试 | 📱 如何在 WhatsApp 中使用 | 🤝 如何贡献 | 📄 许可证
👋 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.
👋 概述
Dexter 能将复杂的金融问题转化为清晰的分步研究计划。它利用实时市场数据执行这些任务,检查自己的工作,并不断优化结果,直到得出有数据支持的可靠答案。
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
- 智能任务规划: 自动将复杂查询分解为结构化的研究步骤
- 自主执行: 选择并执行合适的工具来收集金融数据
- 自我验证: 检查自己的工作并进行迭代,直到任务完成
- 实时金融数据: 可访问损益表、资产负债表和现金流量表
- 安全特性: 内置循环检测和步骤限制,防止失控执行
✅ Prerequisites
Bun runtime (v1.0 or higher), OpenAI API key, Financial Datasets API key, Exa API key (optional, for web search).
✅ 前置要求
Bun 运行时(v1.0 或更高版本)、OpenAI API 密钥、Financial Datasets API 密钥、Exa API 密钥(可选,用于网页搜索)。
Installing Bun: If you don’t have Bun installed, you can install it using curl: 安装 Bun: 如果你尚未安装 Bun,可以使用 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
安装完成后,重启终端并验证 Bun 是否已安装:bun --version
💻 How to Install
Clone the repository, install dependencies with Bun, and set up your environment variables.
💻 如何安装
克隆仓库,使用 Bun 安装依赖,并设置环境变量。
git clone https://github.com/virattt/dexter.git
cd dexter
bun install
cp env.example .env
(Edit .env and add your API keys) (编辑 .env 文件并添加你的 API 密钥)
🚀 How to Run
Run Dexter in interactive mode: bun start or with watch mode for development: bun dev
🚀 如何运行
以交互模式运行 Dexter:bun start;或在开发模式下使用监听模式: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.
📊 如何评估
Dexter 包含一套评估套件,用于针对金融问题数据集测试智能体。评估使用 LangSmith 进行追踪,并采用“大模型作为裁判”(LLM-as-judge)的方法来评分。
- Run on all questions:
bun run src/evals/run.ts - Run on a random sample:
bun run src/evals/run.ts --sample 10 - 运行所有问题:
bun run src/evals/run.ts - 运行随机样本:
bun run src/evals/run.ts --sample 10
🐛 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/.
🐛 如何调试
Dexter 会将所有工具调用记录到草稿文件中,以便进行调试和历史追踪。每个查询都会在 .dexter/scratchpad/ 中创建一个新的 JSONL 文件。
Each file contains newline-delimited JSON entries tracking: init (original query), tool_result (tool calls/results), and thinking (reasoning steps).
每个文件包含以换行符分隔的 JSON 条目,追踪内容包括:init(原始查询)、tool_result(工具调用/结果)以及 thinking(推理步骤)。
📱 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.
📱 如何在 WhatsApp 中使用
通过将手机连接到网关,即可在 WhatsApp 上与 Dexter 聊天。你发送给自己的消息会被 Dexter 处理,回复也会发送回同一个对话框。
- Link account:
bun run gateway:login - Start gateway:
bun run gateway - 连接账户:
bun run gateway:login - 启动网关:
bun run gateway
🤝 How to Contribute
Fork the repository, create a feature branch, commit your changes, and create a Pull Request. Please keep pull requests small and focused.
🤝 如何贡献
Fork 本仓库,创建功能分支,提交更改并创建 Pull Request。请保持 Pull Request 小而专注。
📄 License
This project is licensed under the MIT License.
📄 许可证
本项目采用 MIT 许可证。