Hack #4: turbopuffer · turbopuffer
15 Apr, 16:37
Echoverse is a web-based interactive AI audio narrative engine. Users simply input a story premise to receive an immersive audio experience including narration, sound effects, and background music, with real-time choices driving the plot. The project uses ElevenLabs as the "voice of the world"—the TTS API generates narration, the Sound Effects API generates scene sound effects, and the Music API generates adaptive background music. These three layers of audio are mixed and played in real-time via the Web Audio API. Turbopuffer is used as the "memory of the world"—storing world elements, player decisions, and profiles in vector form for RAG retrieval to drive narrative generation. It also performs semantic vectorization caching of generated sound effects and background music, allowing them to be reused directly when the similarity between a new request and an existing asset exceeds a threshold, without repeatedly calling the generation API. This semantic caching mechanism is the project's core innovation: it creates a cost flywheel between ElevenLabs and turbopuffer—the more stories, the richer the cache, the fewer API calls, the faster the response, and the lower the cost. At the end of a single story, the cache hit rate can climb from approximately 10% initially to 40-50%. All user data and API keys are stored locally in the browser (localStorage + IndexedDB), with zero server-side persistence, prioritizing privacy.
