# Building and Running Agentic AI Applications: A Comprehensive Guide

Maxim Dudko

Hatched by Maxim Dudko

Nov 10, 2025

4 min read

0

Building and Running Agentic AI Applications: A Comprehensive Guide

In the rapidly evolving landscape of artificial intelligence, agentic AI applications are emerging as a transformative force in software development. Unlike traditional applications that merely respond to user inputs, agentic applications possess the ability to decide, plan, and act autonomously. This article explores the architecture, development process, and practical implementation of agentic AI applications using Docker and the Lunary API.

Understanding Agentic AI Applications

At their core, agentic AI applications are built upon three fundamental components: models, agents, and gateways.

  1. Models: These are the sophisticated algorithms—like GPTs, CodeLlamas, and Mistrals—that perform reasoning, writing, and planning functions. They serve as the intelligent engine driving the application's capabilities.

  2. Agents: Agents are the logical entities that manage tasks within the application. They take a high-level goal, decompose it into actionable steps, and orchestrate the execution of these steps by interacting with various components, including the user interface, tools, and models.

  3. MCP Gateway: The Model Context Protocol (MCP) Gateway acts as a bridge, connecting agents to external APIs, tools, and services, facilitating seamless communication and functionality.

These components work in unison to create a modular and efficient architecture capable of integrating complex AI functionalities.

Leveraging Docker for Agentic Development

Docker significantly enhances the development and deployment of agentic AI applications. It provides a unified, secure, and developer-friendly workflow that simplifies the integration of models, tool gateways, and cloud infrastructure. Here’s how Docker facilitates this process:

  • Docker Model Runner: This tool allows developers to run large language models (LLMs) locally with easy command interfaces and OpenAI-compatible APIs.

  • Docker MCP Catalog and Toolkit: It aids in discovering and securely running external tools, such as APIs and databases, following the Model Context Protocol.

  • Docker MCP Gateway: This service orchestrates and manages MCP servers, ensuring effective communication between agents and external services.

  • Docker Offload: It offers a powerful, GPU-accelerated environment for running AI applications with the same Docker Compose-based workflow used locally.

  • Docker Compose: This tool allows developers to define and run multi-container applications with a single configuration file, streamlining the development process.

Getting Started with Docker

To begin building an agentic AI application using Docker, follow these steps:

  1. Install Docker Desktop: Ensure you have Docker Desktop version 4.43 or later installed on your machine.

  2. Enable Docker Model Runner: Activate the Docker Model Runner feature to allow local execution of models.

  3. Join Docker Offload Beta: This step is crucial for utilizing cloud resources effectively.

  4. Clone a Sample Application: Use the provided Git command to clone a sample application that demonstrates connecting models to external tools.

    git clone https://github.com/docker/compose-for-agents.git  
    cd compose-for-agents/adk/  
    
  5. Run the Application: Start by running the application in Docker Offload, which is ideal for leveraging cloud resources, especially for GPU-intensive tasks.

    docker offload start  
    docker compose up  
    
  6. Access the Application: Open your web browser and navigate to http://localhost:8080 to interact with the application.

Optional: Running Locally

If your machine meets the hardware requirements (such as 3.5 GB VRAM), you can run the application entirely locally. This allows you to test the entire stack without relying on cloud services.

docker compose up  

Implementing Agentic Behavior

The agentic framework consists of various agents working together. In a typical setup, you might find:

  • Auditor Agent: This acts as the main coordinator, overseeing the tasks performed by sub-agents.

  • Critic Agent: This agent verifies factual claims using external tools.

  • Reviser Agent: It refines the outputs generated by the LLM based on the Critic's findings.

By utilizing structured modules, each agent can focus on specific tasks while contributing to the overall application goal.

Integrating Lunary for Enhanced Functionality

To further enhance your agentic AI applications, consider integrating the Lunary API. Lunary is an open-source platform designed for developers of AI chatbots and LLM-powered applications. It provides essential features like observability, prompt collaboration, and chat tracking.

Getting Started with Lunary

  1. Sign Up: Create a Lunary account to obtain your unique tracking ID.

  2. Choose Your Integration: Lunary supports popular libraries, allowing you to integrate seamlessly with Python, JavaScript, and LangChain.

  3. Monitor and Debug: Use Lunary’s observability features to monitor LLM calls and debug issues effectively.

Actionable Advice

  1. Experiment with Different Models: Explore various AI models to determine which best fits your application's needs. Check out the Docker AI Model Catalog for a wide selection.

  2. Utilize Version Control for Prompts: Leverage Lunary's prompt collaboration features to version your prompts. This will help you track changes and improve the quality of your interactions.

  3. Monitor Performance Metrics: Regularly monitor your application's performance using the observability tools provided by Lunary. This will help you identify bottlenecks and optimize your agents' efficiency.

Conclusion

Agentic AI applications are revolutionizing the way software is developed and deployed. By leveraging Docker and integrating with platforms like Lunary, developers can build robust, scalable, and efficient applications that not only respond to user queries but also act autonomously. The architecture is modular, allowing for easy integration of various components, enhancing the overall intelligence and functionality of the applications. As this technology continues to evolve, the potential for innovation and efficiency in software development is limitless.

Sources

← Back to Library

Hatch New Ideas with Glasp AI 🐣

Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)

Start Hatching 🐣