Spring AI Recipes

As I've worked with Spring AI for the past few years, I've created a sizable number of "recipes" in my notebook. Rather than keep them to myself, I've decided to share them for anyone who may learn from them. (All recipes are hosted at Medium.com.)

If you like what you read here, then you should check out my books.


Recently added recipes

All recipes

Filter by tags: All Foundations Agents Tools Human-in-the-Loop Skills A2A MCP Workflows
  • Adding Human-in-the-Loop to a Graph-based Agentic Workflow
    May 6, 2026
    Sometimes the smartest thing an AI can do is admit that it’s unsure. Instead of guessing, a graph-based agentic workflow can pause, ask for human guidance, and then continue with confidence. See how to add human-in-the-loop to a graph-based workflow.
    agentsworkflowshuman-in-the-loop
  • Building a Graph-Based Agentic Workflow
    May 4, 2026
    Completely autonomous agents are like unplanned road trips--flexible and full of adventure, but unpredictable and potentially surprising. Graph-based workflows provide the roadmap, while still allowing intelligent decisions along the way. Build a graph-based agentic workflow with Spring AI Alibaba Graph.
    agentsworkflows
  • Creating an MCP Client
    May 1, 2026
    Build an MCP client and give tools from an MCP server to your agent.
    mcptools
  • Streamable HTTP MCP Server
    April 29, 2026
    So you’ve built an MCP server with STDIO? That’s great! Now take it from local integration to network-accessible service, by creating a Streamable HTTP MCP server.
    mcptools
  • Creating an STDIO MCP Server
    April 27, 2026
    An agent without tools is just thinking really hard.Give it something to do. Create an STDIO MCP server to provide capabilities to an agent.
    mcptools
  • Enabling Long-Term Memory
    April 24, 2026
    Your agent may be smart. But how is its memory? Learn how to add long-term memory to your agents so that it learns and remembers significant information.
    agentsmemory
  • Invoking A2A Sub-Agents with TaskTool
    April 22, 2026
    A2A isn’t just about exposing agents--it’s about using them. Use TaskTool to invoke A2A sub-agents.
    agentsa2a
  • Enabling Agent-to-Agent Communication with A2A
    April 20, 2026
    You've built an agent. But if no other agent can find or use it...what’s the point? See how to enable agent discovery and communication using Agent-to-Agent (A2A).
    agentsa2a
  • Reusing Agent Behavior with SkillsJars
    April 17, 2026
    Tools give capabilities. Skills give direction. SkillsJars make it reusable. Find out how to add plug-and-play agent behavior with Spring AI and SkillsJars.
    agentsskills
  • Guiding Agentic Behavior with Skills
    April 15, 2026
    Tools give your agent capabilities. Skills give it direction. Learn how to guide agent behavior with Skills in Spring AI.
    agentsskills
  • Agentic Planning with TodoWriteTool
    April 13, 2026
    What if your LLM didn’t just answer questions—but made a plan and executed it? See how to enable agentic planning with TodoWriteTool.
    agentstools
  • Asking Questions to the User
    April 10, 2026
    We often ask questions to LLMs and get back answers. What if the LLM wants to ask us something? See how to use AskUserQuestionTool to make the human a part of the loop.
    agentstoolshuman-in-the-loop
  • Logging LLM Requests and Responses
    April 8, 2026
    Keep your ChatClient configuration code neat, tidy, and gain the opportunity to enable/disable it with configuration properties.
    foundations
  • Composing ChatClient Behavior
    April 6, 2026
    Keep your ChatClient configuration code neat, tidy, and gain the opportunity to enable/disable it with configuration properties.
    foundations
  • Building a Text-Based Chat Loop Around ChatClient
    April 3, 2026
    Build a simple conversational loop with Spring AI’s ChatClient that continuously accepts user input, sends it to an LLM, and returns the response in real time.
    foundations