Crafting AI Personas with System Prompts: Building Calmrade, the CalmBot with Chain of Thought Reasoning

SAQUIB HASNAINSAQUIB HASNAIN
3 min read

Artificial Intelligence is more powerful when it understands how to communicate and how to think. Today, I’m sharing how I designed Calmrade, a calm, supportive AI bot, using system prompts and advanced prompting techniques like Chain of Thought (CoT). This blog covers what system prompts are, types of system prompts, and how CoT helps Calmrade reason thoughtfully.

What is a System Prompt?

A system prompt is a set of instructions given to the AI model that defines its behavior, tone, personality, and limitations. Think of it as the role description for the AI, guiding how it responds to user inputs.

System prompts can:

  • Set the AI’s persona (e.g., a calm counselor, a tech assistant).

  • Define restrictions (e.g., avoid certain topics, keep answers short).

  • Shape the response style (e.g., formal, casual, empathetic).

  • Provide examples of correct and incorrect answers.

Types of System Prompts with Examples

1. Role-based Prompt

Example:
"You are a calm, empathetic companion named Calmrade. Always respond with kindness and patience."

2. Instruction-based Prompt

Example:
"Answer questions with detailed explanations but avoid giving medical or legal advice."

3. Chain of Thought Prompt (CoT)

Example:
"When answering, explain your reasoning step-by-step before giving the final answer."


Introducing Calmrade: The CalmBot

Calmrade is an AI designed to support users by offering calm, reflective, and thoughtful conversations. Its features include:

  • Empathy-first communication: Always respond with patience and understanding.

  • Guided reasoning: Use Chain of Thought prompting to help users think through complex feelings or problems.

  • Restrictions: Avoid jumping to conclusions or providing harmful advice.

  • Example-driven responses: Provide examples and clarifications when necessary.

Why Chain of Thought (CoT) Prompting?

Chain of Thought prompting encourages the AI to break down its reasoning into clear, logical steps before answering. This technique improves accuracy and makes the conversation feel more thoughtful and reflective—perfect for Calmrade’s calm personality.

Example: Chain of Thought in Action

Without CoT:

User: "What’s 47 times 6?"
Calmrade: "282"

With CoT:

User: "What’s 47 times 6?"
Calmrade:
"Let me think step-by-step: 40 times 6 is 240, and 7 times 6 is 42. Adding them gives 240 + 42 = 282. So, the answer is 282."

Sample System Prompt Code for Calmrade

Here’s a simplified example of how you can set up Calmrade’s system prompt in Python using OpenAI’s API:

from dotenv import load_dotenv
from openai import OpenAI
from prompt import SYSTEM_PROMPT
import json

load_dotenv()
client = OpenAI()

system_prompt = """
You are Calmrade, a calm and empathetic AI companion.
- Always respond with kindness and patience.
- When answering complex questions, explain your reasoning step-by-step using chain of thought.
- Avoid giving medical, legal, or harmful advice.
- Encourage users to reflect and think through their thoughts carefully.
"""

messages = [
    {"role": 'system', "content": SYSTEM_PROMPT}
]

while True:
    query = input(">>>")
    messages.append({"role": "user", "content": query})

    response = client.chat.completions.create(
        model= "gpt-4o-mini",
        messages=messages
    )

    messages.append({"role": "assistant", "content": response.choices[0].message.content})

    try:
        parsed_response = json.loads(response.choices[0].message.content)
        print("🌿Calmrade>>>", parsed_response.get("content"))
    except:
        print("🌿Calmrade>>>", response.choices[0].message.content)  # fallback if response is not JSON

Calmrade in Practice: Handling a User Query

User: "I’m stressed about my exams and don’t know where to start."

Calmrade:

"I understand that exams can be stressful. Let's break this down step-by-step. First, try listing the subjects or topics you find most challenging. Then, create a simple schedule dedicating time to each one. How does that sound?"


Summary

  • System prompts shape AI behavior and personality.

  • Chain of Thought (CoT) prompting helps AI reason clearly and thoughtfully.

  • Calmrade combines both to offer calm, empathetic, stepwise guidance.

  • Using these techniques makes AI interactions more human-like and supportive.

0
Subscribe to my newsletter

Read articles from SAQUIB HASNAIN directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

SAQUIB HASNAIN
SAQUIB HASNAIN