Inspiration
Our team shares a deep interest in the intersection of Neuroscience, Psychology, and Agentic AI. We value how small, daily habits create compounding impacts on mental health and medicine. With roughly 10% to 30% of adults worldwide suffering from insomnia symptoms, we saw an urgent need for a reliable, proactive solution. However, we wanted to build something that actually works, not just a basic chatbot that hallucinates random advice. To achieve this, we grounded our AI in the theoretical framework of Active Inference (a concept in neuroscience in which a system actively acts to minimize "surprise" and uncertainty about its environment to achieve a desired state). This inspired us to implement an Actor-Critic framework assisted by Retrieval-Augmented Generation (RAG). The "Actor" proposes personalized interventions, the "Critic" evaluates them against clinical guidelines, and the RAG pipeline ensures every response is strictly grounded in credible, scientific documentation.
What it does
Circadia is a proactive, autonomous wellness companion that integrates personal care and clinical utility through an empathetic chatbot that also has access to several tools. Securely addressing users' daily anxieties and sleep-related questions, the AI goes beyond standard chat by ingesting Apple Health data to conduct comprehensive data analysis and suggest actionable steps to the user accordingly. By connecting to the user's Google Calendar, Circadia actively analyzes daily schedules to optimize routines and mitigate stress factors before bedtime. Furthermore, this approach offers significant clinical value, acting as a robust diagnostic aid capable of producing formatted behavioral summaries that empower GPs, psychiatrists, and doctors to better understand and treat their patients' habits. Upon detecting high-risk language from the user, such as implications of self-harm, Circadia immediately sends a message to an emergency contact of the user. Another example of proactive behavior from Circadia is that it sends warning notifications when the user adds a late-night event in their Google Calendar.
How we built it
Frontend: We used Lovable for rapid initial UI development, refining it with manual TypeScript after copying it to the local machine. The frontend is deployed on Vercel.
Backend: Built in Python and deployed via Railway.
AI & Integration: We leveraged Claude Code alongside manual programming. To seamlessly integrate new services like LangChain and the Google Calendar API, we fed their latest documentation to Claude Code through MCP servers. This ensured accurate development and drastically reduced our iteration time, though some manual debugging was still needed as Claude Code did occasionally hallucinate random stuff.
Challenges we ran into
One challenge was maintaining context synchronization between our two distinct LLMs (the Actor and the Critic). Because they run in a continuous feedback loop, if we introduced a new feature or updated the user's context for the Actor without perfectly mirroring it to the Critic, the system would conflict, leading to hallucinated feedback and broken logic. We also had to develop a separate LLM for data visualisation because we expect the backend to receive a diversity of data, and code with deterministic logic can't apply to all of it. For instance, data with extreme outliers distorts the view of scatter plots, making it hard to spot correlations. We added an LLM layer with specific instructions for data cleaning and preparation before visualizations, allowing the app to adapt its strategy and plots based on the data it receives.
Accomplishments that we're proud of
We are pretty proud of the entire system. We successfully bridged complex theoretical neuroscience (Active Inference) with cutting-edge LLM orchestration to build a mental health tool that is genuinely autonomous, safe, and scientifically grounded.
What we learned
Using LangChain and LangGraph. How to properly structure RAG pipelines for medical/psychological use cases. The power of highly specific, effective prompt engineering to force LLMs to write functional code and adhere to strict safety guardrails.
What's next for Circadia
Mobile App Deployment: Bringing the web experience to iOS and Android natively. Advanced API Integrations: Implementing automated APIs (like Twilio) to initiate phone calls (rather than just messages) to friends or crisis lines when a user is in severe distress. Advanced Wearables: Connecting the agent directly to sophisticated hardware, such as smart watches, wristbands, or the Muse EEG headband, for more advanced data monitoring.
Built With
- fastapi
- python
- react
- typescript
Log in or sign up for Devpost to join the conversation.