Messages
Messages are the building blocks of every conversation in NovaAI. Each message provides context to the model, helping it understand instructions, maintain conversation history, and generate accurate responses. This guide explains message roles, structure, and best practices for building effective conversational workflows.
What Are Messages?
Every interaction with a NovaAI chat model is represented as a sequence of messages. Rather than sending isolated prompts, you provide the conversation history, allowing the model to understand context and generate more relevant responses.
Each message includes a role and content, enabling the model to distinguish between system instructions, user input, and assistant responses.
Message Structure
Each message is represented as a simple object.
role
string
required
Defines who authored the message.
content
string
required
The text, instruction, or information sent to the model.
Message Roles
NovaAI supports three primary message roles.
Role | Purpose |
| Defines the assistant's behavior, personality, or operating instructions. |
| Represents input provided by the end user. |
| Contains responses previously generated by the model. |
Using these roles correctly helps the model maintain consistency throughout a conversation.
Conversation Flow
Each new request includes the conversation history, enabling the model to understand previous interactions.
Conversation Example
Notice how the model receives the previous assistant response along with the latest user message. This allows it to continue the conversation naturally.
Message Lifecycle
Every conversation follows the same lifecycle regardless of the selected chat model.
Conversation History
A conversation grows over time as more messages are exchanged.
Keeping relevant history improves contextual understanding while removing unnecessary messages helps reduce token usage.
Best Practices
Start every conversation with a clear system instruction.
Keep user messages focused on a single objective.
Include only relevant conversation history.
Remove outdated messages to reduce token usage.
Preserve important context for long-running conversations.
Separate unrelated topics into different conversations whenever possible.
Common Mistakes
Mistake | Impact | Recommendation |
Missing system message | Inconsistent assistant behavior | Define clear instructions at the beginning. |
Sending only the latest message | Model loses previous context | Include relevant conversation history. |
Extremely long conversations | Increased latency and token usage | Periodically summarize or trim older messages. |
Mixing multiple topics | Lower response quality | Keep conversations focused on one task. |
Frequently Asked Questions
Next Step
Now that you understand how conversations are structured, continue to Tokens to learn how message length, conversation history, and model context affect token usage and overall API cost.