Make Your Agent Production-Smart with Automatic Web Context
Casper Nielsen
Software Engineering Team Lead
Let's talk about building agents that do something useful.
LLMs forget the world the moment training ends. Ask them about last week's release, today's headlines, or yesterday's incident and you'll get a confident, outdated answer, or worse, a hallucination. The usual fix is to give the model a web-search tool, but in practice models routinely skip the tool for questions they think they already know.
In this webinar we'll build a better pattern: an expert agent that automatically enriches every LLM call with fresh web context, no tool-call gamble required. We'll use the new Hooks system in Dapr Agents to inject a before_llm_call step that runs a Tavily search for the user's question, splices the top results into the prompt with proper prompt-injection guardrails, and hands control back to the model.
Because the hook runs inside a Dapr workflow activity, the search is durable. It executes exactly once per turn even when the workflow replays, so you get RAG-like behavior with workflow-grade reliability. We'll wrap it all in a Chainlit chat UI you can ship.
Along the way you'll see how Dapr Agents combines a stateful agent runtime, pluggable hooks, durable workflows, and Redis-backed memory into something you can actually run in production — and how this pattern generalizes far beyond web search.
Who The Webinar Is For
- Backend and platform engineers building LLM-powered features who need fresh, source-grounded answers in production
- AI and agent developers evaluating frameworks for durable, stateful agent workflows
- Architects comparing tool-calling vs. context-injection patterns for RAG and retrieval
- DevOps / SRE engineers interested in how Dapr's durable workflows apply to AI workloads (idempotency, replay, observability)
- Technical leads at teams already using Dapr who want to see how Dapr Agents fits alongside the rest of the Dapr building blocks
Demo Details
We'll build the agent live. Starting with a minimal DurableAgent, we'll:
- Wire up the agent — configure the OpenAI chat client, conversation memory, and the Redis state stores for memory, workflow state, and the agent registry
- Write the before_llm_call hook — call Tavily for the user's question, truncate results to a token-safe budget, wrap them in a
<web_context>block with an untrusted-content guardrail, and return aMutate(...)call to splice a fresh system message into the prompt - Run it under Chainlit — start the agent with
dapr runand chat with it in the browser at localhost:8000 - Defeat the training cutoff live — ask things like "What's in the latest Dapr release?" and watch the logs show the hook firing and the model answering from the injected context
- Show the durability story — inspect the workflow state to demonstrate that the Tavily call is recorded once per turn and not re-executed on replay


