Inspiration

I take therapy every now and then. Due to the gap between sessions, sometimes I come into a session and then the first talking point turns out to be what the whole session is all about. Usually shortly after a session, I always end up remembering topics I would have loved to hash out with my therapist but usually just plan to tackle them in the next session. Most times by the next session there are already more things to talk about that sometimes displaces the old topic I planned to bring into the session. Infact I noticed that there were topics I never actually remember to bring up in the therapy session and only remember them outside of it. To solve this I started listing topics in my notes so that I could read through them before therapy. Then it occured to me that an agentic conversational interface could help me structurally extract my thoughts and circumstance right before a therapy session and then present them in a structured brief I could then use to conduct my therapy without skipping topics as usual. I actually ran a few sessions on prelude before a therapy session I had recently, and my psychologist was surprised at how much insight into my circumstance and the richness of the topics we tackled that day, I told her it was because I had extra prep before coming in.

What it does

Prelude is an agentic conversational interface that helps users surface thoughts that are pertinent to them through structured questioning and guided reflection. A session agent conducts the questioning, using tools to determine where to dive deeper or where to segue or even connect to past topics, a brief agent at the end of the session prepares the brief for the user based on the reflection from the session. The user then takes that brief and uses it as guidelines to coordinate their actual therapy session

How we built it

I built it on Cursor IDE using google ADK and a fastAPI backend with a React front end. Built a lite version on google AI studio first to test the workflow before moving to cursor for this complete version. I started with scaffolding the frontend then importing google ADK cli into the project and creating the two agents and their tools. I will attach the diagram of the architecture in this submission.

Challenges we ran into

I had issues with latency when I first started testing the agent, i noticed some responses took as long as 7 seconds to come so I had to figure out why. Turns out some of my session agent prompts were contradictory and some were simply repetitive, the prompt bloat was what was causing the issues. Also at first the session agent seemed to be too focused on the user's first response and never knew when to branch out to cover another relevant topic, I eventually addressed it by making the agent know the tools at its disposal and when is the appropriate time for a tool call. I had some slight issues deploying to cloudrun, turns out it was just the docker image that was wrongly configured.

Accomplishments that we're proud of

I am very proud to have build my first agentic conversational interface. One of the achievements I'm most proud of is deducing that my latency issues were coming from prompt bloat. I had to troubleshoot for almost a whole day, thinking the latency issues had something to do with my ADK configuration. I was also so proud when I finally deployed the backend to cloudrun and was able to connect it to my deployed frontend and run full session end to end without bugs

What we learned

I learnt that an LLM is like a mind/brain but an agent is like an actual person where the tools act like the body parts and the LLM is still the brain. I learnt how agents are goal oriented and perform better when they are allowed to be autonomous. I learnt the google ADK is one of the easiest most practical way to build and deploy agents

What's next for Prelude

The next step for prelude would be the launch of the web app. I will promote the web app a little using influencers and user generated content to find my demographic market. And then I will begin work on an ios/android version

Share this project:

Updates