Skip to content
Ali Zarreh
Live demo Finance

DualLens Analytics

Company analysis through two lenses: the financials, and what the company says about AI.

An investment-research prototype that pairs Yahoo Finance metrics with AI-strategy insights retrieved from company reports through RAG. Every answer is scored for groundedness and relevance by an LLM judge, and companies can be compared and ranked on both lenses.

automated tests
36+
analysis views
4
groundedness & relevance score on every answer
1–5
DualLens Analytics financial dashboard comparing stock-price trends for GOOGL, MSFT, IBM, NVDA and AMZN

Why it exists

Analysts increasingly need to judge two very different things about a company at once: its financial health, which lives in structured market data, and its AI strategy, which lives in long, unstructured reports. The first is easy to chart. The second usually means reading dozens of pages per company — and LLM summaries of those pages are only useful if you can tell when they are grounded in the source.

DualLens puts both lenses in one place and makes the quality of every generated answer visible.

How it works

  1. 01 Input Company reports (PDF)
  2. 02 Code Chunk & embed 1,000-token chunks, 200 overlap
  3. 03 Model / AI Retrieve & answer top-k from ChromaDB
  4. 04 Check LLM-as-judge groundedness & relevance, 1–5
  5. 05 Code Market metrics Yahoo Finance
  6. 06 Output Compare & rank
In order · Code Model / AI Independent check
  • Quantitative lens: stock prices and key financial metrics come straight from Yahoo Finance and are charted with Plotly — no model involved.
  • Qualitative lens: company AI-initiative reports are parsed, split into overlapping token-based chunks and embedded into ChromaDB. Questions are answered from the most relevant chunks.
  • Every answer is judged. A separate LLM-as-judge step scores each response for groundedness and relevance on a 1–5 scale, with a written justification shown next to the answer.
  • Four views: a financial dashboard, a chat-style Q&A over the reports, a side-by-side company comparison, and a composite ranking that blends financial health with an LLM-assessed AI-strategy score, each with its justification.

Results and honest limits

  • Delivery: a live Streamlit app with four analysis views, a documentation site, and a configurable company list (by default GOOGL, MSFT, IBM, NVDA and AMZN).
  • Quality gates: 36+ automated tests covering configuration, data processing, evaluation logic and financial calculations, plus lint and format checks in a single make check.
  • Configuration: chunking, retrieval depth, models and companies are set in Hydra config rather than in code.

Engineering decisions

  • Keep the numbers out of the LLM. Financial metrics are fetched and computed in code; the model only works with the unstructured reports.
  • Evaluate every response, visibly. Groundedness and relevance are surfaced to the user instead of being hidden in logs.
  • Token-aware chunking with overlap, so retrieval does not cut context at arbitrary character boundaries.
  • Externalized configuration with Hydra, so experiments with chunking and retrieval are reproducible config changes.

Who it’s for

For research and strategy teams, it is a pattern for combining structured data with retrieval over documents while keeping answer quality visible. For AI teams, it shows a lightweight way to put LLM-as-judge evaluation in front of users rather than only in offline tests.

All case studies
Credit Decisioning review page showing the model's reasons and the eight notice-verification checks
Live demo Finance

Credit Decisioning

A calibrated credit model, notices written by code from a reviewed template, an independent eight-check verifier proven by mutation testing, and a human who makes the call. A read-only AI analyst explains cases — and code checks every number it states.

  • Evaluation & guardrails
  • Fairness & explainability
  • Machine learning
Trade Surveillance Agent sample case: a synthetic Chief Financial Officer sale two days before earnings, with a research-prototype notice
Live demo Finance

Trade Surveillance Agent

An AI investigator for SEC Form 4 insider filings. It gathers evidence, drafts a finding, checks every claim against what it actually retrieved, and hands a clear, flag or escalate outcome to a human — while openly reporting where its accuracy still falls short.

  • Agentic AI
  • Evaluation & guardrails
Clinical Care Navigator home page with the four-step guardrail flow: pre-flight screen, record lookup, post-flight check, and publish, hold or replace
Live demo Healthcare

Clinical Care Navigator

An assistant that explains a patient's own record, with independent safety checks before and after the AI. Dosing questions are refused, emergencies get urgent guidance, and answers that conflict with the record — such as a critical lab value — are overridden and sent to a clinician.

  • Evaluation & guardrails
  • Agentic AI
  • RAG & retrieval

Open to consulting, advisory roles and select projects.

Building AI that has to be right?

I help teams design systems with verifiers, guardrails and human review built in from the start — not bolted on after the demo.

Search zarreh.ai