Agents
Define focused AI behavior in C# and run it inside your application.
An agent brings together instructions, a model, and the capabilities the model may use. Your application registers the definition; the Runiq runtime handles execution.
Use an agent when a request needs interpretation, tool selection, or a generated response. Attach only the tools and knowledge that its responsibility requires.
What makes an agent
| Building block | Responsibility |
|---|---|
| Identity | A stable id for runtime lookup and a readable name for Studio. |
| Instructions | The agent's role, boundaries, and expected response style. |
| Model | A provider/model reference and its connection settings. |
| Tools | Typed C# operations attached with AddTool<TTool>(). |
| RAG, when needed | Retrieval configured with UseRag(...) against a named index. |
Tools and RAG are optional. Start with a small definition and add capabilities as your feature needs them.
A definition in C#
This snippet belongs in your host setup after creating builder. It creates a definition; register it before running it by id. Choose a model available through your provider account.
How a request runs
- Your application passes a message and agent id to the runtime.
- The runtime resolves the definition and prepares the model request. Configured RAG retrieval can supply passages before the initial model call.
- The model answers or requests an attached tool. Runiq executes the tool and returns its output to the model for continuation.
- Your application receives a completed result or streaming events. Studio helps inspect the run.
A tool result is intermediate data; the model can use it to compose the final response.
Build your first agent
Define and register an agent →
Create a small definition and make it available to your application.
Call the runtime from C# and handle results or streaming events.
Check the selected model, tool calls, and retrieved sources.