Create a knowledge agent
EARLY ACCESSBefore you begin
Keep these guidelines in mind throughout the configuration:
- Use the same language across knowledge sources and prompts.
- Be consistent with brand name, agent purpose, and knowledge source content. Inconsistency causes the agent to give contradictory responses.
- For prompt writing best practices, see Write prompts for AI agents.
If you upload documentation for product A but write the prompt You should be a helpful agent for product B, the agent gives conflicting answers.
Create the agent
You can create a maximum of 3 knowledge agents per account. If you reach the limit, the Create knowledge agent button is unavailable. To create a new agent, delete an existing one first.
- On the Infobip web interface, go to AI Agents > My agents > Knowledge agents tab.
- Select Create knowledge agent.
- Enter a unique name for the agent. This name is not shown to end users.
- In the Agent tab, configure the agent settings.
- In the Knowledge base tab, connect knowledge sources.
- Select Save agent.
Configure the agent settings
In the Agent tab, configure the following fields.
| Field | Description |
|---|---|
| Description | Describe what the agent does, for example, This agent answers customer questions about our product using the company knowledge base. This description is for internal reference only and is not shown to end users. |
| Instructions | Define the agent behavior, persona, boundaries, and response style. The instructions tell the agent how to respond to end users. Include: persona, response behavior, forbidden topics, and example conversations. |
Example
- You are a helpful knowledge assistant for [COMPANY].
- Answer questions based on the provided documentation.
- Be concise, accurate, and friendly.
- If the answer is not in the documentation, say so honestly — do not make up facts.
- Support follow-up questions using conversation context.
- Do not answer questions about: [competitors, politics, or other off-topic subjects].
- Example: "I'm sorry, I can only help with questions about [COMPANY] products and services."
- Example conversation:
User: What are your business hours?
Assistant: Based on our documentation, we're open Monday to Friday, 9 AM to 5 PM.
User: Are you open on weekends?
Assistant: No, we're currently closed on weekends.Response settings
Configure how the agent generates responses.
| Setting | Description |
|---|---|
| Session window | The number of recent messages from the current conversation included as context when generating a response. A larger window provides more continuity; a smaller window reduces processing overhead. Minimum: 0. Maximum: 10. |
| Retrieved chunks | The number of knowledge base chunks retrieved and passed to the model as context. A higher number provides broader context; a lower number keeps responses more focused. Range: 1–4. |
| Output tokens | The maximum number of tokens the model can use in a single response. This setting limits response length only, use prompting to control answer style and conciseness. Minimum: 1. Maximum: 512. |
| Temperature | Controls how predictable or varied the model's responses are. Lower values produce consistent, focused answers. Higher values produce more varied responses but may reduce factual precision. Range: 0–2. |
Avoid high temperature values. The agent may produce incorrect or unclear responses.
Index settings
Configure how the knowledge base content is indexed.
| Setting | Description |
|---|---|
| Paragraph size | The size of each content chunk in the knowledge base index. Larger values capture more context per chunk; smaller values create more granular retrieval. Minimum: 1. Maximum: 900. |
| Overlapping tokens | The number of tokens shared between adjacent chunks in the knowledge base index. Increasing overlap reduces the chance that relevant content is split across chunk boundaries. Minimum: 0. Maximum: 50. |
Safety
Configure content filters to control what the agent can and cannot discuss. Guardrails detect harmful content in user messages. Select one or more guardrails to enable:
- Hate
- Self harm
- Violence
- Sexual
- Jailbreak shield
For more details on guardrail configuration, see Configure guardrails.
Advanced settings
Configure the prompt template for the knowledge agent.
Prompt template
A custom instruction template that controls how context and the end user's question are formatted before being sent to the model. The default template is pre-configured and works for most use cases.
Required variables (include without changes):
{context_str}: retrieved content from your knowledge sources{query_str}: the end user's question
Optional variable:
{prompt_var}: additional context passed at runtime
The variables {context_str}, {query_str}, and {prompt_var} must be written in English.
Use delimiters such as ### and ** around variables to help the model distinguish between instructions and injected content.
Default template
- Parts of the documentation: ###{context_str}###
- Answer the users question: **{query_str}**