← Back to projects

Project 03

Football AI Assistant

A full-stack football analysis interface with structured prompting and live context for time-sensitive questions.

What it is

Football Brain lets users ask about tactics, players, matches, and comparisons. A Next.js interface sends questions to a NestJS API, which produces focused football analysis with the OpenAI Responses API.

Why I built it

Football questions mix timeless tactical analysis with rapidly changing facts. The application treats them differently so current claims can be verified instead of guessed.

What I implemented

  • Built the Next.js Q&A interface with loading, validation, error, and response states.
  • Created the NestJS endpoint and OpenAI service layer.
  • Wrote tactical system instructions that distinguish verified facts from analysis.
  • Implemented freshness detection for matches, injuries, transfers, form, lineups, and current statistics.
  • Added conditional web search, failure disclosure, CORS configuration, and freshness-classification tests.

How it works

  1. 01

    Ask

    The client validates a football question and posts it to the NestJS API.

  2. 02

    Check freshness

    Football-specific patterns determine whether current information is required.

  3. 03

    Retrieve context

    Time-sensitive questions trigger a compact, sourced web-search briefing; timeless questions skip it.

  4. 04

    Generate

    The service combines the date, live context, question, and tactical instructions before returning the answer.

Important features

  • Football-focused analysis
  • Conditional live search
  • Tactical system guidance
  • Verified-fact and analysis separation
  • Disclosure when live facts cannot be verified
  • Client loading and error states
  • Tested freshness classification

Technical challenges

Detecting stale knowledge risk

A dedicated classifier recognizes language about current form, fixtures, injuries, transfers, statistics, and other changing topics.

Failing safely

If required live retrieval fails, the service directs the model to disclose the limitation instead of guessing.

Keeping analysis specific

The system prompt emphasizes relevant tactical concepts and direct answers rather than generic biographies.