Inspiration

My father runs a consulting firm, so I have seen first-hand how many small and mid-sized consultancies still make important commercial decisions using fragmented data, manual spreadsheets, and outdated workflows.

The problem is not a lack of information. It is the difficulty of turning financial data into a consistent and auditable decision.

Consultants can spend hours collecting company information, rebuilding ratios, comparing businesses manually, and preparing reports. Smaller firms often do not have the internal data teams or software budgets available to larger consultancies, so selecting potential clients and identifying improvement opportunities can depend too heavily on intuition and repetitive work.

When I obtained access to a large business database covering companies across Spain and Portugal, I saw an opportunity to build more than another financial dashboard: a platform that could transform raw company data into reproducible competitive intelligence while keeping the consultant in control.

That became PeerScope.

What it does

PeerScope is an evidence-grounded financial analysis and reporting platform for consulting teams.

It allows a consultant to:

  1. Select a company and calculate a canonical financial score.
  2. Compare it with relevant sector peers.
  3. Identify strengths, weaknesses, and areas requiring further investigation.
  4. Ask an AI Analyst questions about the company.
  5. Generate a structured executive report.
  6. Edit the report conversationally while reviewing every proposed change.
  7. Preserve a traceable version history instead of overwriting previous work.

The controlled Build Week demo analyses AUXQUIMIA SAU using:

  • 29 chemical-sector KPIs
  • 1,777 companies in the sector dataset
  • 1,164 companies with valid canonical scores
  • a deterministic score of 83.86

PeerScope is designed to support consultants, not replace their professional judgement.

How we built it

PeerScope is built with Python, FastAPI, PostgreSQL, Supabase, Pydantic, JavaScript, HTML/CSS, pytest, Playwright, Render, and the OpenAI Responses API.

The financial scoring pipeline is deterministic. KPI definitions, weights, peer groups, percentiles, and the final company score are calculated outside the language model through a typed and versioned Sector Pack.

GPT-5.6 is used in two controlled workflows:

AI Analyst

The AI Analyst receives only a compact, company-scoped evidence packet.

Every factual claim, comparison, and recommendation must reference an approved evidence ID. PeerScope validates the structured response before displaying it, rejecting unsupported references and incompatible or invented quantitative claims.

Conversational report editing

GPT-5.6 returns structured, section-scoped patch operations instead of rewriting the entire report freely.

PeerScope validates the proposed changes, protects canonical financial figures, labels user-provided context as unverified, and displays a word-level diff before any edit is applied. Every accepted edit creates a new report version.

I used Codex as an engineering partner throughout the full development cycle. It helped with repository-wide audits, architecture, implementation, debugging, automated tests, security hardening, database migrations, production fixes, documentation, and release preparation.

Codex was particularly valuable for tracing changes across the data pipeline, API, interface, AI evidence, scoring system, and reports, where a small inconsistency in one layer could affect the entire product.

Challenges we ran into

The first major challenge was keeping the financial methodology consistent across the whole system.

A change to one KPI could affect:

  • data preprocessing;
  • company scoring;
  • peer benchmarking;
  • the API;
  • the interface;
  • the AI evidence packet;
  • and the final report.

The second major challenge was preventing plausible but unsupported AI output. In financial consulting, a fluent answer is not enough. The system needs to know exactly which evidence was authorized, which figures are valid, and when the model should abstain.

I therefore built deterministic validation around GPT-5.6, including approved evidence IDs, quantitative checks, adversarial evaluations, controlled repair, and safe rejection.

Production deployment introduced additional challenges involving authentication, tenant isolation, Supabase Row Level Security, database migrations, model timeouts, and evidence validation.

Accomplishments that we're proud of

During Build Week, PeerScope moved from an early prototype to a controlled end-to-end demonstration release.

The final release includes:

  • a reproducible chemical-sector scoring pipeline;
  • a typed and versioned 29-KPI Sector Pack;
  • evidence-grounded GPT-5.6 analysis;
  • deterministic validation of AI claims and figures;
  • safe abstention and rejection of unsupported output;
  • structured conversational report editing;
  • visible word-level diffs;
  • immutable report versions and restore;
  • authentication and tenant isolation;
  • production deployment on Render;
  • 316 passing automated tests.

In the controlled real AI evaluation, PeerScope accepted zero unauthorized evidence IDs and zero invented figures as verified output.

What we learned

The most important lesson was that adding AI to a professional workflow is not mainly about generating better prose.

It is about designing the boundary between probabilistic reasoning and deterministic software.

GPT-5.6 is valuable for interpreting evidence, identifying patterns, drafting hypotheses, and proposing report changes. Deterministic code must still control access, calculations, validation, provenance, and whether a change is ultimately applied.

I also learned that Codex is most powerful when used throughout the engineering process, not only for isolated code generation. It helped me understand the existing system, detect inconsistencies, implement bounded fixes, create tests, debug production failures, and prepare a reliable release.

What's next for PeerScope

PeerScope currently supports one validated Chemical Sector Pack.

The next steps are:

  • adding new sector-specific KPI packs;
  • expanding adversarial and regression evaluations;
  • improving consultant collaboration and approval workflows;
  • adding production observability and cost monitoring;
  • refining the interface for international users;
  • testing PeerScope with real small consulting teams.

The long-term goal is to give smaller consultancies access to structured, data-driven competitive intelligence that has traditionally required large internal analytics teams.

Built With

Share this project:

Updates