Agents
Agents are the core building block of BindAI. An agent combines a language model, instructions, tools, memory, and optional knowledge into a reusable AI component capable of completing tasks autonomously. Every interaction in BindAI starts with an agent.What is an Agent?
An agent is more than a language model. It consists of:- a model provider
- system instructions
- conversation history
- tools
- memory
- optional knowledge
- execution pipeline
Agent Architecture
Creating an Agent
The simplest agent can be created directly in Python.YAML Configuration
BindAI also supports creating agents from YAML.Agent Lifecycle
Every execution follows the same pipeline.Instructions
Instructions define the behavior of an agent. Example:Conversation
Every agent maintains its own conversation.Memory
Memory allows an agent to remember information across multiple sessions. Example:- In-memory
- Redis
- PostgreSQL
- Custom providers
Knowledge
Knowledge provides external information during execution. Examples include:- documentation
- PDFs
- Markdown
- databases
- vector stores
Tools
Agents can execute Python functions during reasoning.Providers
The model provider determines which LLM executes the request. Supported providers include:- OpenAI
- Anthropic
- Google Gemini
- Ollama
- Local models
Middleware
Middleware executes before and after agent execution. Example use cases include:- authentication
- logging
- telemetry
- monitoring
- request modification
Events
Agents publish execution events. Examples include:- execution started
- model request
- model response
- tool executed
- execution finished
Hooks
Hooks execute custom Python code after important stages. Example:- execution context
- variables
- result
- conversation
Streaming
Agents support streaming responses.Structured Output
Agents can return strongly typed objects.Using Agents Inside Workflows
Agents integrate directly with workflows.Best Practices
- Give each agent one clear responsibility.
- Keep instructions concise.
- Reuse tools instead of duplicating logic.
- Store prompts in YAML.
- Use memory only when persistence is required.
- Keep knowledge sources focused on a specific domain.
- Prefer workflows to coordinate multiple agents.
