Prompts
Prompts define how an AI agent behaves. In BindAI, prompts are treated as reusable, structured objects instead of raw strings. They can be:- stored in Python
- loaded from YAML
- reused across agents
- parameterized with variables
- composed dynamically
What is a Prompt?
A prompt contains the instructions sent to the language model before generation. The most common prompt is the system prompt, which defines the agent’s behavior. Example:Prompt Object
BindAI provides a dedicatedPrompt object.
Creating an Agent
Using Instructions
The simplest way to create a prompt is by using theinstructions parameter.
YAML Prompts
Prompts are commonly stored in YAML.Variables
Prompts often contain dynamic values. Example:Static vs Dynamic Prompts
Static prompt:Prompt Composition
Prompts can be built from multiple sections. Example:Output Instructions
Prompts often define how responses should be formatted. Example:Prompt Reuse
A single prompt can be shared across multiple agents.Prompts and Memory
Prompts define behavior. Memory provides context. Together they determine how an agent responds.Prompts and Knowledge
Knowledge retrieval occurs before model generation. Retrieved information becomes additional context, while the prompt continues to define the agent’s role and instructions. The prompt should describe how to use retrieved information, not contain the information itself.Best Practices
- Keep prompts focused on one responsibility.
- Store prompts in YAML when possible.
- Keep instructions concise.
- Separate behavior from runtime data.
- Use variables instead of duplicating prompts.
- Clearly define the expected output format.
- Reuse prompts across similar agents.
