DEV Community

Tushar Singh
Tushar Singh

Posted on

🧠 Behind the Scenes of ClarityCare.AI: CAMEL-AI Toolkits That Power Your AI Wellness Companion

ClarityCare.AI is more than just a chatbot. It's a thoughtfully crafted AI mental wellness assistant designed to promote mindfulness, manage stress, and track emotional well-being. Let’s take a deep dive into the powerful toolkits, technologies, and design patterns used in this project.

🎬 Project Demo

Here’s a quick demo of my project in action. Watch it below:

🧹 Core Technology Stack

Image description

1. 🤖 CAMEL-AI Agents + Mistral API — Role-Based AI Reasoning

The centerpiece of ClarityCare.AI is its AI therapist agent. This agent is created using CAMEL-AI, a framework that specializes in role-based reasoning.
With CAMEL-AI’s ChatAgent, we define a personal for our agent using a system_message. In this case, the agent acts like a compassionate therapist—calm, empathetic, and emotionally intelligent.

🔧 Agent Creation Code:

from camel.agents import ChatAgent
from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType
from camel.configs import MistralConfig

mistral_model = ModelFactory.create(
    model_platform=ModelPlatformType.MISTRAL,
    model_type=ModelType.MISTRAL_LARGE,
    model_config_dict=MistralConfig(temperature=0.7).as_dict(),
)

agent = ChatAgent(
    system_message="You are a compassionate AI therapist. Provide empathetic and helpful guidance.",
    model=mistral_model,
)
Enter fullscreen mode Exit fullscreen mode

This allows ClarityCare to simulate announced, context-aware, and emotionally appropriate dialogue using Mistral's LLM API.

Benefits of using CAMEL + Mistral:

Clear role definition (Therapist, Coach, Mentor, etc.)

Flexible model switching (OpenAI, Mistral, Claude, etc.)

Reusable agents for other domains (career coach, fitness advisor, etc.)

2. 🔍 SearchToolkit – Real-Time Mental Health Info

Understanding mental health often requires current, up-to-date information. To support this, we integrate CAMEL’s SearchToolkit, which performs real-time web search using DuckDuckGo.

from camel.toolkits import SearchToolkit

def search_outside_agent(query: str) -> str:
    search_tool = SearchToolkit().search_duckduckgo
    return search_tool(query)
Enter fullscreen mode Exit fullscreen mode

The query result is appended to the user’s message before it's sent to the LLM, improving response depth.

3. 🔢 Arxiv Toolkit Wrapper – Evidence-Based Mental Health Papers

The app also taps into scientific knowledge using a custom arxiv_toolkit_wrapper. This connects to Arxiv.org and fetches latest research in:

Mindfulness therapy

CBT (Cognitive Behavioral Therapy)

Mental health tech

from toolkits.arxiv_toolkit_wrapper import get_mental_health_papers
papers = get_mental_health_papers()
Enter fullscreen mode Exit fullscreen mode

This keeps the user informed through a science-first lens and ensures the app promotes evidence-based advice.

4. 📊 Mood Score Toolkit – Track Emotional Well-Being Over Time

Tracking how you feel daily is crucial for emotional growth. That’s where our math_toolkit_wrapper comes in. This simple but effective tool computes a mood score from the user’s mood rating.

from toolkits.math_toolkit_wrapper import calculate_mood_score
score = calculate_mood_score([mood])
Enter fullscreen mode Exit fullscreen mode

Paired with a Matplotlib + Pandas graph, users can visualize trends in their emotional state, identifying:

  • 1. High-stress weeks
  • 2. Positive growth periods
  • 3. Patterns related to sleep, anxiety, or focus

Image description

** Architecture Overview**

app.py: Core Streamlit logic with sidebar, chat interface, and insight panels.

therapist_agent.py: Handles agent creation and real-time search logic.

toolkits/: Each AI utility like search, math, and arXiv research is modularized.

claritycare-ai
├── app.py
├── therapist_agent.py
├── toolkits
│   ├── arxiv_toolkit_wrapper.py
│   ├── math_toolkit_wrapper.py
│   ├── news_toolkit_wrapper.py
│
|___ api.env
Enter fullscreen mode Exit fullscreen mode

This design makes it easy to scale, modify, or replace any component (e.g. swap Mistral with OpenAI).

💡 Final Thoughts

ClarityCare.AI is a fusion of research, compassion, and AI. By integrating toolkits like CAMEL Agents, Mistral LLMs, and live search capabilities, it offers not just answers—but support, clarity, and presence.

It proves that AI can be not only intelligent—but also emotionally supportive.

💬 "Therapists may not be replaced—but they can be assisted by tools that help millions begin their journey to well-being."

Top comments (0)