Skip to content

DevsDaily

@theDevsDaily🐦

Subscribe
  • Home
  • Azure
  • C#
  • CSS
  • MongoDB
  • HTML5
  • .NET
  • C# Corner
Subscribe

AI Agents

Shipping your agent

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing an async FastAPI handler that streams agent tokens and events as server-sent events with a timeout and a usage report, next to the title Shipping your agent

Wrap the agent in a FastAPI endpoint that streams tokens and tool events over SSE, add two levels of timeout, keep state in a shared database, package it in a container, turn on tracing, and report what every conversation costs.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, LangGraph, Python Leave a comment

Securing an agent

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing a user context set by the app and a payslip tool that reads the employee ID from it, next to the title Securing an agent

A prompt is a request, not a rule. Take identity from the session, authorise inside every tool, treat documents and tool results as untrusted data, mask personal data before it reaches the model provider, cap model and tool calls, and log every action.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, Python Leave a comment

Testing an agent you can’t predict

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing an evaluation function that checks an agent's answer text, its tool calls and a judge score, next to the title Testing an agent you can't predict

Agents word things differently on every run, so test facts, not sentences. A fixed set of cases is checked in three layers (answer text, tool trajectory and a rubric-based judge model), and a pytest gate in CI fails the build when quality drops below a threshold.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, Python Leave a comment

Many agents, or one good one?

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing a payroll specialist agent wrapped as a tool for a supervisor agent, next to the title Many agents, or one good one?

Build a supervisor with payroll and policy specialists as tools, then compare it with a single agent on the same 30 questions for accuracy, latency and tokens. Split only when the numbers say so, and save Deep Agents for long, multi-step jobs that need a plan and a scratchpad.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, LangGraph, Python Leave a comment

Human in the loop

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing a LangGraph node that calls interrupt to wait for a manager's decision, next to the title Human in the loop

interrupt() pauses a graph and saves its state, and Command(resume=…) continues it later, even from a new process after a restart. For free-form agents, HumanInTheLoopMiddleware makes chosen tools wait for approve, edit or reject. Writes wait; reads flow.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, LangGraph, Python Leave a comment

When the loop isn’t enough: graphs

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing a LangGraph StateGraph with nodes for understanding, validating, checking balance and submitting a leave request, next to the title When the loop isn't enough

Booking leave is a process, not a chat. In a LangGraph graph, code owns the order of steps and the rules (valid dates, enough balance, submit once), the model only turns a sentence into fields, and an agent can still be one node in the graph.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, LangGraph, Python Leave a comment

RAG as a tool, not a pipeline

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing a search_policy tool that searches a vector store and drops weak matches, next to the title RAG as a tool, not a pipeline

Index the employee handbook once (split by headings, embed, store), then expose search as a tool the agent calls only when a question is about policy. Results carry their section names for citations, weak matches are dropped, and the prompt makes the agent say "I don’t know" when nothing fits.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, Python Leave a comment

Give your agent a memory

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing create_agent with a checkpointer, a store, a user context and summarisation middleware, next to the title Give your agent a memory

A checkpointer keeps each conversation thread, a store keeps lasting facts about the person, runtime context tells tools who is asking, and SummarizationMiddleware keeps long threads affordable. You also decide in code what must never be remembered.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, LangGraph, Python Leave a comment

Tools that don’t break your agent

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing a LangChain tool with a Pydantic argument schema and an error that returns a hint, next to the title Tools that don't break your agent

Most agent failures are tool failures. Write descriptions that say when to use a tool, validate arguments with Pydantic, return errors with a hint the model can act on, make writes safe to retry, and load tools another team owns from an MCP server.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, Python Leave a comment

Your first LangChain agent

November 8, 2026November 8, 2026 by Sunny Sharma
Code editor showing a LangChain create_agent call with two tools and a structured response format, next to the title Your first LangChain agent

LangChain’s create_agent runs the Part 1 loop for you. @tool turns typed, documented functions into tools, and response_format returns a validated Pydantic object instead of free text, so your app gets fields it can trust.

Categories Tutorials Tags AI Agents, Building AI Agents, LangChain, Python Leave a comment
Older posts
Page1 Page2 Next →
DevsDaily

AI engineering, Azure and security deep dives from production.

Topics Tutorials C# ASP.NET MVC4 ASP.NET MISC Azure
Site AboutContactPrivacy policy RSS feed
© 2026 DevsDaily
© 2026 DevsDaily • Built with GeneratePress