Inspiration

🎭📚 PersonaPal — The Silly AI Study Buddy

Inspiration

As CS students, we’ve all had the same experience:
you sit down to study, open a textbook, and within 3 minutes your brain decides it would rather do anything else — reorganize your desktop, scroll, or stare into the void.

We realized something important:

Studying isn’t always hard because the content is difficult — it’s hard because it’s boring.

So when we saw the hackathon theme (Sillycon), we leaned into it fully.
We asked ourselves:

What if learning stayed accurate, but the delivery became ridiculous?

That idea became our project:
an AI study buddy that answers questions correctly, but with hilariously vivid personas like:

  • a teacher who lost his life savings
  • a pirate captain
  • a wizard professor
  • a gym bro coach
  • a noir detective

The goal wasn’t just “fun.”
The goal was to make studying feel like entertainment — without sacrificing real learning.


What We Learned

This project taught us a lot beyond just “how to call an API.”

🧠 1) Persona ≠ Randomness

We learned that personas don’t work well if they’re just jokes.
To feel consistent, they need:

  • recurring phrases
  • repeated formatting styles
  • a stable “voice”
  • predictable quirks

Basically: personality needs structure.


🧩 2) Prompting Is a Real Engineering Skill

We discovered that prompt quality can make or break the app.
A persona prompt needs to enforce:

  • correctness (the student still needs the right answer)
  • vivid character (the fun part)
  • consistency (so the bot feels real)

We also learned that prompts behave like code:
small changes can cause unexpected behavior.


🗃️ 3) Chat Memory Is a Real Backend Problem

We learned that a chat app isn’t just one request to an LLM.

To maintain context, we needed to store:

  • user messages
  • assistant responses
  • timestamps
  • persona used

This became a real system design problem.


How We Built It

⚙️ Stack

  • Frontend: React (Vite)
  • Backend: FastAPI (Python)
  • Database: PostgreSQL
  • LLM: OpenAI API
  • Text-to-Speech (optional extension): audio generation pipeline

🏗️ System Architecture

At a high level:

  1. User chooses a persona (Pirate, Wizard, Broke Teacher, etc.)
  2. User sends a question
  3. Backend fetches the conversation history from PostgreSQL
  4. Backend builds the prompt:
    • system persona prompt
    • conversation history
    • new user message
  5. OpenAI generates a response
  6. Backend stores:
    • the user message
    • the assistant response
  7. Frontend displays the response instantly

🧠 Prompting Logic

We treated personas like “plug-in modules.”

Each persona had a system prompt with:

  • mandatory catchphrases
  • forced formatting sections
  • consistent metaphors
  • clear instruction: “Always teach correctly.”

So the response wasn’t just funny — it was predictably funny.


🧮 Math Support (LaTeX)

Since our audience includes students, we wanted math explanations to look clean.

For example, if a user asks about quadratic equations, the AI can respond with:

[ ax^2 + bx + c = 0 ]

and the solution:

[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} ]

This makes the tool useful for actual studying, not just comedy.


Challenges We Faced

🔥 1) CORS Problems (Frontend ↔ Backend)

A big early blocker was the classic:

“blocked by CORS policy: No 'Access-Control-Allow-Origin' header…”

Since React runs on one port and FastAPI runs on another, the browser refused requests.

Fixing it required correctly configuring FastAPI middleware to allow:

  • the correct frontend origin
  • the correct methods
  • the correct headers

🧱 2) Database + Chat History Structure

We had to decide:

Do we store only user messages? Only AI responses? Or both?

We learned that for chat-based systems, you must store both, because the LLM needs alternating roles:

  • "user"
  • "assistant"

Without that structure, the bot loses coherence.


🎭 3) Balancing Humor With Accuracy

The biggest challenge was keeping the persona strong without losing the lesson.

Some personas would “commit too hard” and start:

  • avoiding the question
  • turning into pure roleplay
  • giving vague answers

We solved this by enforcing response structure like:

  1. Explanation
  2. Steps
  3. Recap
  4. Persona punchline

So the persona enhances learning instead of replacing it.


🧠 4) Token Limits and Context Length

When you store long conversations, you eventually hit context limits.

We learned that real chat systems need strategies like:

  • truncating old messages
  • summarizing older history
  • keeping only the most recent (N) turns

This became a practical lesson in designing scalable AI apps.


What Makes It Unique

Most study bots try to be professional and neutral.

Ours is different:

It teaches correctly, but it feels like you’re learning from a character in a comedy sketch.

It turns study sessions into something students might actually choose to do.


What’s Next

If we extend the project, we want to add:

  • 🔊 voice output so personas literally “sound” different
  • 🎬 animated avatar reactions (lip sync + expressions)
  • 🧠 smart memory (remembering what the student struggles with)
  • 🎮 gamification (streaks, quizzes, persona unlocks)

Final Pitch

PersonaPal is an AI study buddy that teaches you anything — but with ridiculous personalities.
It’s accurate learning wrapped in chaotic fun, designed to keep students engaged long enough to actually understand.

Because sometimes the best way to study is to make it silly.

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for Study Pilot

Built With

Share this project:

Updates