FinAgent

What happens behind an answer

Live stats

Polled from /api/stats every 5s

0
requests ok
0
requests errored
avg latency
0
tool calls

Stack

Every entry here is wired into running code on this page, not a bullet list — hover the "how" line for the actual mechanism.

Agentic systems & workflow patterns
Agentic AI system (LangGraph router → tools → synthesizer) MCP server patterns (same tools, dual-served) Ray-parallelized workflows (eval + canary + optimizer fan-out) Multi-backend runner (Anthropic + Bedrock, swappable) Mixture-of-experts agent (dispatcher gates 3 scoped experts) Prompt optimization (propose → score → adopt; 50% → 88% on a real run) Retrieval-augmented generation (chunk → embed → vector search over real filings) Adversarial user-simulation testing (LLM personas + critic find real bugs)
Development
  • Pythonthe entire app — agent, tools, API, training, IaC glue
  • BashAirflow's BashOperator invokes finagent canary across environments
  • LangGraphthe router/tools/synthesizer agent graph
  • LangChain@tool decorator, message types, LangFuse callback integration — shared plumbing across both agents
  • FastAPI/api/ask, /api/redteam/*, /api/stats, and the static web UI
  • PyTorchfinagent train — real SFT loop on judge-graded transcripts
  • sentence-transformerslocal embedding model for filing_search — no API key, runs on CPU
Infrastructure
  • Rayparallel eval/canary case execution
  • Kubernetes / EKSJsonnet-rendered manifests, deployed & verified on a local kind cluster
  • AirflowDAG schedules the nightly canary job
  • Jsonnettemplates the k8s manifests for local/prod
  • TerraformEKS/IAM/SageMaker/S3, validate-clean, unapplied (no AWS account)
  • Dockerapp image, built and run locally
  • Chromapersistent local vector database backing filing_search
Ops
  • Git / GitHub ActionsCI: lint + full test suite on every push
  • AWS (Bedrock, SageMaker)Bedrock model backend + SageMaker training role, real code, no live account
  • LangFusetraces every LLM call, tagged by environment
  • Sentryexception capture, wired into CLI + web
  • Prometheus/metrics — the live stats above come from here; 4 alert rules fire through Alertmanager + Pushgateway
  • Grafana8-panel dashboard on Prometheus, verified with real data
  • Weights & Biasesevery eval + optimizer run logged with pass rate + git SHA

Request pipeline

A LangGraph state machine: every question flows through these nodes.

Client
CLI · Web UI · MCP client
Router
Claude decides which tools to call
Tool execution
runs the selected tools below
Synthesizer
Claude writes the grounded answer
Client
answer + tools used

Retrieval pipeline

filing_search, on first use for a given company + form type: fetches the real filing document (not just its metadata), then chunks, embeds, and stores it locally.

SEC EDGAR
fetch the actual filing document
Chunk
section-aware (Item 1A, Item 2, ...), sliding-window fallback
Embed
sentence-transformers, local, no API key
Chroma
persistent local vector store
Search
top-k passages, section + source cited

Tools

The same functions back the agent and the standalone MCP server.

edgar_filings

→ SEC EDGAR (data.sec.gov)

0 calls since server start
price_history

→ Yahoo Finance (yfinance)

0 calls since server start
fundamental_ratios

→ Yahoo Finance (yfinance)

0 calls since server start
filing_search

→ local vector index (Chroma + sentence-transformers) over real SEC filing text

0 calls since server start
company_news

→ Yahoo Finance (yfinance)

0 calls since server start
executive_profile

→ Yahoo Finance (yfinance)

0 calls since server start

Observability

How we keep track of what the app is doing, so problems get caught instead of going unnoticed.

LangFuse

Keeps a step-by-step record of how the AI arrived at each answer — like a flight recorder, so anyone can retrace exactly what it did and why.

Prometheus

Keeps score of how the app is performing: how many questions it's answered, how fast, and how often something goes wrong. The live numbers below come from here.

Sentry

Automatically flags it when something breaks, so issues get noticed and fixed quickly instead of failing silently.

Weights & Biases

Keeps a report card of how accurate the AI's answers are over time, so we can tell whether a change made it better or worse before anyone else sees it.