virattt /
dexter
A terminal agent that plans and runs financial research using live market data
- 27.7k stars
- 59 stars since 3 Oct
- TypeScript
- Updated 29 days ago
- Some experience
- AI agents
Financial questions are rarely one lookup. You might need several years of income statements, a cash flow comparison, and some web research before you can answer. Dexter handles that chain. It takes a question, writes a research plan, and works through it.
It runs in your terminal. For each step it picks a tool, such as one that fetches income statements, balance sheets or cash flow statements from the Financial Datasets API. It reviews what it found and keeps going until the task is done. Loop detection and step limits stop it from running forever.
The README describes it as Claude Code built for financial research. It works with several model providers (OpenAI, Anthropic, Google, xAI, OpenRouter, or local Ollama). It logs every tool call to a file so you can see what it did. The authors say it is for education and information only, not for real trading or investment advice.
What it does
Task planning
Turns a complex financial question into a list of structured research steps.
Live financial data
Fetches income statements, balance sheets and cash flow statements through the Financial Datasets API. Optional web search uses Exa, with Tavily as a fallback.
Self-checking loop
Reviews its own work and iterates until the task is complete. Loop detection and step limits guard against runaway runs.
Scratchpad logs
Each query writes a JSONL file in .dexter/scratchpad/ with the original query, every tool call and result, and the agent's reasoning.
Evals and WhatsApp
Includes an evaluation suite that scores answers with an LLM judge and tracks runs in LangSmith. You can also chat with it through a WhatsApp gateway.
What you could build
- Ask for a multi-year comparison of a company's revenue and cash flow and get a step-by-step researched answer.
- Study how a planning, tool-using, self-checking agent is built in TypeScript.
- Inspect scratchpad logs to see exactly which data the agent fetched and how it summarised it.
- Run the evaluation suite to measure how well a model answers financial questions.
- Message yourself on WhatsApp to put research questions to the agent from your phone.
Get started
Install Bun, clone the repo and run bun install. Copy env.example to .env and add your model provider key and a Financial Datasets API key (an Exa key is optional for web search), then start it with bun start.
git clone https://github.com/virattt/dexter.gitbun installbun startCommands are copied from the project's README. Read it on GitHub for the full setup.