loci

Inspiration

We kept running into the same wall that every student, professional, and lifelong learner eventually hits: there is so much to remember, and almost none of it sticks. Flashcards feel like a chore. Re-reading notes is basically fooling yourself into thinking you studied. Highlighting is even worse.

The Method of Loci, a technique dating back to ancient Greece that memory champions still use today to memorize thousands of digits of pi, entire shuffled decks of cards, and hours of speech without a single note. The idea is simple: your brain is terrible at remembering abstract facts, but it is extraordinary at remembering places and stories. You build an imaginary space called a memory palace, plant vivid scenes inside it, and walk through it to recall everything perfectly.

Building a memory palace from scratch is hard. You have to invent bizarre, memorable imagery for every concept, spatially organize it, and keep it all coherent. Most people give up before they finish one room. We asked ourselves: what if AI could build the entire palace for you in seconds?


What it does

loci turns anything you want to memorize into a fully generated memory palace. You type a prompt, upload your documents, lecture slides, or study notes, and loci produces a vivid, walkable spatial environment where every room holds a wild, unforgettable scene encoded with your information.

Each palace is broken into rooms, and each room contains objects tied directly to the concepts you need to remember. The scenes are intentionally strange and visual because that is exactly what makes the Method of Loci work. Your spatial memory does the heavy lifting, and the information sticks.

Once your palace is generated, you can also talk to a live AI agent that knows the layout of your palace, can answer questions about it, retrieve specific objects using semantic search, and guide you through a review session in real time.


How we built it

The stack is divided into four main layers that work together as a pipeline.

The frontend is built in Next.js and handles prompt submission, document uploads, and palace visualization. It also maintains a persistent WebSocket connection to the agent running on GCP.

On the ingestion side, uploaded documents are sent to a Supabase-backed API layer where a Gemini 2.5 Flash OCR parser agent reads and extracts structured content. The parsed descriptions are stored in Supabase and simultaneously vectorized and uploaded to Moorchec, which gives our agent semantic search capabilities over the palace content.

The palace generation pipeline then kicks in. A classification and generation agent built on Gemini 2.5 Flash takes the parsed descriptions, classifies them into labeled concepts, and generates the rooms of the palace. A separate generation step powered by Gemini 2.5 Pro takes those classified labels and generates the rich, memorable objects that populate each room. This two-step classify-then-generate workflow keeps the output both structured and creatively vivid.

The live agent lives on GCP and runs on a Python WebSocket server connected via Socket.IO. It uses the Gemini Live API and is equipped with three tools: a Gemini 2.5 context query tool, a Moorchec vector lookup tool for semantic retrieval over object descriptions, and a direct Supabase tool that gives it read access to the full rooms and objects database. This means the agent can answer specific questions, surface relevant objects from anywhere in the palace, and guide a real-time review session.


Challenges we ran into

Getting the generation pipeline to produce palaces that were both educationally accurate and genuinely memorable was harder than expected. Early outputs were either too literal and dry or too abstract to be useful as memory cues. Finding the right prompting strategy to hit the sweet spot between structured information and vivid, weird imagery took a lot of iteration across both the Flash and Pro model calls.

Coordinating the classify-then-generate workflow across multiple agents while keeping the final palace coherent also required careful design. We had to make sure labels from the classification step carried enough context for the generation step to produce objects that actually connected back to the source material.


Accomplishments that we're proud of

We are proud that loci actually works as a real memory tool, not just as a demo. We tested it on actual study material and found that walking through a generated palace meaningfully improved recall compared to reading the same notes.

We are also proud of the multi-agent architecture. The combination of OCR parsing, classification, object generation, and a live retrieval-augmented agent all talking to the same underlying data layer felt like a genuine system rather than a collection of hacked-together prompts.

The Moorchec integration in particular was a highlight. Giving the live agent semantic search over palace objects means users can ask questions like "which room has the concept about mitosis" and get an instant, accurate answer grounded in their actual palace.


What we learned

We learned that the bottleneck in memory is almost never intelligence. It is encoding. The Method of Loci works because it converts abstract information into something the spatial and visual parts of your brain can actually grab onto. Building loci gave us a much deeper appreciation for why that technique has survived for two thousand years.


What's next for loci

We want to build a dedicated review mode where users navigate their palace room by room and test themselves on what each object encodes, turning the palace into an active spaced repetition system rather than a passive one.

We see that the most powerful memory technique ever discovered should not require a genius or hours of creative work to use. loci makes it available to everyone.

Built With

Share this project:

Updates