Skip to content

Note open source

All posts
Oct 27, 20268 min readopen source · AI agent · finance · financial research · TypeScriptRead in:ENID

Dexter: The Open Source AI Agent That Does Deep Financial Research on Autopilot

Dexter is an open source autonomous agent for deep financial research that plans multi-step investigations, pulls real financial statements, checks its own work, and answers via terminal or WhatsApp, backed by 27,716 GitHub stars.

A dark stock market chart glowing on a screen in a modern office.

Ask a chatbot about a stock and you get a fluent paragraph. Ask Dexter and you get a research process: it breaks your question into steps, gathers real financial data, checks its own work, and only then delivers an answer. It is an open source autonomous agent built specifically for deep financial research, and it describes itself with a neat comparison: think Claude Code, but built for financial research instead of code.

The project is virattt/dexter, described on GitHub as an autonomous agent for deep financial research. At the time of writing it holds 27,716 stars and 3,419 forks, it is written in TypeScript, and it is licensed under the MIT License. Watch the 30-second repo signal: This AI agent runs deep financial research on autopilot.

Key Takeaways

Dexter turns a complex financial question into a structured research plan, then executes it step by step instead of answering in one shot.

It works with real market data: income statements, balance sheets, and cash flow statements, plus web search for context.

It self-validates its findings and iterates until the plan is complete, with loop detection and step limits to stop runaway runs.

You can talk to it in the terminal or through WhatsApp, by messaging yourself after linking the gateway.

It is a research tool for learning and analysis, not a trading advisor: the README states plainly that it is not for real trading or investment.

Why a Research Agent Is Different From a Chatbot

A normal chatbot answers from what it already knows, and what it knows has a cutoff date. Financial research is the opposite kind of problem: the facts change every quarter, the numbers live in filings and statements, and a good answer needs several sources checked against each other. A single confident paragraph is exactly the wrong shape for that job.

Dexter is built around that observation. Its key capabilities, as listed in the README, are intelligent task planning, autonomous execution, self-validation, real-time financial data, and safety features. A question like "How has this company performed over the last five years?" becomes a plan: pull the statements, compare the periods, look for what changed, and verify the result before reporting it. That structure is the whole product. The language model is the reasoning engine, but the research plan and the data are what make the answer trustworthy.

This is also why the project keeps a full audit trail. Every query creates a scratchpad file in `.dexter/scratchpad/` that logs the original query, every tool call with its arguments and raw result, and the agent's reasoning steps. If an answer looks wrong, you can open the scratchpad and see exactly which data it gathered and how it interpreted it. For a research tool, that transparency matters more than a slick interface.

What Dexter Actually Does

The workflow has four stages, and each one is visible if you watch it run.

First, planning. Dexter decomposes a complex query into structured research steps. Instead of jumping to an answer, it decides what it needs to find out, in what order, and which tools can supply each piece.

Second, execution. It selects and runs the right tools to gather financial data: income statements, balance sheets, and cash flow statements, through the Financial Datasets API, with Exa web search as an optional source for broader context. The data comes from an API, not from the model's memory, so the numbers reflect published statements rather than recalled ones.

Third, self-validation. After gathering data, Dexter checks its own work and refines the results until it has a confident, data-backed answer. If a step comes back incomplete or inconsistent, it iterates rather than papering over the gap.

Fourth, safety. Built-in loop detection and step limits prevent runaway execution, which matters when every extra step costs API tokens. An agent that cannot stop is an agent that cannot be trusted with your API bill.

There is also an evaluation suite for people who want to measure, not just believe. Dexter ships evals that test the agent against a dataset of financial questions, using LangSmith for tracking and an LLM-as-judge approach for scoring correctness, with a live display of progress and running accuracy. Run `bun run src/evals/run.ts` for the full set, or add `--sample 10` for a quick sample.

Getting Started

The setup is short, but it needs API keys, so this is a project for people comfortable with a terminal. The prerequisites are the Bun runtime (version 1.0 or higher), an OpenAI API key, a Financial Datasets API key, and an optional Exa API key for web search. The environment template also lists Anthropic, Google, xAI, and OpenRouter keys, plus optional Ollama support for local models.

