Teemu Iljin

Case study

AI Idea Prioritisation Platform

Turns business ideas written in plain language into ranked, review-ready proposals. A Claude agent fills in the missing facts, flags duplicates, estimates the value and scores each idea by priority.

Role
Personal project
Year
2026
Review step: a possible-duplicate warning, the AI assessment with value and feasibility scores, and the value calculation
Pipeline page with a value and feasibility prioritisation matrix
Ideas ranked by priority score on a value/feasibility matrix
AI insights page with success rate, latency and cost metrics
AI insights: success rate, p95 latency, cost per idea, cache hit rate

The problem

Business ideas usually arrive as a few vague sentences. Review boards then chase missing facts by email, miss that the same idea was already submitted elsewhere, and rank proposals on gut feel.

The goal was an intake flow where an employee just describes the idea, AI asks only for what's missing, and every idea reaches the board with consistent facts, a duplicate check, a reproducible value estimate and a priority score.

Architecture

  1. Intake UI

    Next.js 15 App Router · React 19 · Live agent progress over Server-Sent Events

  2. Extraction

    One Claude call with structured outputs · Zod schema · 2 to 5 follow-up questions

  3. Assessment agent

    Hand-rolled streaming tool loop · Strict, Zod-validated tools · 6-turn budget

  4. Data

    PostgreSQL + pgvector (PGlite locally) · 384-dim embeddings, HNSW index · Drizzle migrations

  • find_similar_ideas

    Vector search for duplicates

  • calculate_annual_value

    Deterministic maths, shows its formula

  • submit_assessment

    Typed final answer

  • Observability

    Tokens, cost, latency per call

Requests flow from the React designer through Nginx to the Spring Boot API and PostgreSQL. Supporting services on the right handle live updates, notifications, integrations and delivery.

Key decisions

  1. 01

    Split cheap extraction from a tool-using agent

    Extraction is one well-specified call with a constrained schema, so it stays fast, cheap and easy to evaluate. Only the assessment, which needs pipeline data and exact arithmetic, runs as an agent with tools.

  2. 02

    A manual agent loop instead of a framework

    Owning the loop makes it possible to stream every step to the browser, cap the agent at six turns, turn malformed tool input into an error the model can fix, and stop the moment the final assessment arrives.

  3. 03

    Numbers come from code, not the model

    The value calculator and the WSJF priority formula are deterministic, unit-tested code. The model supplies judgement; every euro figure and ranking can be reproduced from its inputs and explained line by line.

  4. 04

    Guardrails and validation on both sides

    Employee text is fenced and declared as data to resist prompt injection, model output is normalised and re-validated with Zod, and the same schema validates the form in the browser and on the server. AI routes are rate-limited.

  5. 05

    Measured cost, latency and quality

    A stable prompt prefix is cached, every call logs tokens, cache hits, latency and cost, and golden-case evals grade extraction and the agent, including injection resistance and invented numbers.

At a glance

3
Strict agent tools: duplicate search, value calculator, typed submission
34
Unit and integration tests, plus Playwright end-to-end tests on desktop and mobile
384
Dimension embeddings, computed in-process with no extra API key
0
Setup needed to run locally: embedded Postgres and a mock AI mode

Tech stack

  • Claude API
  • Next.js 15
  • React 19
  • TypeScript
  • Zod
  • Drizzle ORM
  • PostgreSQL + pgvector
  • Transformers.js
  • Vitest
  • Playwright
  • GitHub Actions
  • Docker

Want the details?