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



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
Intake UI
Next.js 15 App Router · React 19 · Live agent progress over Server-Sent Events
Extraction
One Claude call with structured outputs · Zod schema · 2 to 5 follow-up questions
Assessment agent
Hand-rolled streaming tool loop · Strict, Zod-validated tools · 6-turn budget
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
Key decisions
- 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.
- 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.
- 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.
- 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.
- 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?