The steps, from the README:

  1. Clone the repository: `git clone https://github.com/virattt/dexter.git`

  2. Install dependencies: `bun install`

  3. Copy the example environment file: `cp env.example .env`, then fill in your keys

  4. Run it in interactive mode: `bun start`, or `bun dev` for watch mode during development

That is the whole install. The cost of running it is the cost of your model and data API usage, which is why the loop detection and step limits exist. Start with small questions, watch the scratchpad, and get a feel for how many steps a typical question takes before you point it at a whole watchlist.

Dexter on WhatsApp

The most surprising feature is also the most practical one. Dexter can run through WhatsApp: link your phone to the gateway with `bun run gateway:login`, start it with `bun run gateway`, then open your own WhatsApp chat, message yourself, and ask a question. The answer comes back into the same chat.

That turns a terminal tool into something you can use from your phone, and it fits how people actually follow markets: a question occurs to you during the day, you ask it where you already are, and the researched answer is waiting in the chat. It is the same agent, the same planning and validation, through a different front door. The README points to a dedicated WhatsApp gateway guide for detailed setup, configuration, and troubleshooting.

The Honest Limits

Dexter's README carries a disclaimer that deserves to be quoted, not softened: the project is for educational, entertainment, and informational purposes only, and it is not intended for real trading or investment. It is not financial, investment, tax, or legal advice, there are no guarantees of accuracy or completeness, outputs may be incorrect or out of date, and past performance does not indicate future results.

Those limits are not boilerplate. An agent that plans well can still work from a bad data point, misread a statement, or miss a restatement. The scratchpad helps you catch that, but only if you actually read it. Treat Dexter as a first draft of due diligence, a way to gather and organize the evidence, and then verify the numbers that matter before acting on them. For anything involving real money, the README's advice stands: consult a licensed financial advisor.

There is a practical limit too. Dexter is only as good as its data subscriptions and its model. Without a Financial Datasets API key there is no statement data, and without a model key there is no reasoning engine. This is not a free web app with a login button; it is a self-hosted tool with running costs, and that is the trade for keeping your research local and inspectable.

Who Should Try It?

Dexter fits investors and students who want to learn how fundamental research is actually done, because watching the plan unfold is itself an education in what to check. It fits analysts and fintech builders who want a starting point for due diligence or a component inside a larger research pipeline, since the tooling, the scratchpad, and the eval suite are all open. And it fits anyone who has ever pasted a ticker into a chatbot, gotten a confident answer, and wondered where the numbers came from.

It is less useful if you want stock tips, a trading bot, or a one-click answer with no homework. If you are wondering what open source means for a project like this, the earlier explainer What Is Open Source? covers the basics, including the MIT License that Dexter uses.

Frequently Asked Questions

What is Dexter?

Dexter is an open source autonomous agent for deep financial research. It plans multi-step investigations, gathers real financial data, validates its own findings, and reports a data-backed answer, in the terminal or through WhatsApp.

What data does it use?

Income statements, balance sheets, and cash flow statements through the Financial Datasets API, plus optional web search through Exa. The numbers come from data APIs, not from the language model's memory.

What do I need to run it?

The Bun runtime, a model API key (OpenAI by default, with Anthropic, Google, xAI, OpenRouter, and local Ollama options), and a Financial Datasets API key. Exa is optional, for web search.

Can it trade for me?

No. The README states it is for educational and informational purposes only, and it is not intended for real trading or investment. Use it for research, verify the numbers, and talk to a licensed advisor before making investment decisions.

How can I check its work?

Every query writes a scratchpad file to `.dexter/scratchpad/` with the query, each tool call and its raw result, and the agent's reasoning steps. Open that file and you can audit the whole investigation.

How much does it cost?

Dexter itself is free under the MIT License. Running it costs whatever your model provider and the Financial Datasets API charge, which is why the built-in step limits and loop detection matter.

The Bottom Line

Most AI finance tools give you a faster answer. Dexter gives you a better process: a plan, real data, self-checking, and a paper trail you can inspect. That is a smaller promise, and a more useful one. Clone it, ask it one hard question about a company you follow, read the scratchpad, and judge it by the evidence it shows you, not the confidence of its tone.

Read this article in Indonesian: Dexter: Agen AI Open Source yang Melakukan Riset Keuangan Mendalam Secara Otomatis.

Tags: open source · AI agent · finance · financial research · TypeScript

All posts