Inspiration

The idea came from wanting to make history interactive. Instead of reading about historical figures, what if you could talk with them? The rise of conversational AI and voice cloning made this possible. The goal was to create an immersive experience where users learn by having conversations with the minds that shaped our world.

What it does

Voices of History is a Next.js web application that lets users chat with historical figures using AI. Powered by Groq's Llama 3.3 70B model, each figure responds in character with era-appropriate knowledge and speaking style. The app features custom voice cloning for unique voices, real-time word-by-word streaming responses, and multi-language support. Users can ask Einstein about relativity, discuss strategy with Napoleon, or hear Cleopatra's story—all in an interactive, voice-first experience.

How we built it

Built with Next.js 16, TypeScript, and Tailwind CSS for the frontend, with Groq API handling AI conversations. The streaming system uses a word-by-word display algorithm with punctuation-aware timing delays for natural reading flow. Voice integration includes a Next.js API proxy route that connects to a Python voice cloning server (XTTS + Bark) with automatic fallback to browser TTS. The prompt engineering system uses hierarchical templates—generic prompts for any figure, plus figure-specific prompts for well-known historical personalities like Einstein and Socrates.

Challenges we ran into

Managing streaming state while handling user input and audio playback caused race conditions that required careful state separation and ref management. Ensuring historical accuracy was difficult—the AI sometimes referenced post-death events, which we solved with explicit knowledge boundaries in prompts. Voice server integration faced CORS issues and reliability concerns, which were solved by creating a Next.js proxy and implementing a graceful fallback to browser TTS. Natural speech timing required fine-tuning punctuation-based delays to make word-by-word streaming feel conversational rather than robotic.

Accomplishments that we're proud of

Created an immersive educational experience that makes history interactive and engaging. Successfully integrated real-time AI streaming with a natural word-by-word display that feels conversational. Built a robust voice system with automatic fallback that works reliably even when the voice server is unavailable. Achieved multi-language support where historical figures respond authentically in the user's language, maintaining era-appropriate speaking styles.

What we learned

Learned advanced prompt engineering techniques to create authentic historical personas with proper knowledge boundaries and era-appropriate language. Gained expertise in streaming architecture, implementing real-time word-by-word display with natural timing algorithms. Mastered voice technology integration, including audio blob management, API proxying, and graceful degradation patterns. Discovered the importance of comprehensive error handling and fallback systems to ensure a smooth user experience even when external services fail.

What's next for Voices of History

Planning to train custom voice models for each historical figure to create even more authentic voices. Adding visual avatars with animated representations of historical figures to enhance the immersive experience. Implementing conversation memory to allow long-term context across multiple sessions. Exploring multi-figure conversations where users can have multiple historical figures discuss topics together, creating dynamic historical debates and discussions.

Built With

  • javascript
  • languages:-typescript
  • python-frameworks:-next.js-16-(app-router)
  • react-19
  • tailwind-css-4-apis-&-services:-groq-api-(llama-3.3-70b)
  • vercel-(deployment-ready)-tools:-eslint
  • web-speech-api-voice-technology:-xtts-+-bark-(python/fastapi-voice-server)-platform:-node.js
Share this project:

Updates