Originally published on andrew.ooo — visit the original for any updates, code snippets that aged out, or follow-up posts.
TL;DR
Dexter is an open-source autonomous agent built specifically for deep financial research — think Claude Code, but it lives inside SEC filings, income statements, and live market data instead of your codebase. Released by virattt (the same developer behind the popular ai-hedge-fund project), it landed on GitHub Trending this week with 3,108 new stars in 7 days, pushing the repo to 24,801 total stars.
What makes it different from ChatGPT-with-a-finance-prompt:
- Plans before it acts. Dexter decomposes a question like "How has Apple's free cash flow conversion compared to Microsoft over the last 5 years?" into structured research steps, not a single chat turn.
- Self-validates. After each tool call it checks its own work, iterates, and won't return until the plan is confidently complete.
- Real market data, not generic web scrape — pulls income statements, balance sheets, and cash flow statements via the Financial Datasets API.
- WhatsApp-native. A built-in gateway lets you message Dexter from your own WhatsApp chat and get researched answers back in the same thread.
- Loop detection + step limits built in to prevent runaway token spend.
- MIT license, TypeScript, runs on Bun.
If you've been hand-rolling LangChain agents for stock research and getting frustrated by hallucinated EBITDA numbers, Dexter is the most polished open-source attempt at this niche right now. Below is what it actually does, how to run it, what it costs, and where it falls short.
Quick Reference
| Field | Value |
|---|---|
| Repo | virattt/dexter |
| Stars | 24,801 (3,108 this week) |
| License | MIT |
| Language | TypeScript |
| Runtime | Bun v1.0+ |
| LLM providers | OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama |
| Data API | Financial Datasets (paid) |
| Web search | Exa (preferred) or Tavily (fallback) |
| Interfaces | CLI (interactive), WhatsApp gateway |
| Eval framework | LangSmith + LLM-as-judge |
| Author | @virattt |
| Discord | discord.gg/jpGHv2XB6T |
What Dexter Actually Does
A working session looks roughly like this. You start the agent with bun start and ask:
"Compare Apple and Microsoft's gross margin trend over the last 5 years and tell me which one has more pricing power."
Dexter doesn't just hit one tool. It plans:
- Plan step: "I need 5 years of income statements for both AAPL and MSFT, then I need to compute gross margin = (revenue – cost of revenue) / revenue, then compare the trend lines, then form a qualitative judgment about pricing power."
-
Execute step 1: calls
get_income_statements({ ticker: "AAPL", period: "annual", limit: 5 }). -
Execute step 2: calls
get_income_statements({ ticker: "MSFT", period: "annual", limit: 5 }). - Reflect: "Do I have enough data? Yes. Are the units consistent? Yes. Is there a confounder I'm missing — say, segment mix shift?" Maybe it then pulls revenue-by-segment to be safe.
- Synthesize: computes the margins, ranks them, writes a paragraph with the actual percentages and trend, and flags caveats.
- Return with a final answer plus the trail of tool calls used.
Every tool call, argument, raw result, and LLM summary gets logged to a JSONL scratchpad in .dexter/scratchpad/<timestamp>_<id>.jsonl. That's the part that earns the "Claude Code, but for finance" comparison — it's not just an answer, it's an auditable research trail.
Why It's Trending NOW
Three forces are pushing Dexter's star count this week:
- The "agent for X" wave finally hits finance. 2026 has been the year of vertical agents — coding agents, financial agents, research agents. After TauricResearch/TradingAgents (also on GitHub Trending this week with 14k new stars) showed there's a real audience for finance-specific multi-agent frameworks, Dexter's narrower research angle picked up the spillover demand.
- virattt has earned trust. His earlier project, ai-hedge-fund, is one of the most-starred AI-finance repos on GitHub. People who liked that project show up to star whatever he ships next.
- It's actually functional, not a demo. A lot of "agent for finance" repos this year were single-prompt LangChain wrappers. Dexter ships planning, self-validation, an eval suite, a WhatsApp gateway, and loop detection. That's "I use this myself" software, not "I built this for the README" software.
The Hacker News discussion and aitoolly coverage on May 8 called out the same thing: it's a self-correcting system, not a question-answering one.
Architecture: How the Agent Loop Works
Dexter uses a classic plan → act → reflect → iterate loop, but with two important details that prevent the typical agent failures:
1. Step limits and loop detection
Every Dexter run has a hard step ceiling. If the agent is still working after N steps, the run halts and returns whatever progress was made. There's also a loop detector that watches the recent tool-call history — if it sees the same tool called with the same arguments three times in a row, it forces the agent into "wrap up" mode. This is the practical fix for the most common autonomous-agent failure (looping on a hallucinated tool call until you run out of tokens).
2. The scratchpad as memory
Instead of stuffing every prior tool result into the LLM context (which blows up cost and degrades attention), Dexter keeps the full result on disk in the scratchpad and feeds the LLM only an llmSummary — a short summary the LLM itself generated when the tool returned. This is the same compaction strategy Claude Code uses for long sessions, and it's why Dexter can run for 20+ tool calls without running out of context.
A scratchpad entry looks like this:
{
"type": "tool_result",
"timestamp": "2026-05-08T11:14:05.123Z",
"toolName": "get_income_statements",
"args": { "ticker": "AAPL", "period": "annual", "limit": 5 },
"result": { /* full JSON from Financial Datasets API */ },
"llmSummary": "Retrieved 5 years of Apple annual income statements showing revenue growth from $274B to $394B"
}
When the agent later asks itself "what did I learn about Apple's revenue?", it pulls the llmSummary into context, not the 50KB of raw JSON.
Getting Started: Real Install
You'll need three API keys minimum:
- OpenAI (platform.openai.com/api-keys) — or any other supported provider
- Financial Datasets (financialdatasets.ai) — for the actual market data
- Exa (exa.ai, optional) — for web search beyond filings
Install Bun first if you don't have it:
curl -fsSL https://bun.com/install | bash
bun --version # should be 1.0+
Then clone and configure:
git clone https://github.com/virattt/dexter.git
cd dexter
bun install
cp env.example .env
# edit .env:
# OPENAI_API_KEY=sk-...
# FINANCIAL_DATASETS_API_KEY=...
# EXASEARCH_API_KEY=... (optional)
Run it interactively:
bun start
You drop into a REPL. First prompt to try:
> What was Tesla's free cash flow in 2024 and how did it compare to 2023?
Watch the agent print its plan, then each tool call, then the final answer. The scratchpad file at .dexter/scratchpad/<timestamp>.jsonl is your audit trail — open it in a JSON viewer to see exactly what data the agent gathered.
Running a Custom Query Programmatically
The interactive REPL is great for exploration, but for any real workflow you'll want to drive Dexter from code. The TypeScript API looks roughly like this (based on the public exports — check the repo for current signatures):
import { runAgent } from "./src/agent";
const result = await runAgent({
query: "Compare AAPL and MSFT gross margin trends over the last 5 years",
maxSteps: 20,
model: "gpt-5-mini",
});
console.log(result.finalAnswer);
console.log(`Used ${result.toolCallCount} tool calls`);
console.log(`Scratchpad: ${result.scratchpadPath}`);
If you want to wire Dexter into Slack, a cron job, or a custom dashboard, this is the entry point. The scratchpad path is your friend for debugging weird answers.
WhatsApp Mode (The Killer Feature)
This is genuinely clever. Dexter ships a gateway that links to your WhatsApp account via QR code, then listens for messages you send to your own number ("message yourself" chat). When you message yourself, Dexter processes the question and replies in the same chat.
# Link your WhatsApp account
bun run gateway:login # scan the QR
# Start the gateway
bun run gateway
Now from anywhere — phone, laptop browser, smartwatch — you message yourself "what was NVDA's gross margin last quarter?" and Dexter answers in WhatsApp a few seconds later. No new app to install, no notifications to manage, no UI to design.
The implementation lives in src/gateway/channels/whatsapp/ and uses the same "self-chat as inbox" pattern several recent agent projects have adopted (it's a great UX hack — your phone already has the perfect chat UI).
Evaluation Suite
Most agent repos either skip evals entirely or hand-wave with "it works on my machine." Dexter ships a real eval runner:
bun run src/evals/run.ts # all questions
bun run src/evals/run.ts --sample 10 # random 10
The runner displays a live UI showing progress, the current question, and running accuracy stats. Results stream into LangSmith and use an LLM-as-judge approach: a separate (and typically stronger) model grades whether Dexter's answer is correct against the reference. This is the same eval pattern OpenAI Evals and Anthropic's MCP eval kit use, and it lets you measure regressions when you swap models or change the agent loop.
If you fork Dexter for a different domain (e.g., legal research, medical literature), keeping this eval scaffolding intact is probably the most important thing you can do.
Real Costs
A single non-trivial financial research query (5–10 tool calls, 3–5 LLM turns) on gpt-5-mini runs roughly:
- OpenAI tokens: $0.02–$0.10 per query
- Financial Datasets API: included in their tiered pricing — the free tier covers light personal use; production teams will want at minimum the paid tier
- Exa search: $0.005 per query if used
So ~$0.10 per deep query is a reasonable rough budget. If you swap to gpt-5 or claude-opus-4, multiply by 5–10x. For comparison, a Bloomberg Terminal seat is ~$24,000/year, so the unit economics of running Dexter on top of public APIs are remarkable — but the coverage is nowhere near a Bloomberg Terminal.
Honest Limitations
Where Dexter genuinely falls short — and these are not small caveats:
- Data is US-equities-heavy. Financial Datasets covers US public companies well. International coverage, private markets, fixed income, and derivatives are limited. If you need EU/Asia equities or anything alternative, you'll be writing your own tool integrations.
- No price/quote tools out of the box. It's deliberately a fundamental research agent — income statements, balance sheets, cash flows. Not a quant trading bot. Don't expect minute-bar OHLC data without adding tools yourself.
- LLM math errors still happen. Even with self-reflection, GPT-class models occasionally fumble multi-year compound growth calcs. Always spot-check the final number against the scratchpad data.
- No risk-of-hallucination guarantees. The agent will sometimes invent context ("the company guided to 8% growth in their Q3 call") that isn't in the actual data. Self-reflection helps but doesn't eliminate this. Treat output as a research draft, not a memo.
- Single-agent. Unlike TradingAgents, there's no multi-agent debate or specialist roles. Sometimes that's a feature (simpler), sometimes a limitation (no built-in adversarial review).
- Bun-only runtime. If your team is locked into Node.js LTS or Deno, the Bun dependency is a friction point.
- Not a replacement for human judgment. "Should I buy this stock?" is the wrong question to ask Dexter. "Show me the underlying numbers I'd need to answer that question" is the right one.
Dexter vs. The Alternatives
| Tool | Focus | Multi-agent | Eval suite | License |
|---|---|---|---|---|
| Dexter | Deep research per query | No | ✅ LangSmith | MIT |
| TradingAgents | Trading decisions | ✅ Roles | Limited | Apache-2 |
| ai-hedge-fund | Portfolio simulation | ✅ Personas | ❌ | MIT |
| FinRobot | Workflow framework | ✅ | Limited | Apache-2 |
Dexter's lane is deep research per question. If you want a portfolio simulator with Buffett/Munger/Ackman personas debating, use ai-hedge-fund. If you want a trading multi-agent system, use TradingAgents. If you want to ask "did this company's working capital deteriorate this quarter?" and get a defensible, auditable answer with the actual numbers, Dexter is the right choice.
Community Reactions
Early reception (May 2026):
- Reddit r/algotrading and r/financialindependence: generally positive on the planning architecture; main complaint is the Financial Datasets dependency rather than free SEC EDGAR fetching
- HN front page commenters: asked the obvious question — "isn't this just an LLM with function calling?" — and the maintainer's response that the self-reflection + step limit + scratchpad combination makes the difference is the right answer
- Twitter/X: @virattt's announcement generated active threads about extending Dexter to alternative data and ESG research
The most common feature request is multi-ticker batch mode — run the same research template across 50 stocks overnight. That's a natural extension of the existing eval runner.
FAQ
Is Dexter free to use?
The agent code itself is MIT-licensed and free. You'll pay for the underlying APIs: OpenAI/Anthropic/etc. tokens, Financial Datasets data, and optionally Exa search. A reasonable personal-use budget is $10–$30/month.
Does Dexter work with local models like Ollama?
Yes — set OLLAMA_BASE_URL=http://127.0.0.1:11434 in .env. Realistically, the planning + self-reflection loop needs a strong reasoning model, so Llama 3.3 70B or Qwen 2.5 72B-Instruct is the floor. Smaller models hallucinate tool calls and break the loop.
Can I add my own tools?
Yes. The tool registry is straightforward TypeScript — write a tool definition with a JSON schema, wire it into the agent's tool list, and the planner will start using it. The README points to src/tools/ as the place to add new ones.
Is this safe to use for actual investment decisions?
No. Dexter is a research assistant, not investment advice. Use it to surface and summarize underlying data faster, but always verify numbers against primary sources (10-K, 10-Q, earnings calls) before acting on them.
How does it compare to ChatGPT with web browsing?
ChatGPT's browse mode is one-shot and stateless. Dexter plans across multiple tool calls, validates its own work, and gives you an auditable trail. For "what's Apple's PE ratio?" both work fine. For "compare 5-year free cash flow conversion across FAANG" Dexter is meaningfully better.
Can I run Dexter on a server / in production?
Yes — the WhatsApp gateway is designed for that. Run bun run gateway on a small VPS, point your phone at it, and you have a production research bot. Set step limits aggressively (max 15 steps) to bound cost.
Should You Try It?
Yes, if:
- You research public US equities regularly and want to automate the data-gathering portion
- You want an auditable AI workflow (the scratchpad is the killer feature for compliance-conscious teams)
- You like clean TypeScript codebases and don't mind Bun
- You'd use the WhatsApp gateway as a pocket research assistant
Skip it if:
- You need international equities, fixed income, or derivatives coverage
- You want a chat UI more than a research engine
- You can't justify the API costs ($10–$30/month minimum for active use)
Next Steps
- Star the repo — github.com/virattt/dexter — and join the Discord
- Run the eval suite with your own model picks and post the results — this is the most valuable contribution right now
- Fork it for a new domain. The architecture (planner + scratchpad + self-reflection + step limits) is reusable. A "Dexter for legal research" or "Dexter for biotech literature" using the same pattern + a different tool set is a weekend project.
Dexter is one of the cleanest examples of the "vertical agent" pattern shipping in May 2026. Whether you use it directly or steal the ideas, it's worth an hour of your time.
Was this review useful? Got questions about running Dexter against a specific dataset or model? Hit reply — I read every email.
Top comments (0)