Inspiration

Detective stories are compelling because every conversation can reveal a contradiction, hidden motive, or emotional response. We wanted to recreate that feeling with generative AI:not as a conventional chatbot, but as an interactive investigation where suspects respond naturally, maintain distinct personalities, and react to pressure.

That idea became dossier, an AI-powered detective game where every case can introduce a new crime, cast of suspects, evidence trail, and culprit. Players investigate the case, interrogate suspects through text or live voice, and submit a final verdict.

What it does

Dossier generates replayable mystery cases with:

  • Unique case briefings, suspects, motives, alibis, and evidence
  • AI-generated suspect portraits
  • Text and real-time voice interrogations
  • Emotionally expressive suspect responses
  • Distinct voices selected according to each suspect
  • Interruptible voice conversations that feel more natural
  • Evidence presentation during interrogations
  • Trust and patience mechanics
  • Final accusations, case resolutions, scoring, and leaderboards

Each suspect only knows what their character should know. Innocent suspects attempt to defend themselves, while the culprit must conceal the truth without immediately revealing the answer.

How we built it

The frontend is a React and TypeScript single-page application built with Vite. We used React Router for navigation, Zustand for client state, Clerk for authentication, and Lucide for interface icons.

The backend is a FastAPI application responsible for authentication, case management, investigations, interrogations, scoring, and AI-provider integration. MongoDB Atlas stores generated cases, suspects, evidence, conversations, investigations, and player profiles.

Gemini generates structured mysteries and powers character-aware interrogations. Generated cases are validated before storage to ensure that they contain a culprit, appropriate evidence, and a playable collection of suspects. The number of suspects scales with case difficulty while remaining inside configurable minimum and maximum limits.

ElevenLabs provides speech synthesis and real-time voice functionality. Suspects receive different voices, and supported expressive cues help communicate emotions such as nervousness, anger, hesitation, or whispering. Voice sessions support interruption, allowing the player to speak naturally instead of relying on push-to-talk controls.

Replicate generates noir-style suspect portraits, while Cloudinary provides persistent media storage. The frontend is deployed with Vercel, the FastAPI backend runs on Railway, and MongoDB Atlas provides the cloud database.

Challenges we faced

One major challenge was making voice interrogation feel like a conversation instead of alternating audio clips. We had to handle microphone permissions, streaming connections, interruptions, session cleanup, voice selection, and graceful fallback to text chat.

Emotional speech introduced another complication. Some ElevenLabs models support expressive cues differently, while others literally read the tags aloud. We tested multiple models and adjusted how responses and speech instructions were handled so internal performance cues would not accidentally become visible dialogue.

Generating coherent mysteries was also difficult. A case must be creative while remaining logically solvable. The culprit, motive, alibi, evidence, and witness knowledge all need to agree. We introduced structured generation, validation, configurable difficulty ranges, and prompt constraints to improve consistency without repeatedly regenerating cases and exhausting limited API credits.

Deployment exposed additional real-world issues. We configured SPA routing so refreshing a nested page would not return a 404, separated frontend and backend URLs, secured Clerk authentication, configured CORS, and connected Railway to MongoDB Atlas. Diagnosing an Atlas TLS failure required tracing production logs back to its network access configuration.

What we learned

We learned that building an AI experience requires more than connecting a language model to a chat interface. The surrounding system—character boundaries, persistent state, validation, latency, error handling, media storage, and deployment configuration—determines whether the result feels believable.

We also learned to treat generated content as untrusted structured input. Even when a model follows a detailed schema, the application still needs to validate relationships and enforce gameplay rules.

Finally, we learned how much voice changes an AI character. Distinct voices, emotional delivery, and interruption make suspects feel significantly more present than text alone.

What’s next

We would like to expand Casebound with:

  • Short AI-generated crime-scene footage
  • More varied locations and crime categories
  • Relationship graphs connecting suspects and evidence
  • Improved duplicate detection for names and case concepts
  • More sophisticated interrogation memory
  • Difficulty-aware deception and behavioral tells
  • Cooperative multiplayer investigations
  • A detective notebook for pinning contradictions and theories
  • Stronger generation validation and automated playability testing

Our goal is to turn every generated case into a mystery that feels authored, responsive, and worth solving.

Built With

Share this project:

Updates

Submission history