Behavior
How your agent talks, streams, and remembers.
Pages
- Prompt Strategies — System prompt templates, role composition, example injection.
- Output Parsing — Structured output with
chatWithFormat, retries, validation. - Streaming —
streamChatWithTools, chunk types, event flow. - Variants — Quality, speed, cost tiers on a single agent.
- Memory — Conversation history, window management, summarization.
Event System
The event system provides full observability into the agent lifecycle. Events use a sealed interface hierarchy with 20+ event types, enabling type-safe pattern matching.
Prompt Strategies
TnsAI includes a prompt enhancement system that applies proven prompting techniques to improve LLM response quality. The system is built around the PromptStrategy enum, PromptEnhancer builder, and EnhancedPrompt output.