All projects

Beta

Counterargument

Backend / AI

Practise English through AI-powered negotiations. The characters improvise; the server enforces the rules.

NEGOTIATIONSo. What's your offer?
Your next move is Open live beta

AI characters. Server-owned rules.

Make an offer, challenge an argument, and work towards a deal—in English. Counterargument combines a branching story with AI-driven negotiations, limited turns, and resources that make each decision matter.

The characters improvise their dialogue. The backend defines the scene structure, validates offers, and enforces the requirements for progression.

Handling prompt injection and invalid output

Player messages and model responses are treated as untrusted input. Before a response can affect progress, the backend checks its structure and gameplay constraints—including invented player offers, invalid counteroffers, and acceptance decisions that conflict with price or progression requirements.

These controls limit the impact of prompt injection and inconsistent model output. They do not guarantee that every NPC sentence is factually correct or that model-based language assessments cannot be manipulated.

Two providers, one game contract

Groq is the primary LLM provider, with an optional DeepSeek fallback. Both use the same response contract and server-side validation. Switching providers changes neither the authored scene structure nor the rules used to validate gameplay, though dialogue, language assessments, and the course of a negotiation can differ.

Invalid outputs trigger a limited retry and, when configured, a fallback. If neither provider returns a valid response, the game preserves the player’s turn and progress instead of applying an unchecked result.

Progress, diagnostics, and learning data

  • Persistent state: PostgreSQL stores player profiles, authentication sessions, and game progress.
  • LLM diagnostics: provider failures, fallback events, and validation failures are logged with diagnostic metadata, without raw dialogue, tokens, or cookies in those entries.
  • Opt-in learning records: a separately enabled collection pipeline can save eligible negotiation attempts for future analysis, subject to user consent, local checks, model-based screening, and deduplication. This is not a guarantee that all personal information will be detected.
  • Encrypted backups: scheduled backup tooling supports age-encrypted PostgreSQL backups and optional upload to OCI Object Storage.

Engineering behind the game

  • React · TypeScript · Vite — browser interface and API interactions.
  • Python · FastAPI · Pydantic — API, request validation, and structured LLM response checks.
  • PostgreSQL · SQLAlchemy · Alembic — persistent state and database migrations.
  • Redis — game-operation locks and request limits.
  • Groq · DeepSeek — primary and optional fallback LLM integrations.
  • Docker Compose · Nginx · GitHub Actions — containerized deployment, HTTPS, and release workflows.
  • pytest · Vitest · Playwright — backend, frontend, and browser-level checks.

Scope and ownership

Live beta. Solo project with AI-assisted development, covering product direction, game mechanics, backend, client integration, and deployment. Personalized Lab exercises remain future work; the learning-data pipeline is groundwork, not a completed learning mode.