Inspiration

Everyone checks the weather before leaving home, but nobody checks their personal energy forecast before starting the day. Generic horoscopes don't know you have a client meeting tomorrow. Begin was born from the idea that ancient Eastern fortune-telling wisdom is genuinely useful — if translated into plain language and made personal. The key insight: a static fortune reading is just noise, but if the system remembers what you journaled last night, tomorrow's reading becomes a personalized briefing. That diary-drives-fortune feedback loop became our core thesis.

How We Built It

Begin runs on a Next.js frontend, FastAPI backend, and Supabase (Postgres + pgvector) for persistence, with Gemini 3 Flash as the reasoning engine throughout. The AI layer is a LangGraph ReAct agent where Gemini autonomously selects from five specialized tools — fortune knowledge RAG, diary vector search, fortune chart calculation, card reading, and diary generation — via native function calling with zero routing logic. Gemini 3's thinking budget streams the model's reasoning process to the frontend in real-time through AG-UI state emission, rendered as collapsible thinking bubbles. The diary agent chats naturally with the user about their day, then auto-compacts the conversation into a first-person diary entry. Each diary is asynchronously ingested into a per-user Letta memory agent (also Gemini-powered) that maintains an evolving structured profile — injected into every future system prompt so fortune readings get more personal over time.

Challenges

The hardest engineering problem was thought signature plumbing — preserving Gemini 3's raw signature bytes across function calls, encoding them through LangChain message types, and decoding them back when building Gemini Content objects for multi-step reasoning coherence. The hardest product problem was prompt engineering: the system prompt contains dense domain terminology and raw scores, but the agent must never leak these — it took many iterations to get the model to internalize technical context and express it as casual, friend-like advice. CopilotKit, LangGraph, and AG-UI had interlocking version requirements that made dependency resolution a recurring time sink.

What We Learned

Gemini's native function calling is remarkably good at autonomous tool selection — the agent consistently picks the right combination of tools without any prompt-based routing. Thinking budget turned out to be a UX feature, not just a capability: streaming the reasoning process creates engagement and trust. And the moment a fortune reading references something from last week's diary, users realize this isn't a toy — long-term memory is what transforms a novelty into a daily habit.

Built With

  • ag-ui-protocol
  • copilotkit
  • docker
  • fastapi
  • gemini-embeddings
  • google-gemini-3-flash
  • langgraph
  • letta
  • next.js
  • python
  • react
  • sse
  • supabase-(postgresql-+-pgvector)
  • tailwind-css
  • typescript
Share this project:

Updates