Skip to main content
This can be achieved by providing previous chat prompts and responses to a new chat request, allowing the model to process your new request with the context in mind.

Example Request: In-Memory Chat

curl --request POST \
  --url https://api.pawa-ai.com/v1/chat/request \
  --header "Authorization: Bearer $PAWA_AI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "pawa-v1-ember-20240924",
  "messages": [
    {
      "role": "system",
      "content": [
        {
          "type": "text",
          "text": "Your name is TanzaBot, a helpful assistant in answering questions about Tanzania."
        }
      ]
    },
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "How?"
        }
      ]
    }
  ]
  "memoryChat":[
       {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Who is the president of Tanzania, currently?"
        }
      ]
    },
    {
      "role": "assistant",
      "content": [
        {
          "type": "text",
          "text": "The current president of Tanzania is Samia Suluhu Hassan."
        }
      ]
    },
  ]
}'

Example Response demonstrating in-memory chat

{
  "success": true,
  "message": "Chat request processed successfully",
  "data": {
    "request": [
      {
        "finish_reason": "stop",
        "message": {
          "role": "assistant",
          "content": "Samia Suluhu Hassan became the president of Tanzania on March 19, 2021, following the death of her predecessor, John Pombe Magufuli. She was sworn in as the country's first female president and has since been recognized for her leadership and efforts to promote gender equality in Tanzania."
        },
        "matched_stop": 128001
      }
    ],
    "created": "2025-09-09",
    "model": "pawa-v1-ember-20240924",
    "object": "chat.request"
  }
}
With this capability in Pawa AI, you can build context-aware assistants that provide continuity across conversations, enabling more natural and human-like interactions. Instead of treating every request as isolated, your app can “remember” what was said earlier and respond accordingly, making the experience smoother for your users.
I