Closing The Mental Health Loop
Nov 6, 2025

Expert-Driven AI with DSPy-Powered Research
Vineet Tiruvadi - AI Advisor at hpy
Anurag Agarwalla - CEO at hpy
Driven by large language models (LLMs), AI is showing promise in helping us manage our mental health. But today’s tools can sometimes feel more like hammers looking for screws.
At hpy, our mission is to bring the best AI tools into the hands of the experts that know how to use them: you and your therapist. Our production stack leverages Ragie, ChatGPT, and HumeAI to empower today's AI-aspiring therapist with next-generation tools.
While accelerating administrative workflows in therapy practice is a key goal of ours, our research efforts seek to push the envelope in understanding and shaping mental health.
LLMs have a role to play in making that tomorrow as empathic as possible (Ovsyannikova 2025) but we’re still early in engineering the best context for them to work in.
We wanted to highlight our research efforts so you can better understand our aim to be leaders in keeping mental health experts in the driver seat of AI.
Research at hpy
The goal of Research@hpy is to build smart and thoughtfully, anchored in expertise and science. Our minds aren't rockets or payment platforms - they’re way more complicated. Building in mental health needs new understanding, so research isn’t optional and we’re prioritizing foundational knowledge.
Our efforts are built on DSPy, a next-generation Agentic AI framework that empowers experts to more directly context engineer AI tools to their specific needs.
What is DSPy?
While LLMs are certainly exciting their limitations are becoming vividly clear. At hpy, we’re focusing on addressing their unpredictability, their sensitivity to inputs, and their lack of understanding (Sclar 2023).
DSPy provides abstractions through signatures, modules, and optimizers that lets us smooth out LLM weakpoints while letting them power a bigger machine with clearer goals. In other words, DSPy lets mental health experts and builders program LLMs, not just hack and slack at their prompts.

By focusing on abstractions, DSPy lets us leverage the most powerful LLM tools in our own expert-level language (Khattab 2025).
By handlingthe low-level prompt design, LLM calling, and optimizations, DSPy empowers us to focus on the bigger picture: the one our therapists paint best.
How hpy Builds with DSPy
Our research efforts prioritize being lean, respecting privacy, and enabling autonomy.
Let’s look at some key research efforts currently being built through DSPy.
Therapist-Led Design
Therapists have deep training and valuable experience in helping others navigate their inner mental worlds - we need to leverage that when we build AI tools to assist them.
What processes do therapists need help with to take care of patients better while taking care of themselves?

In collaboration with our clinical advisory team, and with leading AI-first researchers, we’re building AI tailored to therapists needs - by asking them to map their needs out first.
Then, through DSPy, we're building reflective systems from those maps that can shape our product to individual needs - either directly in the prompt space or indirectly through the latest optimization paradigms, like GEPA (Agrawal 2025).
Multiagent Architecture
While LLMs mimic magic, it’s agentic AI that starts being useful. We've been building with agents for a while at hpy, and that process has gotten easier with DSPy.
Our production agents are already helping therapists in their practice flows and notetaking. Therapists have a lot of detail-oriented tasks running, often all at the same time. Our multiagent products start by being useful in the here and now.
But our next-generation agent research aims to push our understanding of mental health to new heights, giving therapists novel insights into their patients at timescales we never thought possible.
Empathic AI
One of the most unique agents we are building leverages emotion expressions to build more objective measures of emotion and mood. Just like cardiologists and endocrinologists, we think therapists could benefit from objective markers that can help anchor the more difficult to measure aspects of mental health.
Building on the latest Empathic AI advances, including those from HumeAI (Cowen et al), we’re studying how multicultural expressions of emotion can better separate distinct emotional and mood states - potentially helping therapists stay in tune with their clients in between sessions.
Through DSPy, tool-calling is streamlined, letting us easily facilitate direct communication between LLMs and emotion expressions. We’re building a deeper understanding of how language and emotion reflect the therapeutic relationship, an how we can more ethically use emotion expressions to facilitate the best mental health.
Small and Modular LLMs
LLM-powered ChatBots are becoming ubiquitous, but they’re constantly in flux. This can make it hard to build reliable and helpful tools that clinicians can trust.
A key feature of DSPy is that it lets us use LLMs modularly. We can even dedicate specific LLMs to specific agentic flows. Importantly - DSPy lets us do this in the language of the clinician. We’re even piloting an effort to give clinical advisors direct input into our production-level prompting.
Nvidia, one of the main leaders of AI, recently published “Small Language Models are the Future of Agentic AI” - and our approach at hpy has been leading (Belcak 2025). As small LLMs start to dominate Agentic AI hpy will be at the frontier, using them with smart architecture.
Clinicians, and their experience in their language, will be critical to bringing these modules together in the most effective way possible.
Local LLMs
Small LLMs provide another benefit - they can be run locally on edge devices with zero cloud involvement. That means built-in data privacy and security.
Empowered by DSPy, we’ve moved our reasoning needs away from individual models into meta-architectures - informed directly by our clinical advisory group.
Our research efforts will focus on translating our state-of-the-art, always-free cloud offerings into locally-deployable AI Ensembles that will aim to rival the best cloud offerings in capability.
Except you own it. Unchanging. Forever.
Research Preview
Our goal is to build the best products for therapists to tackle mental health - and to do that we need to listen to therapists and science.
The research efforts at hpy give us cutting-edge insights into mental health.
Stay tuned for our Research Previews, where we highlight our cutting-edge internal research and give you the opportunity to try and guide our next products.
DSPy-Powered Agentic AI
Guided by expert clinicians and leading science, and our own growing research efforts, hpy will be at the leading edge of making empathic, multiagent, local + small LLMs transform mental health and therapy. By putting the experts in the driver seat, empowering them to context engineer our AI-based tools, we’ll keep therapy human - always.
References
Belcak, P., Heinrich, G., Diao, S., Fu, Y., Dong, X., Muralidharan, S., Lin, Y. C., & Molchanov, P. (2025). Small language models are the future of agentic AI. arXiv:2506.02153.
Agrawal, L. A., Tan, S., Soylu, D., Ziems, N., Khare, R., Opsahl-Ong, K., Singhvi, A., Shandilya, H., Ryan, M. J., Jiang, M., et al. (2025). GEPA: Reflective prompt evolution can outperform reinforcement learning. arXiv:2507.19457.
Khattab, O., Singhvi, A., Maheshwari, P., Zhang, Z., Santhanam, K., Vardhamanan, S., Haq, S., Sharma, A., Joshi, T. T., Moazam, H., Miller, H., Zaharia, M., & Potts, C. (2023). DSPy: Compiling declarative language model calls into self-improving pipelines. arXiv:2310.03714.
Cowen, A. S., & Keltner, D. (2017). Self-report captures 27 distinct categories of emotion bridged by continuous gradients. Proceedings of the National Academy of Sciences, 114(38), E7900–E7909. https://doi.org/10.1073/pnas.1702247114
Sclar, M., Choi, Y., Tsvetkov, Y., & Suhr, A. (2023). Quantifying language models’ sensitivity to spurious features in prompt design: Or, how I learned to start worrying about prompt formatting. arXiv:2310.11324.
Ovsyannikova, D., de Mello, V. O., & Inzlicht, M. (2025). Third-party evaluators perceive AI as more compassionate than expert humans. Communications Psychology, 3(1), 4.