<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Manish Shivanandhan</title>
    <description>The latest articles on DEV Community by Manish Shivanandhan (@manishmshiva).</description>
    <link>https://dev.to/manishmshiva</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1245665%2Fa6a62417-7421-472f-9b2e-35981b70b85e.png</url>
      <title>DEV Community: Manish Shivanandhan</title>
      <link>https://dev.to/manishmshiva</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manishmshiva"/>
    <language>en</language>
    <item>
      <title>Getting Started with Terraform: From Zero to Production</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Mon, 13 Apr 2026 09:28:54 +0000</pubDate>
      <link>https://dev.to/manishmshiva/getting-started-with-terraform-from-zero-to-production-13m</link>
      <guid>https://dev.to/manishmshiva/getting-started-with-terraform-from-zero-to-production-13m</guid>
      <description>&lt;p&gt;Infrastructure has undergone a fundamental shift over the past decade.&lt;/p&gt;

&lt;p&gt;What was once configured manually through dashboards and shell access is now defined declaratively in code. This shift is not just about convenience. It is about repeatability, auditability, and control.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.hashicorp.com/terraform" rel="noopener noreferrer"&gt;Terraform&lt;/a&gt; sits at the center of this transformation. It allows you to define infrastructure using configuration files, apply those configurations consistently across environments, and evolve systems safely over time.&lt;/p&gt;

&lt;p&gt;For teams building modern applications, especially on platform abstractions, Terraform becomes the control plane for everything from application deployment to databases and networking. &lt;/p&gt;

&lt;p&gt;The Terraform provider from &lt;a href="https://sevalla.com/" rel="noopener noreferrer"&gt;Sevalla&lt;/a&gt; extends this model by allowing teams to manage the entire application platform as code, not just underlying infrastructure. It enables you to define applications, databases, networking, storage, and deployment workflows in a single, unified configuration. &lt;/p&gt;

&lt;p&gt;Instead of stitching together multiple tools or relying on manual setup, everything from code deployment to traffic routing and environment configuration can be expressed declaratively. This creates a consistent, repeatable system where environments can be replicated easily, changes are version-controlled, and production setups can evolve safely over time.&lt;br&gt;
This article walks through how to go from zero to a production-ready setup using Terraform and the &lt;a href="https://github.com/sevalla-hosting/terraform-provider-sevalla/" rel="noopener noreferrer"&gt;Sevalla Terraform Provider&lt;/a&gt;, focusing on practical concepts rather than theory.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Terraform Actually Does
&lt;/h2&gt;

&lt;p&gt;Terraform is an infrastructure-as-code tool that translates configuration files into real infrastructure. You describe the desired state of your system, and Terraform figures out how to achieve it.&lt;br&gt;
At a high level, Terraform operates in three phases.&lt;br&gt;
First, it initializes the working directory and downloads required providers. Providers are plugins that allow Terraform to interact with specific platforms.&lt;br&gt;
Next, it creates an execution plan. This plan shows what resources will be created, modified, or destroyed to match your configuration.&lt;br&gt;
Finally, it applies the plan, making the necessary API calls to bring your infrastructure into the desired state.&lt;br&gt;
The key idea is that Terraform is declarative. You define what you want, not how to do it. Terraform handles the orchestration.&lt;br&gt;
This abstraction becomes extremely powerful as systems grow more complex.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting Up Terraform for the First Time
&lt;/h2&gt;

&lt;p&gt;Getting started with Terraform requires very little setup. You install the CLI, create a working directory, and define a basic configuration.&lt;br&gt;
A &lt;a href="https://developer.hashicorp.com/terraform/language/syntax/configuration" rel="noopener noreferrer"&gt;Terraform configuration&lt;/a&gt; is written in HCL, a domain-specific language designed to be human-readable. Even a simple configuration establishes the core concepts.&lt;br&gt;
You define the required provider, configure authentication, and declare resources.&lt;br&gt;
Here is a minimal example that provisions an application using a managed platform provider.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nx"&gt;required_providers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;sevalla&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;source&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"sevalla-hosting/sevalla"&lt;/span&gt;
     &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"~&amp;gt; 1.0"&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"sevalla"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"sevalla_clusters"&lt;/span&gt; &lt;span class="s2"&gt;"all"&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"sevalla_application"&lt;/span&gt; &lt;span class="s2"&gt;"web"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nx"&gt;display_name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-web-app"&lt;/span&gt;
 &lt;span class="nx"&gt;cluster_id&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sevalla_clusters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clusters&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
 &lt;span class="nx"&gt;source&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"publicGit"&lt;/span&gt;
 &lt;span class="nx"&gt;repo_url&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://github.com/example/app"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration does several things.&lt;br&gt;
It declares the provider, which tells Terraform how to communicate with the platform. It fetches available clusters using a data source. It defines an application resource that points to a Git repository.&lt;br&gt;
Even at this stage, you are already defining infrastructure in a reproducible way.&lt;br&gt;
To execute this configuration, you run three commands.&lt;br&gt;
You initialize the project, generate a plan, and apply it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SEVALLA_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your-api-key"&lt;/span&gt;
terraform init
terraform plan
terraform apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After applying, your application is deployed without manual steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Providers, Resources, and Data Sources
&lt;/h2&gt;

&lt;p&gt;Terraform revolves around three core constructs.&lt;br&gt;
Providers act as the bridge between Terraform and external systems. They expose APIs in a structured way that Terraform can use.&lt;br&gt;
Resources represent the infrastructure you want to create. These are the building blocks of your system. Applications, databases, load balancers, and storage buckets are all modeled as resources.&lt;br&gt;
Data sources allow you to query existing infrastructure. Instead of creating something new, you retrieve information that can be used elsewhere in your configuration.&lt;br&gt;
The combination of these constructs allows you to build flexible and composable systems.&lt;br&gt;
For example, you can fetch a list of available clusters using a data source and then dynamically assign your application to one of them. This reduces hardcoding and improves portability.&lt;br&gt;
As your configuration grows, these abstractions help you maintain clarity and structure.&lt;/p&gt;
&lt;h2&gt;
  
  
  Building a Real Application Stack
&lt;/h2&gt;

&lt;p&gt;A production system is rarely just a single application. It typically includes multiple components that need to work together.&lt;br&gt;
With Terraform, you can define the entire stack in one place.&lt;br&gt;
You might start with an application, then add a managed database, connect them internally, and expose the application through a load balancer.&lt;br&gt;
A simplified flow looks like this.&lt;br&gt;
You define the application resource that pulls code from a repository. You provision a database resource, such as PostgreSQL or Redis. You establish an internal connection between the application and the database. You configure environment variables for credentials. You optionally add a custom domain or routing layer.&lt;br&gt;
Each of these components is a resource, and Terraform ensures they are created in the correct order.&lt;br&gt;
This approach eliminates configuration drift. Instead of manually setting up each component, everything is defined in code and version-controlled.&lt;br&gt;
It also makes environments consistent. Your staging and production setups can be identical except for a few variables.&lt;/p&gt;
&lt;h2&gt;
  
  
  Managing Configuration and Secrets
&lt;/h2&gt;

&lt;p&gt;Production systems require configuration. This includes environment variables, API keys, and connection strings.&lt;br&gt;
Terraform provides multiple ways to handle this.&lt;br&gt;
You can define variables in your configuration and pass values at runtime. Sensitive values, such as API keys, are typically injected via environment variables.&lt;br&gt;
For example, authentication is handled through an API key that can be set as an environment variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SEVALLA_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your-api-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This avoids hardcoding credentials in configuration files.&lt;br&gt;
You can also define environment variables as part of your infrastructure. This allows you to configure applications consistently across environments.&lt;br&gt;
The important principle is separation of concerns. Infrastructure definitions should remain clean, while sensitive data is managed securely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scaling and Process Configuration
&lt;/h2&gt;

&lt;p&gt;Modern applications often consist of multiple processes. A web server handles incoming requests, background workers process jobs, and scheduled tasks run periodically.&lt;br&gt;
Terraform allows you to define these processes explicitly.&lt;br&gt;
You can configure different process types, allocate resources, and scale them independently. This is particularly useful for handling variable workloads.&lt;br&gt;
For example, you might scale web processes based on incoming traffic while keeping background workers at a steady level.&lt;br&gt;
By defining this in code, scaling becomes predictable and repeatable.&lt;br&gt;
You avoid manual intervention and ensure that your system behaves consistently under load.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Networking and Traffic Management
&lt;/h2&gt;

&lt;p&gt;As systems grow, managing traffic becomes more important.&lt;br&gt;
Terraform enables you to define networking components such as load balancers and routing rules. You can map domains to applications, distribute traffic across multiple services, and control access.&lt;br&gt;
This is essential for production readiness.&lt;br&gt;
A load balancer can improve availability by distributing traffic across instances. Domain configuration ensures that users can access your application through a stable endpoint.&lt;br&gt;
You can also define restrictions, such as IP allowlists, to enhance security.&lt;br&gt;
All of this is managed declaratively, which reduces the risk of misconfiguration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pipelines and Continuous Deployment
&lt;/h2&gt;

&lt;p&gt;Production systems require reliable deployment workflows.&lt;br&gt;
Terraform can be used to define deployment pipelines and stages. This allows you to model how code moves from development to production.&lt;br&gt;
You can define multiple stages, associate applications with each stage, and control how deployments are triggered.&lt;br&gt;
This brings infrastructure and deployment logic into a single system.&lt;br&gt;
Instead of relying on external scripts or manual processes, everything is defined in a structured and version-controlled way.&lt;br&gt;
It also improves traceability. You can see exactly how a system is configured and how changes are applied over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  From Configuration to Production
&lt;/h2&gt;

&lt;p&gt;Moving from a simple setup to production involves more than just adding resources. It requires discipline in how you manage infrastructure.&lt;br&gt;
Version control becomes critical. Every change to your infrastructure should go through code review. This reduces the risk of introducing breaking changes.&lt;br&gt;
State management is another key aspect. Terraform keeps track of the current state of your infrastructure. This state must be stored securely and consistently, especially in team environments.&lt;br&gt;
You also need to think about environment separation. Development, staging, and production should be isolated but defined using similar configurations.&lt;br&gt;
Finally, observability should be integrated from the start. While Terraform provisions infrastructure, you need monitoring and logging to understand how it behaves in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Terraform Scales with You
&lt;/h2&gt;

&lt;p&gt;Terraform works well for small projects, but its real value becomes apparent as systems grow.&lt;br&gt;
As you add more services, environments, and dependencies, manual management becomes unsustainable. Terraform provides a structured way to manage this complexity.&lt;br&gt;
It enforces consistency. It enables automation. It creates a single source of truth for your infrastructure.&lt;br&gt;
Most importantly, it allows teams to move faster without sacrificing reliability.&lt;br&gt;
By defining infrastructure as code, you reduce ambiguity. You make systems easier to understand, easier to debug, and easier to evolve.&lt;br&gt;
That is what takes you from zero to production in a way that actually scales.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Building AI Agents That Can Control Cloud Infrastructure</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Thu, 26 Mar 2026 05:36:48 +0000</pubDate>
      <link>https://dev.to/manishmshiva/building-ai-agents-that-can-control-cloud-infrastructure-2852</link>
      <guid>https://dev.to/manishmshiva/building-ai-agents-that-can-control-cloud-infrastructure-2852</guid>
      <description>&lt;p&gt;Cloud infrastructure has become deeply programmable over the past decade.&lt;/p&gt;

&lt;p&gt;Nearly every platform exposes APIs that allow developers to create applications, provision databases, configure networking, and retrieve metrics.&lt;/p&gt;

&lt;p&gt;This shift enabled automation via Infrastructure as Code and CI/CD pipelines, allowing teams to manage systems through scripts rather than dashboards.&lt;/p&gt;

&lt;p&gt;Now another layer of automation is emerging. AI agents are starting to participate directly in development workflows. These agents can read codebases, generate implementations, run terminal commands, and help debug systems. The next logical step is to allow them to interact with the infrastructure itself.&lt;/p&gt;

&lt;p&gt;Instead of manually inspecting dashboards or remembering complex command-line syntax, developers can ask an AI agent to check system state, deploy services, or retrieve metrics. The agent performs these tasks by interacting with cloud APIs on behalf of the user.&lt;/p&gt;

&lt;p&gt;This capability opens the door to a new type of workflow where infrastructure becomes conversational, programmable, and deeply integrated into development environments.&lt;/p&gt;

&lt;p&gt;In this article, we will explore how AI agents can interact with cloud infrastructure through APIs, the challenges of exposing large APIs to AI systems, and how architectures like MCP make it possible for agents to discover and execute infrastructure operations safely. &lt;/p&gt;

&lt;p&gt;We will also look at a practical example of connecting an AI agent to a cloud platform like Sevalla using the search-and-execute pattern.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;AI Agents Are Becoming Part of the Development Environment&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Modern developer tools increasingly embed AI assistants directly inside coding environments. Editors such as Cursor, Windsurf, and Claude Code allow developers to ask questions about their projects, generate new code, and execute commands without leaving the editor.&lt;/p&gt;

&lt;p&gt;Instead of manually navigating documentation or writing boilerplate code, developers can simply describe what they want. The AI interprets the request and produces the necessary actions.&lt;/p&gt;

&lt;p&gt;This approach is already common for tasks like writing functions, refactoring code, or debugging errors. However, infrastructure management is still largely handled through dashboards, terminal commands, or external tooling.&lt;/p&gt;

&lt;p&gt;If AI agents are going to assist developers effectively, they need access to the same systems developers interact with every day. That means accessing APIs that manage applications, databases, deployments, and other infrastructure resources.&lt;/p&gt;

&lt;p&gt;The challenge is providing that access in a structured and scalable way.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Connecting AI Agents to External Systems&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;AI agents do not inherently know how to interact with external services. They need a framework that allows them to call tools and access data safely.&lt;/p&gt;

&lt;p&gt;Model Context Protocol, or MCP, provides one such framework. MCP is designed to let AI assistants connect to external tools in a standardized way.&lt;/p&gt;

&lt;p&gt;An MCP server exposes tools that an AI agent can call when it needs information or wants to act. These tools might retrieve data from a database, query logs, interact with APIs, or execute commands on a remote system.&lt;/p&gt;

&lt;p&gt;When the AI agent receives a request from the user, it determines which tool to call and executes that tool through the MCP server. The results are returned to the agent, which can then continue reasoning about the problem.&lt;/p&gt;

&lt;p&gt;This architecture allows AI assistants to interact with complex systems while maintaining a clear boundary between the agent and the external environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Challenge of Large Cloud APIs&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;While MCP enables connecting AI agents to infrastructure systems, cloud platforms introduce an additional challenge.&lt;/p&gt;

&lt;p&gt;Most cloud platforms expose large APIs with many endpoints. A typical platform might include endpoints for managing applications, databases, storage, networking, domains, metrics, logs, and deployment pipelines.&lt;/p&gt;

&lt;p&gt;If an MCP server exposes each endpoint as a separate tool, the number of tools can quickly grow into the hundreds.&lt;/p&gt;

&lt;p&gt;This creates several problems. First, the AI agent must understand the purpose and parameters of every available tool before deciding which one to use. This increases the amount of context required for the agent to operate effectively.&lt;/p&gt;

&lt;p&gt;Second, maintaining hundreds of tools becomes difficult for developers who build and maintain the MCP server.&lt;/p&gt;

&lt;p&gt;Third, the system becomes rigid. Every time a new API endpoint is added, a new tool must also be created and documented.&lt;/p&gt;

&lt;p&gt;For large APIs, this approach quickly becomes impractical.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;A Simpler Pattern for API Access&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A different architecture solves this problem by dramatically reducing the number of tools exposed to the AI.&lt;/p&gt;

&lt;p&gt;Instead of providing a separate tool for every API endpoint, the MCP server exposes only two capabilities.&lt;/p&gt;

&lt;p&gt;The first capability allows the agent to search the API specification. This lets the agent discover available endpoints, understand parameters, and inspect request or response schemas.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22cii6v118q2iq2cx5fl.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22cii6v118q2iq2cx5fl.webp" alt=" " width="480" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The second capability allows the agent to execute code that calls the API.&lt;/p&gt;

&lt;p&gt;In this model, the AI agent dynamically generates the code required to call the API. Because the agent can search the specification and write its own API calls, the MCP server does not need to define individual tools for every endpoint.&lt;/p&gt;

&lt;p&gt;This pattern drastically reduces the complexity of the integration while still giving the agent full access to the underlying platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why Sandboxed Code Execution Is Important&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Allowing AI agents to generate and execute code raises important security considerations.&lt;/p&gt;

&lt;p&gt;If the generated code runs unrestricted, it could potentially access sensitive parts of the system or perform unintended operations. To prevent this, the execution environment must be carefully controlled.&lt;/p&gt;

&lt;p&gt;A common solution is running the generated code inside a sandboxed environment. In this setup, the code runs in an isolated runtime with limited permissions. The environment exposes only specific functions that allow interaction with the platform’s API.&lt;/p&gt;

&lt;p&gt;Because the code cannot access the host system directly, the risk of unintended behavior is greatly reduced. At the same time, the AI agent retains the flexibility to generate custom API calls as needed.&lt;/p&gt;

&lt;p&gt;This combination of dynamic code generation and sandboxed execution makes it possible for AI agents to interact with complex APIs safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Practical Example with Sevalla&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A practical implementation of this architecture can be seen in the Sevalla MCP server, which exposes a cloud platform’s API to AI agents through the search-and-execute pattern.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sevalla.com" rel="noopener noreferrer"&gt;Sevalla &lt;/a&gt;is a PaaS provider designed for developers shipping production applications. It offers app hosting, database, object storage, and static site hosting for your projects. We also have other options, such as AWS and Azure, that come with their own MCP tools.&lt;/p&gt;

&lt;p&gt;Instead of registering hundreds of tools for every API endpoint, the server provides only two tools that allow the AI agent to explore and interact with the entire platform. Find the full documentation for &lt;a href="https://github.com/sevalla-hosting/mcp" rel="noopener noreferrer"&gt;Sevalla’s MCP server&lt;/a&gt; here.&lt;/p&gt;

&lt;p&gt;The first tool, search, allows the agent to query the platform’s OpenAPI specification. Through this interface the agent can discover available endpoints, understand parameters, and inspect response schemas.&lt;/p&gt;

&lt;p&gt;Because the API specification is searchable, the agent does not need to know the structure of the platform’s API in advance. It can explore the API dynamically based on the task it needs to perform.&lt;/p&gt;

&lt;p&gt;For example, if the user asks the agent to list all applications running in their account, the agent can begin by searching the API specification.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const endpoints = await sevalla.search("list all applications")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The result returns the relevant API definitions, including the correct path and parameters required for the request. Once the agent understands which endpoint to use, it can generate the necessary API call.&lt;/p&gt;

&lt;p&gt;The second tool, execute, runs JavaScript inside a sandboxed V8 environment. Within this environment the agent can call the API using a helper function provided by the platform.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const apps = await sevalla.request({&lt;br&gt;
  method: "GET",&lt;br&gt;
  path: "/applications"&lt;br&gt;
})&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Because the code runs inside an isolated V8 sandbox, the generated script cannot access the host system. The only permitted interaction is through the API helper function. This ensures that the AI agent can perform infrastructure operations safely while still retaining the flexibility to generate dynamic API calls.&lt;/p&gt;

&lt;p&gt;This approach allows an agent to discover and interact with many parts of the platform without requiring predefined tools for each capability. After discovering endpoints through the API specification, the agent can retrieve application data, inspect deployments, query metrics, or manage infrastructure resources through generated API calls.&lt;/p&gt;

&lt;p&gt;The design also significantly reduces context usage. Traditional MCP integrations might require hundreds of tools to represent every endpoint of a large API. In contrast, the search-and-execute pattern allows the entire API surface to be accessed through just two tools.&lt;/p&gt;

&lt;p&gt;For developers connecting AI assistants to infrastructure platforms, this architecture provides a practical way to expose large APIs while keeping the integration simple and efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What This Means for Developers&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Allowing AI agents to interact with infrastructure APIs changes how developers manage systems.&lt;/p&gt;

&lt;p&gt;Instead of manually navigating dashboards or writing long sequences of commands, developers can describe what they want in natural language. The AI agent can interpret the request, discover the relevant API endpoints, and execute the required operations.&lt;/p&gt;

&lt;p&gt;This approach also improves observability and debugging. When something goes wrong, the agent can query logs, inspect metrics, and retrieve system state without requiring the developer to manually gather information.&lt;/p&gt;

&lt;p&gt;Over time, this type of integration could significantly reduce the friction involved in managing complex cloud systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Next Evolution of Infrastructure Automation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Infrastructure automation has evolved through several stages. Early cloud systems relied heavily on manual configuration through web interfaces. Infrastructure as Code later allowed teams to define infrastructure using scripts and configuration files.&lt;/p&gt;

&lt;p&gt;CI/CD pipelines then automated the process of deploying and updating systems.&lt;/p&gt;

&lt;p&gt;AI agents represent the next step in this progression. By combining APIs, MCP integrations, and sandboxed execution environments, developers can allow intelligent systems to reason about infrastructure and interact with it safely.&lt;/p&gt;

&lt;p&gt;Instead of static integrations, agents can dynamically discover and call APIs as needed. This makes infrastructure management more flexible and accessible while maintaining the reliability of programmable systems.&lt;/p&gt;

&lt;p&gt;As AI tools become more deeply embedded in development environments, the ability for agents to understand and control infrastructure will likely become a standard capability for modern platforms.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Infrastructure as Code with APIs: Automating Cloud Resources the Developer Way</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Fri, 20 Mar 2026 04:09:01 +0000</pubDate>
      <link>https://dev.to/manishmshiva/infrastructure-as-code-with-apis-automating-cloud-resources-the-developer-way-3gop</link>
      <guid>https://dev.to/manishmshiva/infrastructure-as-code-with-apis-automating-cloud-resources-the-developer-way-3gop</guid>
      <description>&lt;p&gt;Modern software development moves fast. Teams deploy code many times a day. New environments appear and disappear constantly. In this world, manual infrastructure setup simply does not scale.&lt;/p&gt;

&lt;p&gt;For years, developers logged into dashboards, clicked through forms, and configured servers by hand. This worked for small projects, but it quickly became fragile. Every manual step increased the chance of mistakes. Environments drifted apart. Reproducing the same setup became difficult.&lt;/p&gt;

&lt;p&gt;Infrastructure as Code (IaC) solves this problem. Instead of clicking through interfaces, developers define infrastructure using code. This approach makes infrastructure predictable, repeatable, and easy to automate.&lt;/p&gt;

&lt;p&gt;In recent years, another approach has become popular alongside traditional IaC tools: using cloud APIs directly to create and manage infrastructure. This gives developers full control over how resources are provisioned and integrated into workflows.&lt;/p&gt;

&lt;p&gt;This article explains what Infrastructure as Code means, why APIs are a powerful way to implement it, and how developers can automate cloud resources using simple scripts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Infrastructure as Code?
&lt;/h2&gt;

&lt;p&gt;Infrastructure as Code means managing infrastructure using code instead of manual processes.&lt;/p&gt;

&lt;p&gt;Instead of setting up servers, databases, and networks by hand, you define them in scripts or configuration files. These files describe the desired state of your infrastructure. A tool or script then creates and maintains that state automatically.&lt;/p&gt;

&lt;p&gt;For example, instead of manually creating a database, you might define it in code like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;database:&lt;br&gt;
  name: app_db&lt;br&gt;
  engine: postgres&lt;br&gt;
  version: 16&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Once the code runs, the database is created automatically.&lt;/p&gt;

&lt;p&gt;This approach provides several key benefits.&lt;/p&gt;

&lt;p&gt;First, it improves consistency. Every environment is created from the same definition. Development, staging, and production environments stay aligned.&lt;/p&gt;

&lt;p&gt;Second, it improves repeatability. If infrastructure fails, it can be recreated from code in minutes.&lt;/p&gt;

&lt;p&gt;Third, it improves version control. Infrastructure definitions live in the same repositories as application code. Teams can review, track, and roll back changes.&lt;/p&gt;

&lt;p&gt;Finally, it enables automation. Infrastructure can be created during deployments, tests, or CI/CD pipelines.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Limits of Manual Infrastructure
&lt;/h2&gt;

&lt;p&gt;Before IaC became common, infrastructure management relied heavily on dashboards and manual configuration.&lt;/p&gt;

&lt;p&gt;A developer would open a cloud console and perform steps like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a server&lt;/li&gt;
&lt;li&gt;Attach storage&lt;/li&gt;
&lt;li&gt;Configure environment variables&lt;/li&gt;
&lt;li&gt;Connect a database&lt;/li&gt;
&lt;li&gt;Add a domain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These steps worked, but they introduced problems.&lt;/p&gt;

&lt;p&gt;Manual configuration is hard to document. Even if teams write guides, small details are often missed. Over time, environments drift apart.&lt;/p&gt;

&lt;p&gt;Manual processes also slow down development. Spinning up a new environment may take hours instead of seconds.&lt;/p&gt;

&lt;p&gt;Even worse, manual infrastructure cannot easily be tested. If something breaks, reproducing the same conditions becomes difficult.&lt;/p&gt;

&lt;p&gt;Infrastructure as Code removes these problems by turning infrastructure into something that can be scripted, tested, and automated.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why APIs Are a Powerful IaC Tool
&lt;/h2&gt;

&lt;p&gt;Many people associate Infrastructure as Code with tools like Terraform or CloudFormation. These tools are powerful, but they are not the only option.&lt;/p&gt;

&lt;p&gt;Every modern cloud platform exposes an API. That API allows developers to create resources programmatically.&lt;/p&gt;

&lt;p&gt;This means infrastructure can be controlled directly from code using HTTP requests or command-line interfaces.&lt;/p&gt;

&lt;p&gt;Using APIs for IaC has several advantages.&lt;/p&gt;

&lt;p&gt;First, it offers maximum flexibility. Developers can integrate infrastructure creation directly into applications, deployment scripts, or internal tools.&lt;/p&gt;

&lt;p&gt;Second, it reduces tooling complexity. Instead of learning a specialized IaC language, teams can use languages they already know, such as Python, JavaScript, or Bash.&lt;/p&gt;

&lt;p&gt;Third, it enables dynamic infrastructure. Scripts can create resources only when needed, scale them automatically, and remove them when work is complete.&lt;/p&gt;

&lt;p&gt;For example, a test suite could automatically create a database, run tests, and delete the database afterwards. This keeps environments clean and reduces costs.&lt;/p&gt;

&lt;p&gt;APIs essentially turn the cloud into a programmable platform.&lt;/p&gt;
&lt;h2&gt;
  
  
  Automating Infrastructure with Scripts
&lt;/h2&gt;

&lt;p&gt;Using APIs for infrastructure automation usually follows a simple workflow.&lt;/p&gt;

&lt;p&gt;First, a script authenticates with the cloud platform using an API token or credentials.&lt;/p&gt;

&lt;p&gt;Second, the script sends requests to create or modify resources such as applications, databases, or storage.&lt;/p&gt;

&lt;p&gt;Third, the script captures identifiers or configuration values from the response.&lt;/p&gt;

&lt;p&gt;Finally, those values are used in later steps, such as deployments or integrations.&lt;/p&gt;

&lt;p&gt;Because these steps run in code, they can easily be included in CI/CD pipelines.&lt;/p&gt;

&lt;p&gt;A typical pipeline might do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create infrastructure&lt;/li&gt;
&lt;li&gt;Deploy the application&lt;/li&gt;
&lt;li&gt;Run tests&lt;/li&gt;
&lt;li&gt;Collect metrics&lt;/li&gt;
&lt;li&gt;Destroy temporary environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach ensures every deployment follows the same process.&lt;/p&gt;
&lt;h2&gt;
  
  
  Practical example with Sevalla
&lt;/h2&gt;

&lt;p&gt;A practical way to apply Infrastructure as Code through APIs is to use a command-line interface that directly interacts with a cloud platform’s API. This allows developers to automate infrastructure creation using scripts rather than dashboards.&lt;/p&gt;

&lt;p&gt;One example is the Sevalla CLI, which exposes infrastructure operations as terminal commands that can be executed manually or inside automation pipelines.&lt;/p&gt;

&lt;p&gt;Sevalla is a developer-centric PaaS designed to simplify your workflow. They provide high-performance application hosting, managed databases, object storage, and static sites in one unified platform. Alternate options include AWS and Azure, which require complex CLI tools and heavy DevOps overhead compared to Sevalla’s simplicity and ease of use.&lt;/p&gt;

&lt;p&gt;You can install the CLI using the following shell command.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl -fsSL https://raw.githubusercontent.com/sevalla-hosting/cli/main/install.sh)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Once installed, you can view the list of all available commands using the help command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjoanp7r87jj1eyp3ioei.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjoanp7r87jj1eyp3ioei.png" alt=" " width="800" height="584"&gt;&lt;/a&gt;&lt;br&gt;
The first step is authentication. Make sure you have an account on Sevalla before using the CLI.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sevalla login&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;For automated environments such as CI/CD pipelines, authentication can be done with an API token. The token is stored in an environment variable so scripts can run without user interaction.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;export SEVALLA_API_TOKEN="your-api-token"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Once authenticated, you can quickly view a list of your apps using sevalla apps list&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6y2iam0yxz1sbhc0namz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6y2iam0yxz1sbhc0namz.png" alt=" " width="800" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your infrastructure can now be created directly from the command line. For example, a developer might start by creating an application service that will run the backend code.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sevalla apps create --name myapp --source privateGit --cluster &amp;lt;id&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This command provisions a new application resource on the platform. Instead of navigating through a web interface and filling out forms, the entire setup is performed through a single command.&lt;/p&gt;

&lt;p&gt;Because the command can be stored in scripts or configuration files, it becomes part of the project’s infrastructure definition.&lt;/p&gt;

&lt;p&gt;After creating the application, developers often need a database. That can also be provisioned programmatically.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sevalla databases create \&lt;br&gt;
  --name mydb \&lt;br&gt;
  --type postgresql \&lt;br&gt;
  --db-version 16 \&lt;br&gt;
  --cluster &amp;lt;id&amp;gt; \&lt;br&gt;
  --resource-type &amp;lt;id&amp;gt; \&lt;br&gt;
  --db-name mydb \&lt;br&gt;
  --db-password secret&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This creates a PostgreSQL database with a defined version and credentials. In an automated workflow, the database creation step could run during environment setup for staging or testing.&lt;/p&gt;

&lt;p&gt;Once the application and database exist, the next step might be configuring environment variables so the application can connect to the database.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sevalla apps env-vars create &amp;lt;app-id&amp;gt; --key DATABASE_URL --value "postgres://..."&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
These configuration values can be injected during deployments, ensuring the application always receives the correct settings.&lt;/p&gt;

&lt;p&gt;Deployment automation is another key part of Infrastructure as Code. Instead of manually triggering deployments, a script can deploy new code whenever a repository is updated.&lt;/p&gt;

&lt;p&gt;sevalla apps deployments trigger  --branch main&lt;br&gt;
This allows CI/CD systems to deploy new versions of the application automatically after tests pass.&lt;/p&gt;

&lt;p&gt;Infrastructure automation also includes scaling and monitoring. For example, if an application needs more instances to handle traffic, the number of running processes can be updated programmatically.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sevalla apps processes update &amp;lt;process-id&amp;gt; --app-id &amp;lt;app-id&amp;gt; --instances 3&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Metrics can also be retrieved through the CLI. This allows monitoring tools or scripts to analyze system performance.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sevalla apps processes metrics cpu-usage &amp;lt;app-id&amp;gt; &amp;lt;process-id&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Similarly, application metrics such as response time or request rates can be queried to detect performance issues.&lt;/p&gt;

&lt;p&gt;Another common step in infrastructure automation is configuring domains. Instead of manually linking domains to applications, a script can add them during environment setup.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sevalla apps domains add &amp;lt;app-id&amp;gt; --name example.com&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
With these commands combined in scripts or pipelines, developers can fully automate the lifecycle of their infrastructure. A CI pipeline could create an application, provision a database, configure environment variables, deploy code, attach a domain, and monitor performance — all without human intervention.&lt;/p&gt;

&lt;p&gt;Because every command supports JSON output, scripts can also capture values returned by the platform and reuse them in later steps. For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;APP_ID=$(sevalla apps list --json | jq -r '.[0].id')&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
This ability to chain commands together makes it easy to build powerful automation workflows.&lt;/p&gt;

&lt;p&gt;In practice, teams often place these commands inside deployment scripts or pipeline steps. Whenever code is pushed to a repository, the pipeline automatically provisions or updates the infrastructure needed to run the application.&lt;/p&gt;

&lt;p&gt;This approach demonstrates how APIs and automation tools can turn infrastructure into something developers manage the same way they manage application code, through scripts, version control, and automated workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Infrastructure as Code Improves Developer Productivity
&lt;/h2&gt;

&lt;p&gt;One of the biggest benefits of Infrastructure as Code is developer productivity.&lt;/p&gt;

&lt;p&gt;Developers no longer need to wait for infrastructure changes or manually configure environments.&lt;/p&gt;

&lt;p&gt;Instead, infrastructure becomes part of the development workflow.&lt;/p&gt;

&lt;p&gt;When a new feature requires a service, the developer simply adds the infrastructure definition to the repository. The pipeline then creates it automatically.&lt;/p&gt;

&lt;p&gt;This reduces delays and keeps development moving quickly.&lt;/p&gt;

&lt;p&gt;It also makes onboarding easier. New team members can spin up a full environment with a single command.&lt;/p&gt;

&lt;p&gt;The Future of Infrastructure&lt;br&gt;
Cloud infrastructure continues to evolve toward automation and programmability.&lt;/p&gt;

&lt;p&gt;Platforms increasingly expose APIs that allow every resource to be created, configured, and monitored through code.&lt;/p&gt;

&lt;p&gt;This trend aligns naturally with the way developers already work.&lt;/p&gt;

&lt;p&gt;Applications are built with code. Deployments are automated with code. It makes sense that infrastructure should also be defined with code.&lt;/p&gt;

&lt;p&gt;Infrastructure as Code with APIs takes this idea even further. It allows infrastructure to be embedded directly into development workflows, pipelines, and internal tools.&lt;/p&gt;

&lt;p&gt;The result is faster development, fewer configuration errors, and more reliable systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Infrastructure as Code has transformed how teams manage cloud environments.&lt;/p&gt;

&lt;p&gt;By replacing manual configuration with code, organizations gain consistency, automation, and repeatability.&lt;/p&gt;

&lt;p&gt;Using APIs to control infrastructure adds another level of flexibility. Developers can integrate infrastructure directly into scripts, pipelines, and applications.&lt;/p&gt;

&lt;p&gt;This approach turns the cloud into a programmable platform.&lt;/p&gt;

&lt;p&gt;As systems grow more complex and deployment cycles accelerate, the ability to automate infrastructure will only become more important.&lt;/p&gt;

&lt;p&gt;For modern development teams, treating infrastructure as code is no longer optional. It is the foundation of reliable and scalable software delivery.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Deploy Your Own Agent using OpenClaw</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Mon, 09 Mar 2026 04:27:19 +0000</pubDate>
      <link>https://dev.to/manishmshiva/how-to-deploy-your-own-agent-using-openclaw-1e0c</link>
      <guid>https://dev.to/manishmshiva/how-to-deploy-your-own-agent-using-openclaw-1e0c</guid>
      <description>&lt;p&gt;&lt;strong&gt;OpenClaw lets you run a powerful AI assistant on your own infrastructure, and this guide walks you through deploying it reliably from setup to production.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://openclaw.ai/" rel="noopener noreferrer"&gt;OpenClaw&lt;/a&gt; is a self-hosted AI assistant designed to run under your control instead of inside a hosted SaaS platform.&lt;/p&gt;

&lt;p&gt;It can connect to messaging interfaces, local tools, and model providers while keeping execution and data closer to your own infrastructure.&lt;/p&gt;

&lt;p&gt;The project is actively developed, and the current ecosystem revolves around a CLI-driven setup flow, onboarding wizard, and multiple deployment paths ranging from local installs to containerised or cloud-hosted setups.&lt;/p&gt;

&lt;p&gt;This article explains how to deploy your own instance of OpenClaw from a practical systems perspective. We will look at how to deploy it on your local machine as well as a PaaS provider like Sevalla.&lt;/p&gt;

&lt;p&gt;The goal is not just to “make it run,” but to understand deployment choices, architecture implications, and operational tradeoffs so you can run a stable instance long term.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: It is dangerous to give an AI system full control of your system. Make sure you &lt;a href="https://www.kaspersky.co.in/blog/moltbot-enterprise-risk-management/30218/" rel="noopener noreferrer"&gt;understand the risks&lt;/a&gt; before running it on your machine.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Understanding What You Are Deploying
&lt;/h2&gt;

&lt;p&gt;Before touching installation commands, it helps to understand the runtime model.&lt;/p&gt;

&lt;p&gt;OpenClaw is essentially a local-first AI assistant that runs as a service and exposes interaction through chat interfaces and a &lt;a href="https://docs.openclaw.ai/concepts/architecture" rel="noopener noreferrer"&gt;gateway architecture.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The gateway acts as the operational core, handling communication between messaging platforms, models, and local capabilities.&lt;/p&gt;

&lt;p&gt;In practical terms, deploying OpenClaw means deploying three layers.&lt;/p&gt;

&lt;p&gt;The first layer is the CLI and runtime, which launches and manages the assistant.&lt;/p&gt;

&lt;p&gt;The second layer is configuration and onboarding, where you select model providers and integrations.&lt;/p&gt;

&lt;p&gt;The third layer is persistence and execution context, which determines whether OpenClaw runs on your laptop, a VPS, or inside a container.&lt;/p&gt;

&lt;p&gt;Because OpenClaw runs with access to local resources, deployment decisions are not only about convenience but also about security boundaries. Treat it as an administrative system, not just a chatbot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying on a Local Machine
&lt;/h2&gt;

&lt;p&gt;OpenClaw supports multiple deployment approaches, and the right one depends on your goals.&lt;/p&gt;

&lt;p&gt;The simplest route is to install it directly on a local machine. This is ideal for experimentation, private workflows, or development because onboarding is fast and maintenance is minimal.&lt;/p&gt;

&lt;p&gt;The installer script handles environment detection, dependency setup, and launching the onboarding wizard.&lt;/p&gt;

&lt;p&gt;The fastest way to install OpenClaw is via the official installer script. The installer downloads the CLI, installs it globally through npm, and launches onboarding automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -fsSL https://openclaw.ai/install.cmd -o install.cmd &amp;amp;&amp;amp; install.cmd &amp;amp;&amp;amp; del install.cmd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method abstracts away most environmental complexity and is recommended for first-time deployments.&lt;/p&gt;

&lt;p&gt;If you already maintain a Node environment, you can install it directly using npm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g openclaw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CLI is then used to run onboarding and optionally install a daemon for persistent background execution. This approach gives you more control over versioning and update cadence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openclaw onboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Regardless of installation path, verify that the CLI is discoverable in your shell. Environment path issues are common when global npm packages are installed under custom Node managers.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Onboarding Process
&lt;/h2&gt;

&lt;p&gt;Once installed, OpenClaw relies heavily on onboarding to bootstrap configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ogrdj5lnk190gx4fkzc.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ogrdj5lnk190gx4fkzc.webp" alt=" " width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;During onboarding you will select an AI provider, configure authentication, and choose how you want to interact with the assistant. This process establishes the core runtime state and generates local configuration files used by the gateway.&lt;/p&gt;

&lt;p&gt;Onboarding also allows you to connect messaging channels such as Telegram or Discord. These integrations transform OpenClaw from a local CLI tool into an always-accessible assistant.&lt;/p&gt;

&lt;p&gt;From a deployment perspective, this is the moment where availability requirements change. If you connect external chat platforms, your instance must remain online consistently.&lt;/p&gt;

&lt;p&gt;You can skip certain onboarding steps and configure integrations later, but for production deployments it is better to complete the initial configuration so you can validate end-to-end functionality immediately.&lt;/p&gt;

&lt;p&gt;Once you add an OpenAI API key or Claude key, you can choose to open the web UI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fct04q66qzispis25a4h8.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fct04q66qzispis25a4h8.webp" alt=" " width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;code&gt;localhost:18789&lt;/code&gt; to interact with OpenClaw.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying on the Cloud using Sevalla
&lt;/h2&gt;

&lt;p&gt;A second approach is to deploy to a VPS or cloud instance. This model gives you always-on availability and makes it possible to interact with OpenClaw from anywhere.&lt;/p&gt;

&lt;p&gt;A third approach is containerised deployment using Docker or similar tooling. This provides reproducibility and cleaner dependency isolation.&lt;/p&gt;

&lt;p&gt;Docker setups are particularly useful if you want predictable upgrades or easy migration between machines. OpenClaw’s repository includes scripts and compose configurations that support container execution workflows.&lt;/p&gt;

&lt;p&gt;I have set up a custom &lt;a href="https://hub.docker.com/r/manishmshiva/openclaw" rel="noopener noreferrer"&gt;Docker image&lt;/a&gt; to load OpenClaw into a PaaS platform like Sevalla.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sevalla.com/" rel="noopener noreferrer"&gt;Sevalla&lt;/a&gt; is a developer-friendly PaaS provider. It offers application hosting, database, object storage, and static site hosting for your projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.sevalla.com/" rel="noopener noreferrer"&gt;Log in&lt;/a&gt; to Sevalla and click “Create application”. Choose “Docker image” as the application source instead of a GitHub repository. Use &lt;code&gt;manishmshiva/openclaw&lt;/code&gt; as the Docker image, and it will be pulled automatically from &lt;a href="https://dockerhub.com/" rel="noopener noreferrer"&gt;DockerHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv9ifsvvc485gy0ogg9pw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv9ifsvvc485gy0ogg9pw.webp" alt=" " width="800" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click “Create application” and go to the environment variables. Add an environment variable &lt;code&gt;ANTHROPIC_API_KEY&lt;/code&gt;. Then go to “Deployments” and click “Deploy now”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4x0d4ralb53d96njhprc.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4x0d4ralb53d96njhprc.webp" alt=" " width="800" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the deployment is successful, you can click “Visit app” and interact with the UI with the sevalla provided url.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F743enysjaipec93mmyuu.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F743enysjaipec93mmyuu.webp" alt=" " width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Interacting with the Agent
&lt;/h2&gt;

&lt;p&gt;There are many ways to interact with the agent once you set up Openclaw. You can configure a &lt;a href="https://medium.com/chatfuel-blog/how-to-create-your-own-telegram-bot-who-answer-its-users-without-coding-996de337f019" rel="noopener noreferrer"&gt;Telegram bot&lt;/a&gt; to interact with your agent. Basically, the agent will (try to) do a task similar to a human assistant. Its capabilities depend on how much access you provide the agent.&lt;/p&gt;

&lt;p&gt;You can ask it to clean your inbox, watch a website for new articles, and perform many other tasks. Please note that providing OpenClaw access to your critical apps or files is not ideal or secure. This is still a system in its early stages, and the risk of it making a mistake or exposing your private information is high.&lt;/p&gt;

&lt;p&gt;Here are some of the ways &lt;a href="https://openclaw.ai/showcase" rel="noopener noreferrer"&gt;people are using OpenClaw.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Security and Operational Considerations
&lt;/h2&gt;

&lt;p&gt;Because OpenClaw can execute tasks and access system resources, deployment security is not optional. The safest baseline is to bind services to localhost and access them through secure tunnels when remote control is required. This significantly reduces exposure risk.&lt;/p&gt;

&lt;p&gt;When deploying on a VPS, harden the host like any administrative service. Use non-root users, keep packages updated, restrict inbound ports, and monitor logs. If you are integrating messaging channels, treat tokens and API keys as sensitive secrets and avoid storing them in plaintext configuration where possible.&lt;/p&gt;

&lt;p&gt;Containerization helps isolate dependencies but does not eliminate risk. The container still executes code on your host, so network and volume permissions should be carefully scoped.&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating and Maintaining Your Instance
&lt;/h2&gt;

&lt;p&gt;OpenClaw evolves quickly, with frequent releases and feature changes. Keeping your instance updated is important not only for features but also for stability and compatibility with integrations.&lt;/p&gt;

&lt;p&gt;For npm-based installations, updates are straightforward, but you should test upgrades in a staging environment if your assistant handles important workflows. For source-based deployments, pull changes and rebuild consistently rather than mixing old build artifacts with new code.&lt;/p&gt;

&lt;p&gt;Monitoring is another overlooked aspect. Even simple log inspection can reveal integration failures early. If your deployment is mission-critical, consider external uptime checks or process supervisors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Deploying your own OpenClaw agent is ultimately about taking control of how your AI assistant works, where it runs, and how it fits into your daily workflows. While the setup process is straightforward, the real value comes from understanding the choices you make along the way, whether you run it locally for privacy, host it in the cloud for constant availability, or use containers for consistency and portability.&lt;/p&gt;

&lt;p&gt;As the ecosystem around self-hosted AI continues to evolve, tools like OpenClaw make it possible to move beyond relying entirely on third-party platforms. Running your own agent gives you flexibility, ownership, and the freedom to shape the experience around your needs.&lt;/p&gt;

&lt;p&gt;Start small, experiment safely, and gradually build confidence in how your assistant operates. Over time, what begins as a simple deployment can become a dependable, personalized system that works the way you want , under your control.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>A Vibe Coder’s Guide to Deployment using a PaaS</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Wed, 04 Mar 2026 12:47:50 +0000</pubDate>
      <link>https://dev.to/manishmshiva/a-vibe-coders-guide-to-deployment-using-a-paas-2hd9</link>
      <guid>https://dev.to/manishmshiva/a-vibe-coders-guide-to-deployment-using-a-paas-2hd9</guid>
      <description>&lt;p&gt;&lt;strong&gt;A practical, no-nonsense guide to getting your vibe-coded app live with a PaaS, without falling into DevOps rabbit holes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Vibe coding is about momentum.&lt;/p&gt;

&lt;p&gt;You open your editor, prompt an AI, stitch pieces together, and suddenly you have something that works.&lt;/p&gt;

&lt;p&gt;Maybe it’s messy. Maybe the architecture is not perfect. But it’s alive, and that’s the point.&lt;/p&gt;

&lt;p&gt;Then comes deployment. This is where the vibe usually dies.&lt;/p&gt;

&lt;p&gt;Suddenly, you’re reading about containers, load balancers, CI/CD pipelines, infrastructure diagrams, and networking concepts you never asked for. You wanted to ship a thing. Instead, you’re learning accidental DevOps.&lt;/p&gt;

&lt;p&gt;The truth is simple. Most vibe-coded apps don’t need complex infrastructure. They just need a clean path from code → live URL.&lt;/p&gt;

&lt;p&gt;That’s where a Platform-as-a-Service fits in. It removes the infrastructure ceremony and lets deployment feel like a natural extension of building.&lt;/p&gt;

&lt;p&gt;This guide is not about perfect production architecture. It’s about shipping fast without losing momentum.&lt;/p&gt;

&lt;p&gt;In this article, we will look at how to deploy a simple vibe-coded app using &lt;a href="https://sevalla.com/" rel="noopener noreferrer"&gt;Sevalla&lt;/a&gt;. There are other options like Railway, render, etc., with similar features, and you can &lt;a href="https://www.freecodecamp.org/news/top-heroku-alternatives-for-deployment/" rel="noopener noreferrer"&gt;pick one from this list.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What “Vibe Deployment” Actually Means
&lt;/h2&gt;

&lt;p&gt;Traditional deployment advice assumes you’re building a long-term, heavily engineered system.&lt;/p&gt;

&lt;p&gt;Vibe coders operate differently. The goal is speed, feedback, and iteration.&lt;/p&gt;

&lt;p&gt;A vibe-friendly deployment workflow has a few core characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Minimal configuration:&lt;/strong&gt; You shouldn’t spend hours setting up environments before seeing your app live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast feedback loops:&lt;/strong&gt; Every push should quickly show you the result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safe defaults:&lt;/strong&gt; You shouldn’t need deep infra knowledge to avoid obvious mistakes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words, deployment shouldn’t be a “phase.” It should be part of the normal development loop.&lt;/p&gt;

&lt;p&gt;You build. You push. It updates. You keep going.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Typical Vibe-Coded App
&lt;/h2&gt;

&lt;p&gt;Most vibe-coded projects look similar under the hood.&lt;/p&gt;

&lt;p&gt;There’s usually a frontend generated or accelerated by AI using React, Next.js, Vue, or something equally modern. The backend might be a small API, sometimes written quickly without strict structure.&lt;/p&gt;

&lt;p&gt;Data lives in a managed database. Authentication might be glued together from a few libraries.&lt;/p&gt;

&lt;p&gt;The code evolves rapidly. Patterns change weekly. Files get renamed, rewritten, or deleted without ceremony.&lt;/p&gt;

&lt;p&gt;And that’s fine.&lt;/p&gt;

&lt;p&gt;The problem is that traditional deployment workflows assume stability and planning. They expect clean separation between environments, carefully defined build pipelines, and long-term operational thinking.&lt;/p&gt;

&lt;p&gt;Vibe-coded apps need the opposite: something that tolerates change and rewards experimentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The PaaS Mental Model
&lt;/h2&gt;

&lt;p&gt;The biggest shift with a PaaS is how you think about deployment.&lt;/p&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which server should I use?&lt;/li&gt;
&lt;li&gt;How do I configure networking?&lt;/li&gt;
&lt;li&gt;What container setup do I need?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You think in terms of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect your repository.&lt;/li&gt;
&lt;li&gt;Configure the app once.&lt;/li&gt;
&lt;li&gt;Deploy automatically.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A PaaS treats your project as a service that can be built and run. You don’t manage infrastructure; you define the minimum information needed to run your code.&lt;/p&gt;

&lt;p&gt;There are only a few concepts you really need to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Services:&lt;/strong&gt; Each deployable unit of your app. A frontend or backend typically becomes a service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment variables:&lt;/strong&gt; Secrets and configuration that differ between local and production.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto builds:&lt;/strong&gt; Every code push triggers a build and deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s it. The system handles the rest.&lt;/p&gt;

&lt;p&gt;The result is important: deployment stops being a separate discipline and becomes just another part of coding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shipping Your First App on Sevalla
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://sevalla.com/" rel="noopener noreferrer"&gt;Sevalla&lt;/a&gt; is a developer-friendly PaaS provider. It offers application hosting, database, object storage, and static site hosting for your projects.&lt;/p&gt;

&lt;p&gt;Let’s walk through what deployment actually looks like in practice. I have already written a few tutorials on both &lt;a href="https://www.freecodecamp.org/news/how-to-build-and-deploy-a-loganalyzer-agent-using-langchain/" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://www.freecodecamp.org/news/build-and-deploy-an-image-hosting-service-on-sevalla/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; projects, building an app from scratch and deploying it on Sevalla.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Connect Your Repository
&lt;/h3&gt;

&lt;p&gt;The starting point is your Git repository. &lt;a href="https://app.sevalla.com/login" rel="noopener noreferrer"&gt;Log in&lt;/a&gt; to Sevalla using your GitHub account, or you can connect it after logging in with your email.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx6h3ronlautdw96lhoy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx6h3ronlautdw96lhoy1.png" alt=" " width="800" height="191"&gt;&lt;/a&gt;&lt;br&gt;
You connect your project to Sevalla and select the branch you want to deploy. This creates a direct link between your code and the live app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4yto15lssr1ld54zinq5.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4yto15lssr1ld54zinq5.webp" alt=" " width="800" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also enalbed “Automatic deployments”. Once you create an app, deployment becomes automatic. You push code, and Sevalla takes care of building and publishing.&lt;/p&gt;

&lt;p&gt;No manual uploads. No SSH sessions. No server setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Configure the Runtime
&lt;/h3&gt;

&lt;p&gt;Next, you define how your app runs.&lt;/p&gt;

&lt;p&gt;Most modern frameworks are detected automatically. If you’ve built something common, you usually won’t need to tweak much.&lt;/p&gt;

&lt;p&gt;This is where you add environment variables. API keys, database URLs, authentication secrets, and anything that shouldn’t live inside your codebase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatvalqrucmzptlbdkhoi.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatvalqrucmzptlbdkhoi.webp" alt=" " width="800" height="192"&gt;&lt;/a&gt;&lt;br&gt;
A simple rule for vibe coders: If it changes between local and production, make it an environment variable.&lt;/p&gt;

&lt;p&gt;Once set, you rarely need to touch this again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Deploy
&lt;/h3&gt;

&lt;p&gt;Now you deploy.&lt;/p&gt;

&lt;p&gt;Sevalla builds the application, installs dependencies, and launches it. After a short wait, you get a live URL.&lt;/p&gt;

&lt;p&gt;This is the moment that matters. Your app is no longer a local experiment; it’s something real people can use.&lt;/p&gt;

&lt;p&gt;And importantly, you didn’t need to make infrastructure decisions to get there.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Iterate Like a Vibe Coder
&lt;/h3&gt;

&lt;p&gt;Now your workflow shines!&lt;/p&gt;

&lt;p&gt;You make a change locally. Commit. Push.&lt;/p&gt;

&lt;p&gt;Sevalla rebuilds and redeploys automatically.&lt;/p&gt;

&lt;p&gt;Your deployment process becomes invisible, just part of your normal coding rhythm.&lt;/p&gt;

&lt;p&gt;This matters more than most people realise. When deployment is effortless, you ship more often. When you ship more often, you learn faster.&lt;/p&gt;

&lt;p&gt;And fast learning is the real advantage of vibe coding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things Vibe Coders Usually Break (and How PaaS Helps)
&lt;/h2&gt;

&lt;p&gt;Even simple deployment workflows can go wrong. Some patterns show up repeatedly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Missing environment variables:&lt;/strong&gt; The app works locally but crashes in production. A PaaS surfaces configuration clearly, making it easier to spot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Localhost assumptions:&lt;/strong&gt; Hardcoded URLs or local file paths break once deployed. Using environment configuration fixes this early.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File storage confusion:&lt;/strong&gt; Local files disappear between deployments. Treat storage as external from day one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ignoring logs:&lt;/strong&gt; Many developers only look at logs after panic sets in. Sevalla’s centralised logs make debugging faster when something inevitably fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0rqhcrv2iirrjaoqyniq.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0rqhcrv2iirrjaoqyniq.webp" alt=" " width="800" height="368"&gt;&lt;/a&gt;&lt;br&gt;
The important point: these aren’t advanced problems. They’re beginner deployment mistakes, and the platform’s defaults help you avoid most of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Minimal Production Checklist
&lt;/h2&gt;

&lt;p&gt;Before you call something “live,” run through a quick checklist:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Environment variables are set correctly.&lt;/li&gt;
&lt;li&gt;Database is external, not local.&lt;/li&gt;
&lt;li&gt;Logs are enabled and readable.&lt;/li&gt;
&lt;li&gt;Custom domain is connected if needed.&lt;/li&gt;
&lt;li&gt;You know how to roll back to a previous version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s enough for most early-stage projects.&lt;/p&gt;

&lt;p&gt;You don’t need complex monitoring stacks or multi-region infrastructure to start learning from real users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Workflow Works for Vibe Builders
&lt;/h2&gt;

&lt;p&gt;Indie builders and vibe coders succeed by maintaining velocity. The highest hidden cost in software isn’t infrastructure, it’s context switching.&lt;/p&gt;

&lt;p&gt;Every time you stop building to become a part-time DevOps engineer, momentum drops.&lt;/p&gt;

&lt;p&gt;A PaaS system’s biggest advantage isn’t technical sophistication. It’s psychological. You stay in the builder mindset.&lt;/p&gt;

&lt;p&gt;You focus on product decisions instead of infrastructure decisions.&lt;/p&gt;

&lt;p&gt;And because deployment feels safe, you ship more frequently. Small releases reduce risk, reduce anxiety, and make experimentation normal.&lt;/p&gt;

&lt;p&gt;This is exactly the environment where small projects grow into real products.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The best deployment system is one you barely think about.&lt;/p&gt;

&lt;p&gt;For vibe coders, deployment shouldn’t be a scary milestone or a weekend project. It should feel like pressing save, just another step in the creative loop.&lt;/p&gt;

&lt;p&gt;Build something. Push it live. Learn from users. Repeat.&lt;/p&gt;

&lt;p&gt;That’s the real goal.&lt;/p&gt;

&lt;p&gt;And when deployment stops being a bottleneck, the vibe stays alive.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cloud</category>
      <category>tutorial</category>
      <category>vibecoding</category>
    </item>
    <item>
      <title>Top 5 Heroku Alternatives for Deployment in 2026</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Thu, 12 Feb 2026 04:46:32 +0000</pubDate>
      <link>https://dev.to/manishmshiva/top-5-heroku-alternatives-for-deployment-in-2026-6pe</link>
      <guid>https://dev.to/manishmshiva/top-5-heroku-alternatives-for-deployment-in-2026-6pe</guid>
      <description>&lt;p&gt;For more than a decade, &lt;a href="https://www.heroku.com/" rel="noopener noreferrer"&gt;Heroku&lt;/a&gt; defined what “developer-friendly deployment” meant. Push code, forget servers, and focus on shipping features.&lt;/p&gt;

&lt;p&gt;That promise shaped an entire generation of platform-as-a-service products. In 2026, that landscape is changing.&lt;/p&gt;

&lt;p&gt;Heroku has &lt;a href="https://www.heroku.com/blog/an-update-on-heroku/" rel="noopener noreferrer"&gt;clearly stated&lt;/a&gt; that it is moving into a sustaining engineering model. The platform remains stable, secure, and supported, but active innovation is no longer the focus.&lt;/p&gt;

&lt;p&gt;For many teams, this is acceptable. For others, especially startups and product teams planning three to five years ahead, it raises an important question: where should new applications live?&lt;/p&gt;

&lt;p&gt;In this article, we will look at five strong Heroku alternatives that are well-positioned for 2026. Each platform approaches deployment differently, but all aim to preserve what developers loved about Heroku while improving on cost, flexibility, or modern workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we will Cover
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Why Teams Are Looking Beyond Heroku&lt;/li&gt;
&lt;li&gt;Sevalla: The Closest Successor to Classic Heroku&lt;/li&gt;
&lt;li&gt;Render: A Broad Platform for Growing Teams&lt;/li&gt;
&lt;li&gt;Fly.io: Global-First Deployment for Latency-Sensitive Apps&lt;/li&gt;
&lt;li&gt;Upsun: Enterprise-Grade Control Without Losing Structure&lt;/li&gt;
&lt;li&gt;Vercel: The Frontend-Native Deployment Platform&lt;/li&gt;
&lt;li&gt;Choosing the Right Heroku Alternative in 2026&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Teams Are Looking Beyond Heroku
&lt;/h2&gt;

&lt;p&gt;Heroku’s shift toward maintenance over expansion signals maturity, not failure. However, modern teams expect faster iteration, deeper infrastructure control, and tighter integration with cloud-native tooling.&lt;/p&gt;

&lt;p&gt;AI workloads, edge computing, and global latency expectations are also reshaping deployment needs.&lt;/p&gt;

&lt;p&gt;As a result, teams want platforms that feel simple on day one but do not become limiting as scale and complexity grow.&lt;/p&gt;

&lt;p&gt;The alternatives discussed here are not identical replacements. Each represents a different philosophy about how applications should be built and operated in 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sevalla: The Closest Successor to Classic Heroku
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqhtmp08zljje1szr6npf.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqhtmp08zljje1szr6npf.jpeg" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sevalla.com/heroku-alternative/" rel="noopener noreferrer"&gt;Sevalla&lt;/a&gt; has quietly positioned itself as one of the most Heroku-like platforms available today. The core idea is familiar. You deploy applications without managing servers, environments are predictable, and the platform stays out of your way.&lt;/p&gt;

&lt;p&gt;What makes Sevalla compelling in 2026 is its balance between simplicity and control. It keeps the developer experience tight while avoiding the opaque pricing and rigid abstractions that frustrated many Heroku users over time. Deployments are fast, logs are easy to access, and scaling feels intuitive rather than magical.&lt;/p&gt;

&lt;p&gt;Sevalla is particularly attractive for mid-sized teams and also for enterprises that want a clean path from prototype to production. It supports modern application stacks without forcing you into complex infrastructure decisions too early. For teams migrating directly from Heroku, Sevalla often feels like the least disruptive transition.&lt;/p&gt;

&lt;p&gt;The platform’s biggest strength is restraint. It does not try to be everything at once. Instead, it focuses on being a reliable home for long-running services, APIs, and background workers. In 2026, that clarity is refreshing.&lt;/p&gt;

&lt;p&gt;Built for the enterprise, Sevalla meets the highest standards of security. They are fully compliant with SOC2, ISO 27017, and ISO 27001:2022, ensuring your data stays protected and your requirements are met.&lt;/p&gt;

&lt;h2&gt;
  
  
  Render: A Broad Platform for Growing Teams
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F047se9z3k3qc4vk6s81c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F047se9z3k3qc4vk6s81c.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://render.com/docs/render-vs-heroku-comparison" rel="noopener noreferrer"&gt;Render&lt;/a&gt; takes a more expansive approach. While it is often compared to Heroku, Render aims to cover a wider range of use cases, from simple web services to complex microservice architectures.&lt;/p&gt;

&lt;p&gt;Render stands out because it blends platform simplicity with infrastructure transparency. You still get managed databases, background jobs, and zero-downtime deploys, but you also gain more visibility into how resources are allocated. This makes it easier to reason about cost and performance as systems grow.&lt;/p&gt;

&lt;p&gt;For teams that expect to scale steadily, Render offers a comfortable middle ground. It removes much of the operational burden while allowing deeper configuration when needed. Many engineering teams appreciate that Render feels less restrictive than Heroku without pushing them into full DevOps territory.&lt;/p&gt;

&lt;p&gt;In 2026, Render is especially popular with SaaS companies that have outgrown entry-level platforms but are not ready to manage Kubernetes clusters themselves. It supports modern CI/CD workflows and integrates well with common developer tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fly.io: Global-First Deployment for Latency-Sensitive Apps
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftho8lgafujs1ake4498n.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftho8lgafujs1ake4498n.jpeg" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://getdeploying.com/flyio-vs-heroku" rel="noopener noreferrer"&gt;Fly.io&lt;/a&gt; represents a different philosophy entirely. Instead of abstracting infrastructure away, Fly.io embraces it, but makes it programmable and developer-friendly.&lt;/p&gt;

&lt;p&gt;Fly.io allows applications to run close to users by deploying workloads across multiple regions by default. This makes it ideal for applications where latency matters, such as real-time collaboration tools, gaming backends, or global APIs.&lt;/p&gt;

&lt;p&gt;Unlike Heroku, Fly.io expects developers to understand a bit more about how their application runs. You interact with virtual machines rather than dynos, and configuration is more explicit. However, this added complexity comes with real power.&lt;/p&gt;

&lt;p&gt;In 2026, Fly.io appeals strongly to experienced teams that want performance and control without adopting heavy orchestration systems. It is not always the easiest option, but it is one of the most flexible. For teams willing to invest in understanding the platform, Fly.io can outperform traditional PaaS solutions in both speed and cost efficiency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Upsun: Enterprise-Grade Control Without Losing Structure
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjsoz7tcfq5t7i5rowkvj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjsoz7tcfq5t7i5rowkvj.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://upsun.com/blog/a-heroku-alternative/" rel="noopener noreferrer"&gt;Upsun&lt;/a&gt;, previously known as Platform.sh, brings a more opinionated, enterprise-oriented model to application deployment. It is designed for teams that care deeply about environment parity, reproducibility, and long-term maintainability.&lt;/p&gt;

&lt;p&gt;Upsun treats infrastructure as part of the application. Environments are versioned alongside code, and deployments are deterministic. This approach reduces surprises and makes complex systems easier to reason about over time.&lt;/p&gt;

&lt;p&gt;For organizations with compliance requirements or multi-environment workflows, Upsun offers a level of rigor that Heroku never aimed to provide. At the same time, it abstracts away much of the operational burden that typically comes with such control.&lt;/p&gt;

&lt;p&gt;In 2026, Upsun is particularly well-suited for regulated industries, large content platforms, and teams with multiple long-lived environments. It is less about rapid experimentation and more about predictable, repeatable delivery at scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vercel: The Frontend-Native Deployment Platform
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmn3pyiweic3hd373078e.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmn3pyiweic3hd373078e.webp" alt=" " width="672" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt; is often discussed in a different category, but it deserves inclusion in any modern deployment conversation. Vercel is optimized for frontend applications, serverless functions, and edge workloads.&lt;/p&gt;

&lt;p&gt;If Heroku excelled at hosting monolithic web apps, Vercel excels at composable, frontend-driven architectures. It integrates deeply with modern frameworks and makes global deployment nearly effortless.&lt;/p&gt;

&lt;p&gt;In 2026, many applications are frontend-heavy, with APIs split into smaller services or serverless functions. For these use cases, Vercel offers a developer experience that feels faster and more modern than traditional PaaS platforms.&lt;/p&gt;

&lt;p&gt;However, Vercel is not a full replacement for Heroku in every scenario. Long-running background jobs and stateful services often live elsewhere. Still, for teams building modern web products, Vercel frequently becomes the centerpiece of their deployment strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing the Right Heroku Alternative in 2026
&lt;/h2&gt;

&lt;p&gt;There is no single “best” Heroku replacement. The right choice depends on how your application behaves, how your team works, and how much control you want over infrastructure.&lt;/p&gt;

&lt;p&gt;Sevalla is ideal for teams that want familiarity and minimal friction. Render suits growing teams that need flexibility without chaos. Fly.io is powerful for global, performance-sensitive systems. Upsun excels in structured, enterprise environments. Vercel dominates frontend-centric architectures.&lt;/p&gt;

&lt;p&gt;The common thread is that deployment in 2026 is no longer one-size-fits-all. Heroku set the standard, but the ecosystem has evolved. Today’s platforms offer sharper trade-offs, clearer philosophies, and better alignment with modern development patterns.&lt;/p&gt;

&lt;p&gt;For teams starting new projects, the opportunity is clear. You can choose a platform that matches your future, not just your present.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Heroku is not disappearing, and for many existing workloads, it will continue to run reliably for years. However, its shift toward a sustaining engineering model makes one thing clear: teams building new products in 2026 should think carefully about where they place their long-term bets.&lt;/p&gt;

&lt;p&gt;Deployment platforms are no longer just hosting choices. They shape how fast teams move, how systems scale, and how painful future migrations become.&lt;/p&gt;

&lt;p&gt;In 2026, the strongest deployment strategy is intentional, not inherited. Heroku showed the industry what was possible. Its successors are now defining what comes next.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article. Learn more about me by &lt;a href="https://manishshivanandhan.com/" rel="noopener noreferrer"&gt;visiting my website.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to Build Your First AI Agent Deploy it to Sevalla</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Wed, 07 Jan 2026 11:02:56 +0000</pubDate>
      <link>https://dev.to/manishmshiva/how-to-build-your-first-ai-agent-deploy-it-to-sevalla-2hm6</link>
      <guid>https://dev.to/manishmshiva/how-to-build-your-first-ai-agent-deploy-it-to-sevalla-2hm6</guid>
      <description>&lt;p&gt;Artificial intelligence is changing how we build software.&lt;/p&gt;

&lt;p&gt;Just a few years ago, writing code that could talk, decide, or use external data felt hard.&lt;/p&gt;

&lt;p&gt;Today, thanks to new tools, developers can build smart agents that read messages, reason about them, and call functions on their own.&lt;/p&gt;

&lt;p&gt;One such platform that makes this easy is &lt;a href="https://github.com/langchain-ai/langchain" rel="noopener noreferrer"&gt;LangChain&lt;/a&gt;. With LangChain, you can link language models, tools, and apps together. You can also wrap your agent inside a FastAPI server, then push it to a cloud platform for deployment.&lt;/p&gt;

&lt;p&gt;This article will walk you through building your first AI agent. You will learn what LangChain is, how to build an agent, how to serve it through FastAPI, and how to deploy it on Sevalla.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is LangChain&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;LangChain is a framework for working with large language models. It helps you build apps that think, reason, and act.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdr81cgnp5g6rfuqcp92d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdr81cgnp5g6rfuqcp92d.jpg" alt=" " width="800" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A model on its own only gives text replies, but LangChain lets it do more. It lets a model call functions, use tools, connect with databases, and follow workflows.&lt;/p&gt;

&lt;p&gt;Think of LangChain as a bridge. On one side is the language model. On the other side are your tools, data sources, and business logic. LangChain tells the model what tools exist, when to use them, and how to reply. This makes it ideal for building agents that answer questions, automate tasks, or handle complex flows.&lt;/p&gt;

&lt;p&gt;Many developers use LangChain because it is flexible. It supports many AI models. It fits well with Python.&lt;/p&gt;

&lt;p&gt;Langchain also makes it easier to move from prototype to production. Once you learn how to create an agent, you can reuse the pattern for more advanced use cases.&lt;/p&gt;

&lt;p&gt;I have recently published a detailed &lt;a href="https://www.turingtalks.ai/p/langchain-tutorial" rel="noopener noreferrer"&gt;langchain tutorial&lt;/a&gt; here.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Building Your First Agent with LangChain&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Let us make our first agent. It will respond to user questions and &lt;a href="https://www.freecodecamp.org/news/how-to-build-your-first-mcp-server-using-fastmcp/" rel="noopener noreferrer"&gt;call a tool&lt;/a&gt; when needed.&lt;/p&gt;

&lt;p&gt;We will give it a simple weather tool, then ask it about the weather in a city. Before this, create a file called .env and add your openai api key. Langchain will automatically use it when making requests to Openai.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OPENAI_API_KEY=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the code for our agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from langchain.agents import create_agent
from dotenv import load_dotenv

# load environment variables
load_dotenv()

# defining the tool that LLM can call
def get_weather(city: str) -&amp;gt; str:
 """Get weather for a given city."""
 return f"It's always sunny in {city}!"

# Creating an agent
agent = create_agent(model="gpt-4o",tools=[get_weather],   system_prompt="You are a helpful assistant")

result = agent.invoke({"messages":[{"role":"user","content":"What is the weather in san francisco?"}]})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This small program shows the power of LangChain agents.&lt;/p&gt;

&lt;p&gt;First, we importcreate_agent, which helps us build the agent. Then we write a function called get_weather. It takes a city name and returns a friendly sentence.&lt;/p&gt;

&lt;p&gt;The function acts as our tool. A tool is something the agent can use. In real projects, tools might fetch prices, store notes, or call APIs.&lt;/p&gt;

&lt;p&gt;Next, we call create_agent. We give it three things. We pass the model we want to use. We list the tools we want it to call. And we give a system prompt. The system prompt tells the agent who it is and how it should behave.&lt;/p&gt;

&lt;p&gt;Finally, we run the agent. We call invoke with a message.&lt;/p&gt;

&lt;p&gt;The user asks for the weather in San Francisco. The agent reads this message. It sees that the question needs the weather function. So it calls our tool get_weather, passes the city, and returns an answer.&lt;/p&gt;

&lt;p&gt;Even though this example is tiny, it captures the main idea. The agent reads natural language, figures out what tool to use, and sends a reply.&lt;/p&gt;

&lt;p&gt;Later, you can add more tools or replace the weather function with one that connects to a real API. But this is enough for us to wrap and deploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Wrapping Your Agent with FastAPI&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The next step is to serve our agent. &lt;a href="https://fastapi.tiangolo.com/" rel="noopener noreferrer"&gt;FastAPI&lt;/a&gt; helps us expose our agent through an HTTP endpoint. That way, users and systems can call it through a URL, send messages, and get replies.&lt;/p&gt;

&lt;p&gt;To begin, you install FastAPI and write a simple file like main.py. Inside it, you import FastAPI, load the agent, and write a route.&lt;/p&gt;

&lt;p&gt;When someone posts a question, the api forwards it to the agent and returns the answer. The flow is simple.&lt;/p&gt;

&lt;p&gt;The user talks to FastAPI. FastAPI talks to your agent. The agent thinks and replies.&lt;/p&gt;

&lt;p&gt;Here is the FAST api wrapper for your agent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from fastapi import FastAPI
from pydantic import BaseModel
import uvicorn
from langchain.agents import create_agent
from dotenv import load_dotenv
import os

load_dotenv()

# defining the tool that LLM can call
def get_weather(city: str) -&amp;gt; str:
    """Get weather for a given city."""
    return f"It's always sunny in {city}!"

# Creating an agent
agent = create_agent(
    model="gpt-4o",
    tools=[get_weather],
    system_prompt="You are a helpful assistant",
)

app = FastAPI()

class ChatRequest(BaseModel):
    message: str

@app.get("/")
def root():
    return {"message": "Welcome to your first agent"}

@app.post("/chat")
def chat(request: ChatRequest):
    result = agent.invoke({"messages":[{"role":"user","content":request.message}]})
    return {"reply": result["messages"][-1].content}

def main():
    port = int(os.getenv("PORT", 8000))
    uvicorn.run(app, host="0.0.0.0", port=port)

if __name__ == "__main__":
    main()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, FastAPI defines a /chat endpoint. When someone sends a message, the server calls our agent. The agent processes it as before. Then FastAPI returns a clean JSON reply. The API layer hides the complexity inside a simple interface.&lt;/p&gt;

&lt;p&gt;At this point, you have a working agent server. You can run it on your machine, call it with Postman or cURL, and check responses. When this works, you are ready to deploy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66zujrvw6iu0u95qdrif.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66zujrvw6iu0u95qdrif.png" alt=" " width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Deployment to Sevalla&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;You can choose any cloud provider, like AWS, DigitalOcean, or others to host your agent. I will be using Sevalla for this example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sevalla.com/" rel="noopener noreferrer"&gt;Sevalla&lt;/a&gt; is a developer-friendly PaaS provider. It offers application hosting, database, object storage, and static site hosting for your projects.&lt;/p&gt;

&lt;p&gt;Every platform will charge you for creating a cloud resource. Sevalla comes with a $50 credit for us to use, so we won’t incur any costs for this example.&lt;/p&gt;

&lt;p&gt;Let’s push this project to GitHub so that we can connect our repository to Sevalla. We can also enable auto-deployments so that any new change to the repository is automatically deployed.&lt;/p&gt;

&lt;p&gt;You can also &lt;a href="https://github.com/manishmshiva/first-agent-with-fastapi" rel="noopener noreferrer"&gt;fork my repository&lt;/a&gt; from here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.sevalla.com/login" rel="noopener noreferrer"&gt;Log in&lt;/a&gt; to Sevalla and click on Applications -&amp;gt; Create new application. You can see the option to link your GitHub repository to create a new application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsdqgulzvwzccp36c201g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsdqgulzvwzccp36c201g.png" alt=" " width="800" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use the default settings. Click “Create application”. Now we have to add our openai api key to the environment variables. Click on the “Environment variables” section once the application is created, and save the OPENAI_API_KEY value as an environment variable.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbrgv82cchr7a9omut81f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbrgv82cchr7a9omut81f.png" alt=" " width="800" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we are ready to deploy our application. Click on “Deployments” and click “Deploy now”. It will take 2–3 minutes for the deployment to complete.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fauvz7b31q155bdrfflp9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fauvz7b31q155bdrfflp9.png" alt=" " width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once done, click on “Visit app”. You will see the application served via a url ending with sevalla.app . This is your new root url. You can replace localhost:8000 with this url and test in Postman.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3yrtzrtaziglb6qzv498.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3yrtzrtaziglb6qzv498.png" alt=" " width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congrats! Your first AI agent with tool calling is now live. You can extend this by adding more tools and other capabilities, and push your code to GitHub, and Sevalla will automatically deploy your application to production.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Building AI agents is no longer a task for experts. With LangChain, you can write a few lines and create reasoning tools that respond to users and call functions on their own.&lt;/p&gt;

&lt;p&gt;By wrapping the agent with FastAPI, you give it a doorway that apps and users can access. Finally, Sevalla makes it easy to push your agent live, monitor it, and run it in production.&lt;/p&gt;

&lt;p&gt;This journey from agent idea to deployed service shows what modern AI development looks like. You start small. You explore tools. You wrap them and deploy them.&lt;/p&gt;

&lt;p&gt;Then you iterate, add more capability, improve logic, and plug in real tools. Before long, you have a smart, living agent online. That is the power of this new wave of technology.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Build AI Workflows Without Code Using Activepieces and Sevalla</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Thu, 04 Dec 2025 11:31:44 +0000</pubDate>
      <link>https://dev.to/manishmshiva/how-to-build-ai-workflows-without-code-using-activepieces-and-sevalla-4jaa</link>
      <guid>https://dev.to/manishmshiva/how-to-build-ai-workflows-without-code-using-activepieces-and-sevalla-4jaa</guid>
      <description>&lt;p&gt;&lt;strong&gt;Let’s learn how to use Activepieces to build smart AI workflows with a simple visual builder. No coding or complex setup needed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Artificial intelligence is now part of daily work for many teams. People use it to write content, analyse data, answer support requests, and guide business decisions.&lt;/p&gt;

&lt;p&gt;But building AI workflows is still hard for many users. Most tools need code, a complex setup, or long training.&lt;/p&gt;

&lt;p&gt;Activepieces makes this much easier. It's an open source tool that lets anyone create smart workflows with a simple visual builder.&lt;/p&gt;

&lt;p&gt;You can mix AI models, data sources, and systems without writing code. This makes automation more open to teams that want to work faster and cut manual effort.&lt;/p&gt;

&lt;p&gt;In this guide, we will learn what ActivePieces is, how to work with it and how to deploy our own version to the cloud using Sevalla.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is ActivePieces?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/activepieces/activepieces" rel="noopener noreferrer"&gt;Activepieces&lt;/a&gt; is an open-source automation platform that focuses on ease of use.&lt;/p&gt;

&lt;p&gt;You can host it on your own server or use it in the cloud. The platform uses a clean flow builder where each block represents a step. These blocks are called pieces.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff666l5nno5hpnv9tyxb6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff666l5nno5hpnv9tyxb6.png" alt=" " width="800" height="412"&gt;&lt;/a&gt;&lt;br&gt;
A piece may call an API, connect to a tool like Google Sheets, run an AI model, or wait for human input. By linking pieces together, you can build workflows that act like agents.&lt;/p&gt;

&lt;p&gt;They can listen to events, run analysis, create content, evaluate data, or push results into other tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Activepieces ecosystem
&lt;/h2&gt;

&lt;p&gt;The main goal of Activepieces is to let both technical and non-technical users build workflows that include AI. It gives a simple visual interface but also has a strong developer layer under the hood.&lt;/p&gt;

&lt;p&gt;Developers can build new pieces in TypeScript. These custom pieces then appear in the visual builder for anyone to use. This keeps advanced logic invisible behind a friendly interface.&lt;/p&gt;

&lt;p&gt;The platform has a growing library of over two hundred pieces. Many come from the community.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxdusirab077nc3nqvvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxdusirab077nc3nqvvw.png" alt=" " width="800" height="368"&gt;&lt;/a&gt;&lt;br&gt;
They include common tools like email, Slack, Google Workspace, OpenAI, and Notion. There are also pieces for reading links, parsing text, calling webhooks, or waiting for timed events.&lt;/p&gt;

&lt;p&gt;The library grows fast because anyone can contribute new pieces. Each piece is an npm package, so it fits well into the wider JavaScript ecosystem.&lt;/p&gt;

&lt;p&gt;Activepieces also supports human input. For example, a workflow can pause and wait for someone to review a message before sending it. It can also collect answers from a form.&lt;/p&gt;

&lt;p&gt;These options make it possible to build flows that mix automation with human judgment. This is useful in tasks where risk or correctness matters, such as compliance checks or approval flows.&lt;/p&gt;

&lt;p&gt;A major part of the platform is its AI-first design. It includes native support for popular AI providers. You can build agents that analyse text, rewrite messages, classify content, extract fields, or make decisions.&lt;/p&gt;

&lt;p&gt;You can even ask the AI to clean data inside a flow, without needing code. This makes it easy to use AI to speed up work and remove repetitive steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a workflow in Activepieces
&lt;/h2&gt;

&lt;p&gt;Every workflow begins with a trigger. A trigger is an action that starts the flow.&lt;/p&gt;

&lt;p&gt;It may be a new message, a new file, a web request, or a timed schedule. After the trigger fires, the flow runs step by step. Each step is a piece you choose from the library.&lt;/p&gt;

&lt;p&gt;The builder shows the flow in a simple vertical layout. You can add branches, loops, retries, and data mapping.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuq0eksnk8z5qc8juir4b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuq0eksnk8z5qc8juir4b.png" alt=" " width="800" height="352"&gt;&lt;/a&gt;&lt;br&gt;
Data mapping is the process of telling the flow how to pass information from one step to another. It uses a simple interface where you pick fields from earlier steps and connect them to new ones.&lt;/p&gt;

&lt;p&gt;When AI pieces are added, the workflow becomes more powerful. For example, you can pass text from a form to an AI model and get a summary.&lt;/p&gt;

&lt;p&gt;You can pass a document link and extract the main points. You can ask the AI to answer a question or decide if a message fits a category. These results then move to the next step, where they can be stored or sent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying ActivePieces on the Cloud using Sevalla
&lt;/h2&gt;

&lt;p&gt;To use Activepieces, you can either install it on your computer (not recommended due to the complex setup), &lt;a href="https://www.activepieces.com/" rel="noopener noreferrer"&gt;buy a cloud subscription&lt;/a&gt; or self-host it.&lt;/p&gt;

&lt;p&gt;If you prefer to install it on your computer, &lt;a href="https://www.activepieces.com/docs/install/options/docker" rel="noopener noreferrer"&gt;here are the instructions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Self-hosting gives you full control and is usually preferred by technical teams who want to keep sensitive data in-house.&lt;/p&gt;

&lt;p&gt;You can choose any cloud provider, like AWS, DigitalOcean, or others to set up ActivePieces. But I will be using Sevalla.&lt;/p&gt;

&lt;p&gt;Sevalla is a PaaS provider designed for developers and dev teams shipping features and updates constantly in the most efficient way. It offers application hosting, database, object storage, and static site hosting for your projects.&lt;/p&gt;

&lt;p&gt;I am using Sevalla for two reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every platform will charge you for creating a cloud resource. Sevalla comes with a $50 credit for us to use, so we won’t incur any costs for this example.&lt;/li&gt;
&lt;li&gt;Sevalla has a &lt;a href="https://docs.sevalla.com/templates/overview" rel="noopener noreferrer"&gt;template for ActivePieces&lt;/a&gt;, so it simplifies the manual installation and setup for each resource you will need for installation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://app.sevalla.com/login" rel="noopener noreferrer"&gt;Log in&lt;/a&gt; to Sevalla and click on Templates. You can see ActivePieces as one of the templates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcai48f9pjrccdwgjcv4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcai48f9pjrccdwgjcv4f.png" alt=" " width="800" height="278"&gt;&lt;/a&gt;&lt;br&gt;
Click on the “ActivePieces” template. You will see the resources needed to provision the application. Click on “Deploy Template”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feiamh4ji6ggjomn5b2bu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feiamh4ji6ggjomn5b2bu.png" alt=" " width="800" height="368"&gt;&lt;/a&gt;&lt;br&gt;
You can see the resource being provisioned. Once the deployment is complete, go to the ActivePieces application and click on “Visit app”. Enter your name, email and password, and you will be taken to the dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fre788uxi69wsrlqbrinp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fre788uxi69wsrlqbrinp.png" alt=" " width="800" height="392"&gt;&lt;/a&gt;&lt;br&gt;
Click on “New Flow”. You can either create a flow from scratch, or choose one of the many templates ActivePieces offers.&lt;/p&gt;

&lt;p&gt;Let's pick the “LinkedIn content idea generator” template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmcg16ppbytxc7xjf9xz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmcg16ppbytxc7xjf9xz0.png" alt=" " width="800" height="552"&gt;&lt;/a&gt;&lt;br&gt;
Click on “Use template”. You will see the workflow generated for you. You can also add/remove components based on your requirements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxs4yasv8f1kser0c2qi6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxs4yasv8f1kser0c2qi6.png" alt=" " width="800" height="432"&gt;&lt;/a&gt;&lt;br&gt;
You will see the option to update each block of the workflow. You can create connections to your email, Google Sheets, etc., to integrate them into the blocks.&lt;/p&gt;

&lt;p&gt;In the rank news block, it will ask you to choose a model and add your api key. For example, you can find your &lt;a href="https://platform.openai.com/settings/organization/api-keys" rel="noopener noreferrer"&gt;OpenAI api key here&lt;/a&gt;. You will also see a pre-built prompt template ready for you to use with your workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqj2e7x1x324h769uczd9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqj2e7x1x324h769uczd9.png" alt=" " width="754" height="746"&gt;&lt;/a&gt;&lt;br&gt;
Great! You now have a production-grade ActivePieces server running on the cloud. You can use this to set up all your workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-world examples
&lt;/h2&gt;

&lt;p&gt;A sales team can automate lead enrichment by passing new leads through an AI model. The AI extracts company size, industry, and intent. The results go to a CRM. The team saves hours of manual research.&lt;/p&gt;

&lt;p&gt;A content team can create a writing assistant. It gathers ideas from a form, generates outlines using an AI model, and stores drafts in Google Docs. Editors then refine the text.&lt;/p&gt;

&lt;p&gt;A compliance team can process long documents. They upload a file, an AI model extracts key rules, and the workflow sends a summary to reviewers. This makes it easier to track changes in regulations.&lt;/p&gt;

&lt;p&gt;An operations team can watch for new tickets in a helpdesk system. AI summarises the ticket. The workflow checks severity and sends it to the right team. This speeds up response times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The idea behind Activepieces is simple. Automate work that slows you down. Mix AI with your tools. Build flows visually. Let both technical and non-technical users create automation. This helps teams move faster, reduce errors, and stay focused on meaningful work.&lt;/p&gt;

&lt;p&gt;The rise of AI means teams will use more specialised models. They will also need smooth ways to link these models with their daily tools.&lt;/p&gt;

&lt;p&gt;No-code platforms like Activepieces give teams control and speed without asking them to learn programming. The platform keeps improving with new pieces and stronger AI features. As the community grows, the number of available integrations will rise.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article. Find me on &lt;a href="https://linkedin.com/in/manishmshiva" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt; or &lt;a href="https://manishshivanandhan.com/" rel="noopener noreferrer"&gt;visit my website&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>architecture</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Build an AI-Driven Search Experience with Meilisearch and Sevalla</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Mon, 01 Dec 2025 15:21:32 +0000</pubDate>
      <link>https://dev.to/manishmshiva/how-to-build-an-ai-driven-search-experience-with-meilisearch-and-sevalla-2hmo</link>
      <guid>https://dev.to/manishmshiva/how-to-build-an-ai-driven-search-experience-with-meilisearch-and-sevalla-2hmo</guid>
      <description>&lt;p&gt;&lt;strong&gt;Learn how AI-powered search with Meilisearch delivers fast, intuitive, and highly relevant results.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Search is one of the most important features in modern applications.&lt;/p&gt;

&lt;p&gt;Users expect instant answers, useful suggestions, and results that match their intent even when they make spelling mistakes.&lt;/p&gt;

&lt;p&gt;Most traditional search systems struggle to deliver this experience without complex and heavy infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/meilisearch/meilisearch" rel="noopener noreferrer"&gt;Meilisearch&lt;/a&gt; is an open-source search engine that changes this by offering a fast and developer-friendly engine that is easy to set up and extend.&lt;/p&gt;

&lt;p&gt;When you combine Meilisearch with AI models for natural language understanding and &lt;a href="https://github.com/meilisearch/meilisearch" rel="noopener noreferrer"&gt;semantic relevance&lt;/a&gt;, you can build a powerful and intuitive search experience that feels modern and intelligent.&lt;/p&gt;

&lt;p&gt;This article explains how Meilisearch works, how to set it up, and how to integrate AI models to deliver better relevance and better ranking. You will also see how hybrid search and semantic embeddings work, and how to deploy Melisearch to the cloud using Sevalla.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Meilisearch
&lt;/h2&gt;

&lt;p&gt;Meilisearch is a lightning-fast search engine that fits easily into any application.&lt;/p&gt;

&lt;p&gt;It is built in Rust and designed to deliver results in less than fifty milliseconds. It supports semantic search, hybrid search, typo tolerance, sorting, geosearch, and extensive language support.&lt;/p&gt;

&lt;p&gt;Melisearch also provides a clean RESTful API and a wide range of SDKs that make integration easy with JavaScript, Python, Go, PHP, Ruby, Rust and many other languages.&lt;/p&gt;

&lt;p&gt;You can try Meilisearch by exploring the &lt;a href="https://saas.meilisearch.com/deals" rel="noopener noreferrer"&gt;official demos&lt;/a&gt;. These demos show how Meilisearch is not limited to one specific use case but can fit many types of workflows.&lt;/p&gt;

&lt;p&gt;Meilisearch supports two editions. The Community Edition is fully open source under the MIT license and can be used freely even for commercial products.&lt;/p&gt;

&lt;p&gt;The Enterprise Edition introduces features like &lt;a href="https://aws.amazon.com/what-is/database-sharding/" rel="noopener noreferrer"&gt;sharding&lt;/a&gt; and is governed by a commercial license. You can deploy Meilisearch yourself or choose Meilisearch Cloud, which handles hosting, updates, monitoring and analytics without requiring server maintenance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Meilisearch
&lt;/h2&gt;

&lt;p&gt;Starting Meilisearch is simple. You can download the binary and run it directly or you can start it through Docker. Running through Docker is the fastest way to test it on your machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the server is running, you can communicate with it using HTTP. The simplest use case is indexing documents into an index and querying them. Here is an example using Python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

docs = [
    {"id": 1, "title": "AI in Finance", "text": "How AI is changing banks"},
    {"id": 2, "title": "AI in Law", "text": "How AI helps legal teams"},
]
requests.put(
    "http://localhost:7700/indexes/articles/documents",
    json=docs
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Searching is just as easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

query = "ai banks"
res = requests.post(
    "http://localhost:7700/indexes/articles/search",
    json={"q": query}
)
print(res.json())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The engine returns results in milliseconds. Typo tolerance, word proximity and relevance ranking work out of the box.&lt;/p&gt;

&lt;p&gt;Meilisearch automatically handles synonyms if you configure them and allows custom sorting rules for attributes like price or date. It also supports faceting, filters and geosearch, which makes it suitable for e-commerce, travel apps, real estate listings and data-heavy dashboards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Hybrid Search and AI Together
&lt;/h2&gt;

&lt;p&gt;Hybrid search combines full-text search with semantic vector search.&lt;/p&gt;

&lt;p&gt;Meilisearch supports semantic search through vector fields and enables the combination of both approaches. This helps you serve users who type vague queries or natural language questions.&lt;/p&gt;

&lt;p&gt;The AI model provides &lt;a href="https://www.ibm.com/think/topics/embedding" rel="noopener noreferrer"&gt;embeddings&lt;/a&gt; that capture meaning, while Meilisearch handles the fast retrieval and ranking.&lt;/p&gt;

&lt;p&gt;To add semantic search, you first generate embeddings for your documents using an AI model. Here is a simple example using OpenAI embeddings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from openai import OpenAI
import requests

client = OpenAI()
def embed(text):
    out = client.embeddings.create(
        model="text-embedding-3-small",
        input=text
    )
    return out.data[0].embedding
doc = {
    "id": 3,
    "title": "AI in Insurance",
    "text": "How AI powers underwriting",
    "vector": embed("How AI powers underwriting")
}
requests.put(
    "http://localhost:7700/indexes/articles/documents",
    json=[doc]
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the user searches, you embed the query and compute similarity. You can mix this with keyword search results returned from Meilisearch. The combined ranking creates a better experience than either approach alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using AI To Rewrite Queries
&lt;/h2&gt;

&lt;p&gt;Users often type incomplete or unstructured queries. They might type “How does AI help banks?” instead of keywords.&lt;/p&gt;

&lt;p&gt;You can use an AI model to rewrite this into something more search-friendly. The rewritten query produces better results in Meilisearch while still respecting the user’s original intent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from openai import OpenAI
import requests

client = OpenAI()
def rewrite_query(user_query):
    prompt = f"Rewrite this for search: {user_query}"
    out = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": prompt}]
    )
    return out.choices[0].message.content
user_query = "how does ai help banks"
rewritten = rewrite_query(user_query)
res = requests.post(
    "http://localhost:7700/indexes/articles/search",
    json={"q": rewritten}
)
print(res.json())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern improves accuracy for question-based searches across blogs, documentation platforms and knowledge bases. You can also use the model to normalise queries, remove ambiguous text, expand synonyms and fix spelling mistakes before they reach Meilisearch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying Meilisearch to the Cloud using Sevalla
&lt;/h2&gt;

&lt;p&gt;You can deploy Meilisearch anywhere. It runs on a small server, a local machine or inside containers.&lt;/p&gt;

&lt;p&gt;Self-hosting gives you full control and is usually preferred by technical teams who want to keep sensitive data in-house. You can choose any cloud provider, like AWS, DigitalOcean, or others to set up Melisearch. But I will be using Sevalla.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sevalla.com/" rel="noopener noreferrer"&gt;Sevalla&lt;/a&gt; is a PaaS provider designed for developers and dev teams shipping features and updates constantly in the most efficient way. It offers application hosting, database, object storage, and static site hosting for your projects.&lt;/p&gt;

&lt;p&gt;I am using Sevalla for two reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every platform will charge you for creating a cloud resource. Sevalla comes with a $50 credit for us to use, so we won’t incur any costs for this example.&lt;/li&gt;
&lt;li&gt;Sevalla has a &lt;a href="https://docs.sevalla.com/templates/overview" rel="noopener noreferrer"&gt;template for Melisearch&lt;/a&gt;, so it simplifies the manual installation and setup for each resource you will need for installation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://app.sevalla.com/login" rel="noopener noreferrer"&gt;Log in&lt;/a&gt; to Sevalla and click on Templates. You can see Melisearch as one of the templates. Click Deploy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftveyk5qww0e7kavm72h9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftveyk5qww0e7kavm72h9.png" alt=" " width="800" height="280"&gt;&lt;/a&gt;&lt;br&gt;
You will see the resources being provisioned for the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Far61eb9uvwujpj2hvdav.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Far61eb9uvwujpj2hvdav.png" alt=" " width="800" height="362"&gt;&lt;/a&gt;&lt;br&gt;
Once the deployment is complete, click on “Visit app”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jpxaqy7l4fgjcx1qox7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jpxaqy7l4fgjcx1qox7.png" alt=" " width="800" height="357"&gt;&lt;/a&gt;&lt;br&gt;
You now have a production-grade Melisearch server running on the cloud. You can use this to set up indexes for your database and use the JavaScript or other SDKs to interact with Melisearch.&lt;/p&gt;

&lt;p&gt;Here is the &lt;a href="https://www.meilisearch.com/docs/reference/api/overview" rel="noopener noreferrer"&gt;full list of apis&lt;/a&gt; provided by Melisearch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Meilisearch gives you a fast and elegant base for search. AI models add understanding and personalisation. When these two work together, you get a search experience that feels instant, adaptive and intelligent.&lt;/p&gt;

&lt;p&gt;You can start small with keyword search and then add query rewriting, embeddings, hybrid search and reranking. You can also use suggestions, synonyms and filters to improve the user journey.&lt;/p&gt;

&lt;p&gt;With its simple API, wide language support and strong ecosystem, Meilisearch makes it easy to build a search that feels right at home in any modern app.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article. Find me on &lt;a href="https://linkedin.com/in/manishmshiva" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; or &lt;a href="https://manishshivanandhan.com/" rel="noopener noreferrer"&gt;visit my website&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>programming</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Agents 101 — Build and Deploy AI Agents to Production using LangChain</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Wed, 26 Nov 2025 04:41:21 +0000</pubDate>
      <link>https://dev.to/manishmshiva/agents-101-build-and-deploy-ai-agents-to-production-using-langchain-535k</link>
      <guid>https://dev.to/manishmshiva/agents-101-build-and-deploy-ai-agents-to-production-using-langchain-535k</guid>
      <description>&lt;p&gt;&lt;strong&gt;Learn how Langchain turns a simple prompt into a fully functional AI agent that can think, act and remember.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI agents are no longer futuristic ideas locked inside research labs.&lt;/p&gt;

&lt;p&gt;Today, you can build one that reasons about questions, calls real tools, remembers past messages, and responds with a consistent structure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/langchain-ai/langchain" rel="noopener noreferrer"&gt;LangChain&lt;/a&gt; makes this possible. It offers a framework that blends language models, Python functions, prompts, and memory into a single workflow.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will guide you through the process of creating a fully functional agent from scratch.&lt;/p&gt;

&lt;p&gt;We will shape it into something that feels less like a script and more like a teammate that can think, act, and adapt in real time.&lt;/p&gt;

&lt;p&gt;You can use this &lt;a href="https://colab.research.google.com/drive/1IwewecrEIgNPwAykPJvjAvQVnwxwd94J?usp=sharing" rel="noopener noreferrer"&gt;Google Colab notebook&lt;/a&gt; to follow along with the examples in this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea behind an agent
&lt;/h2&gt;

&lt;p&gt;Think of an agent as a teammate with a brain and hands.&lt;/p&gt;

&lt;p&gt;Press enter or click to view image in full size&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1tob95mipr1m33bjmcd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1tob95mipr1m33bjmcd.png" alt=" " width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The brain is the language model. The hands are the tools you give it. The rules you write in the system prompt decide how the teammate behaves.&lt;/p&gt;

&lt;p&gt;When everything works together, you get a system that can plan, act, remember, and answer predictably.&lt;/p&gt;

&lt;p&gt;The magic is that the agent decides when to use tools. You do not hardcode the logic. You let the model reason step by step and choose the right action.&lt;/p&gt;

&lt;h2&gt;
  
  
  A tiny but clever agent
&lt;/h2&gt;

&lt;p&gt;Here is the smallest agent you can build.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# import the agent creation function
from langchain.agents import create_agent

# Define a tool for the agent to call
def get_weather(city: str) -&amp;gt; str:
    """Get weather for a given city."""
    return f"It's always sunny in {city}!"
# Create an agent with an LLM model along with the tools and a system prompt
agent = create_agent(
    model="gpt-5-mini",
    tools=[get_weather],
    system_prompt="You are a helpful assistant",
)
# Run the agent
agent.invoke(
    {"messages": [{"role": "user", "content": "what is the weather in sf"}]}
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This looks harmless, but something interesting is happening.&lt;/p&gt;

&lt;p&gt;The moment you wrap &lt;code&gt;get_weather&lt;/code&gt; inside tools, the model understands that it can call a function instead of guessing the weather.&lt;/p&gt;

&lt;p&gt;LangChain transforms that plain Python function into a callable tool, describes it to the model, and allows the model to decide when to use it.&lt;/p&gt;

&lt;p&gt;When you run &lt;code&gt;agent.invoke&lt;/code&gt;, the agent sees the question, reasons that the weather is being asked, and then chooses to call &lt;code&gt;get_weatherwith&lt;/code&gt; the argument &lt;code&gt;sf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You didn’t write any routing logic. You just gave the model a choice.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is the essence of agents: you describe, and the model decides.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But real systems need consistency, structure, context, and memory.&lt;/p&gt;

&lt;p&gt;You want the agent to follow rules, not improvise. You want it to reply in stable formats, not unpredictable paragraphs. You want it to remember the user.&lt;/p&gt;

&lt;p&gt;The next example brings all these pieces together to form a production-ready workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a Real-World AI Agent
&lt;/h2&gt;

&lt;p&gt;Let’s start by defining a system prompt. This tells the LLM how it should behave.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SYSTEM_PROMPT = """You are an expert weather forecaster, who speaks in puns. You have access to two tools:
- get_weather_for_location: use this to get the weather for a specific location
- get_user_location: use this to get the user's location
If a user asks you for the weather, make sure you know the location. If you can tell from the question that they mean wherever they are, use the get_user_location tool to find their location."""
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the system prompt acts like a job description. It defines how the agent should think, what it should care about, and when it should use each tool.&lt;/p&gt;

&lt;p&gt;The more specific you are, the more stable the behaviour becomes.&lt;/p&gt;

&lt;p&gt;Notice how the rules are written in plain English. Models respond very well to simple, direct instructions. This is how you stop them from drifting into creative chaos.&lt;/p&gt;

&lt;p&gt;Now let’s build the tools our model can call.&lt;/p&gt;

&lt;p&gt;Tools are just Python functions, but LangChain wraps them so the model can call them at the right moment.&lt;/p&gt;

&lt;p&gt;In this part, we will create two tools:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A tool that returns the weather for any city.&lt;/li&gt;
&lt;li&gt;A tool that figures out the user’s location based on context passed into the agent.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before we write the code, here is the idea: The agent should not guess anything. If it needs information, it must call the correct tool. This makes the system predictable and safe.&lt;/p&gt;

&lt;p&gt;Let’s write the two tools our agent will need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from dataclasses import dataclass
from langchain.tools import tool, ToolRuntime

# ---------------------------------------
# Tool 1: Returns weather for a given city
# ---------------------------------------
@tool
def get_weather_for_location(city: str) -&amp;gt; str:
    """
    A simple tool that returns weather information.
    In a real system, this could call a weather API.
    """
    return f"It's always sunny in {city}!"
# ---------------------------------------
# Context object for injecting user info
# LangChain will attach this to runtime
# so tools can access user-specific data.
# ---------------------------------------
@dataclass
class Context:
    user_id: str
# ---------------------------------------
# Tool 2: Returns user location using context
# ---------------------------------------
@tool
def get_user_location(runtime: ToolRuntime[Context]) -&amp;gt; str:
    """
    A context-aware tool.
    It reads the user_id from runtime.context and returns
    the user's location. You can replace this with a real
    database or user profile lookup.
    """
    user_id = runtime.context.user_id
    # Simple rule: user_id "1" lives in Florida, others in SF.
    return "Florida" if user_id == "1" else "SF"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first tool is straightforward: the agent calls it when it already knows the city.&lt;/p&gt;

&lt;p&gt;The second tool is the interesting part. Instead of taking direct arguments, it receives a runtime object.&lt;/p&gt;

&lt;p&gt;LangChain injects runtime data so tools have access to user context without passing it manually. That context might include user ID, permissions, preferences, or anything else relevant to the task.&lt;/p&gt;

&lt;p&gt;This means your agent does more than answer questions. It adapts its behaviour based on who is using it. You get personalised responses without adding complicated logic inside the agent itself.&lt;/p&gt;

&lt;p&gt;ToolRuntime may look complex, but it only serves a simple purpose. It allows tools to automatically access context passed into the agent. These include user ID or preferences, without you manually forwarding those values every time.&lt;/p&gt;

&lt;p&gt;This keeps the tool logic clean while still enabling personalised behaviour.&lt;/p&gt;

&lt;p&gt;With just a small dataclass and a tool decorator, LangChain gives you a clean way to build context-aware tools that make your agent feel smarter, more responsive, and more human.&lt;/p&gt;

&lt;h2&gt;
  
  
  Teaching the Brain How to Behave
&lt;/h2&gt;

&lt;p&gt;The language model is the agent’s brain. It decides how to interpret questions, when to call tools, and how to phrase responses.&lt;/p&gt;

&lt;p&gt;To keep it stable and predictable, we configure it before building the agent.&lt;/p&gt;

&lt;p&gt;Before showing the code, here is what we are doing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Choosing which model the agent will use.&lt;/li&gt;
&lt;li&gt;Setting how creative it should be.&lt;/li&gt;
&lt;li&gt;Controlling how long it can think.&lt;/li&gt;
&lt;li&gt;Limiting how much text it is allowed to generate.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These settings decide how the agent behaves in every conversation.&lt;/p&gt;

&lt;p&gt;Let’s initialise the model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from langchain.chat_models import init_chat_model

# ---------------------------------------
# Configure the language model
# ---------------------------------------
model = init_chat_model(
    # The model to use for reasoning and tool-calling
    "gpt-5-mini",
    # How creative the model can be.
    # Lower values = more factual, consistent answers.
    temperature=0.5,
    # Maximum time (in seconds) the model can take to respond.
    timeout=10,
    # Upper limit on response length.
    # Helps control cost and prevents overly long messages.
    max_tokens=1000
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Language models behave differently depending on their configuration:&lt;/p&gt;

&lt;p&gt;Temperature controls creativity. A low temperature makes the agent consistent and predictable. A higher one makes it more playful, but also more risky.&lt;/p&gt;

&lt;p&gt;Timeout controls patience. If a model gets stuck, this prevents requests from hanging forever.&lt;/p&gt;

&lt;p&gt;Max tokens control cost and structure. Restricting output size forces the agent to stay concise and prevents runaway responses.&lt;/p&gt;

&lt;p&gt;When you wrap a model with &lt;code&gt;init_chat_model&lt;/code&gt;, you freeze these settings.&lt;br&gt;
This ensures your agent behaves the same way every time.&lt;/p&gt;

&lt;p&gt;In production, this kind of consistency matters. It keeps your system stable and prevents unpredictable behaviour that could break downstream logic.&lt;/p&gt;
&lt;h2&gt;
  
  
  Shaping the Output So You Can Trust It
&lt;/h2&gt;

&lt;p&gt;Up to this point, the agent can think and act. But its answers still come as free-form text, which is risky in real systems.&lt;/p&gt;

&lt;p&gt;Production applications need consistent fields, stable structures, and predictable formatting.&lt;/p&gt;

&lt;p&gt;To achieve this, we define a response schema. LangChain uses this schema to force the model to respond in a clean, structured way.&lt;/p&gt;

&lt;p&gt;Before showing the code, here is what you are doing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating a data class that represents the exact shape of the final answer.&lt;/li&gt;
&lt;li&gt;Telling LangChain to use this schema when parsing the model’s output.&lt;/li&gt;
&lt;li&gt;Ensuring every response is machine-readable and safe to process.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s define the response structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from dataclasses import dataclass

# ---------------------------------------
# Define the exact structure the agent must return
# ---------------------------------------
@dataclass
class ResponseFormat:
    # A playful weather message generated by the model
    punny_response: str
    # Optional field for conditions like "sunny", "cloudy", etc.
    weather_conditions: str | None = None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is where the agent becomes production-ready.&lt;/p&gt;

&lt;p&gt;Instead of letting the model write any paragraph it wants, you give it a strict format. LangChain ensures the final response follows the schema exactly.&lt;/p&gt;

&lt;p&gt;This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The location of each piece of information is always the same.&lt;/li&gt;
&lt;li&gt;Your code never has to guess what the model meant.&lt;/li&gt;
&lt;li&gt;Errors drop because the structure is enforced.&lt;/li&gt;
&lt;li&gt;Logging, debugging, and testing become far easier.&lt;/li&gt;
&lt;li&gt;Downstream services don’t need regex or parsing hacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By shaping the output, you turn a creative model into a dependable system. It still speaks naturally, but the underlying data stays clean, stable, and safe to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory Gives the Agent a Sense of Continuity
&lt;/h2&gt;

&lt;p&gt;An agent without memory acts like it has amnesia. It forgets who you are, what you asked earlier, and what tools it has already used.&lt;/p&gt;

&lt;p&gt;To make an agent feel natural and consistent, it needs a way to store what happened in previous messages. LangChain provides this through a &lt;a href="https://docs.langchain.com/oss/python/langgraph/persistence" rel="noopener noreferrer"&gt;checkpointer.&lt;/a&gt; It helps us provide additional context to the agent every time we send a request.&lt;/p&gt;

&lt;p&gt;Here is what we will be doing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating an in-memory storage object.&lt;/li&gt;
&lt;li&gt;Allowing the agent to save conversation history to that storage.&lt;/li&gt;
&lt;li&gt;Making the agent remember user identity, previous answers, and tool calls.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This instantly makes the agent feel more like a real assistant.&lt;/p&gt;

&lt;p&gt;Now, let’s add memory to the agent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from langgraph.checkpoint.memory import InMemorySaver

# ---------------------------------------
# Simple in-memory storage for conversation history
# ---------------------------------------
checkpointer = InMemorySaver()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that we have used Langgraph to call ImMemorySaver. &lt;a href="https://www.turingtalks.ai/p/langchain-vs-langgraph" rel="noopener noreferrer"&gt;LangChain and LangGraph&lt;/a&gt; are separate libraries that work well together.&lt;/p&gt;

&lt;p&gt;LangChain handles tools, prompts, schemas, and model interaction, while LangGraph manages the control flow and memory features.&lt;/p&gt;

&lt;p&gt;Now with memory enabled, the agent can remember who the user is, recall previous questions, keep track of tool results and continue the conversation naturally&lt;/p&gt;

&lt;p&gt;It no longer asks “Who are you?” repeatedly. It doesn’t treat every question as brand new. It behaves as if the conversation has context and flow.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;InMemorySaver&lt;/code&gt; keeps everything in RAM. This is perfect for demos, tests, and local development.&lt;/p&gt;

&lt;p&gt;But memory must survive restarts in production. For that, we can replace the saver with a real database like Redis or Postgres.&lt;/p&gt;

&lt;p&gt;With a persistent checkpointer, your agent remembers everything across sessions, servers, and deployments.&lt;/p&gt;

&lt;p&gt;Memory is what turns a tool-calling script into a companion that understands continuity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting the Agent Together
&lt;/h2&gt;

&lt;p&gt;Everything we built so far, model, tools, system prompt, context, memory, and response format, now comes together to form a complete agent.&lt;/p&gt;

&lt;p&gt;This is where the system stops being a set of separate parts and starts behaving like one intelligent unit.&lt;/p&gt;

&lt;p&gt;Let’s use the system prompt, tools, context, response format and memory and build our agent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from langchain.agents import create_agent
from langchain.output_parsers.tools import ToolStrategy

# ---------------------------------------
# Create the final agent by combining:
# - model: the brain
# - system_prompt: the rules
# - tools: the actions it can take
# - context_schema: user-specific info
# - response_format: structured outputs
# - checkpointer: memory for continuity
# ---------------------------------------
agent = create_agent(
    model=model,
    system_prompt=SYSTEM_PROMPT,
    tools=[get_user_location, get_weather_for_location],
    context_schema=Context,
    response_format=ToolStrategy(ResponseFormat),
    checkpointer=checkpointer
)
# ---------------------------------------
# Thread ID groups all messages into a single session.
# Reusing the same ID lets the agent remember context.
# ---------------------------------------
config = {"configurable": {"thread_id": "1"}}
# ---------------------------------------
# Invoke the agent with:
# - a user message
# - the session config
# - the user context (user_id)
# ---------------------------------------
response = agent.invoke(
    {"messages": [{"role": "user", "content": "what is the weather outside?"}]},
    config=config,
    context=Context(user_id="1")
)
# Print the final structured output
print(response['structured_response'])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the moment everything connects.&lt;/p&gt;

&lt;p&gt;The agent follows a predictable internal sequence: read the prompt rules, examine the conversation history, choose whether to call a tool, run the tool with the correct arguments, and finally format the response according to your schema. This loop repeats for every message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.langchain.com/oss/python/langchain/structured-output" rel="noopener noreferrer"&gt;ToolStrategy&lt;/a&gt; ensures that the model’s final response strictly follows the dataclass schema you defined. Without it, the model might return loosely formatted text.&lt;/p&gt;

&lt;p&gt;With ToolStrategy, LangChain parses and validates the output so your application always receives clean, predictable data.&lt;/p&gt;

&lt;p&gt;The agent now has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a model to think&lt;/li&gt;
&lt;li&gt;a prompt to guide behaviour&lt;/li&gt;
&lt;li&gt;tools to take action&lt;/li&gt;
&lt;li&gt;context to personalise responses&lt;/li&gt;
&lt;li&gt;memory to stay consistent&lt;/li&gt;
&lt;li&gt;a schema to format output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the user asks what the weather is outside, the agent begins by reading the rules in the system prompt to understand how it should respond. It then checks whether it already knows the user’s location, and if not, it calls the &lt;code&gt;get_user_location&lt;/code&gt; tool using the context that was injected when the request was made.&lt;/p&gt;

&lt;p&gt;Once the agent knows the city, it calls &lt;code&gt;get_weather_for_location&lt;/code&gt; to fetch the weather details. Finally, it combines everything and returns a neatly structured response that follows the ResponseFormat schema you defined.&lt;/p&gt;

&lt;p&gt;The thread ID acts like a conversation session. If you send more messages with the same ID, the agent remembers who the user is, what tools were called and earlier questions or answers&lt;/p&gt;

&lt;p&gt;This creates real conversational continuity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clean, reliable output
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ResponseFormat(punny_response="I found you — you're in Florida, so the forecast is sun-sational! No clouds about it: it’s always sunny in Florida. Don’t foget your shades — that’s a bright idea!", weather_conditions="It's always sunny in Florida.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you print &lt;code&gt;structured_response&lt;/code&gt;, you don’t get text blobs or guesses. You get a neat Python object that exactly follows the schema you defined.&lt;/p&gt;

&lt;p&gt;This makes the agent safe to integrate with dashboards, APIs, automations and backend systems.&lt;/p&gt;

&lt;p&gt;No extra parsing. No brittle logic. Just predictable output.&lt;/p&gt;

&lt;p&gt;A second call with the same thread_id makes the agent respond in the same pun-packed tone while keeping context. It knows you are still the same person in the same conversation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ResponseFormat(punny_response="You're welcome! Glad I could brighten your day - I'm always here to "weather" your questions. Want an hourly or 7-day outlook?", weather_conditions=None)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The thread_id works like a session key. Every request sent with the same thread_id shares the same memory state.&lt;/p&gt;

&lt;p&gt;This is how the agent remembers earlier questions, tool responses, or user details across multiple messages. Changing the thread_id starts a fresh conversation.&lt;/p&gt;

&lt;p&gt;This is what makes agents feel coherent rather than robotic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving to production
&lt;/h2&gt;

&lt;p&gt;Once the quickstart becomes familiar, taking the agent to production is simply about adding structure and discipline.&lt;/p&gt;

&lt;p&gt;The tools you wrote as placeholders should now do real work, and the in-memory storage should be replaced with a proper database so that memory survives restarts.&lt;/p&gt;

&lt;p&gt;Your API needs authentication to protect access, and &lt;a href="https://smith.langchain.com/" rel="noopener noreferrer"&gt;LangSmith tracing&lt;/a&gt; should be enabled so every tool call and model decision can be monitored.&lt;/p&gt;

&lt;p&gt;The system prompt must stay clear and consistent to avoid drift, and the model settings, like temperature, max tokens, and model choice, should be tuned to balance cost and reliability.&lt;/p&gt;

&lt;p&gt;Production agents also need safeguards around rate limits, timeout handling, tool failures, and observability. Adding retries, circuit breakers, structured logging, and LLM error handling ensures the system stays stable under real workloads.&lt;/p&gt;

&lt;p&gt;Through all of this, the core agent pattern remains unchanged. You only strengthen the environment around it to make the entire system stable, predictable, and ready for real users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Agents are not magic. They are predictable systems built from simple parts.&lt;/p&gt;

&lt;p&gt;A model that follows instructions. Tools that do things. Prompts that set the rules. Memory that ties a conversation together. And schemas that keep the output clean.&lt;/p&gt;

&lt;p&gt;Once you understand how these pieces fit, you can build an agent that feels polished, helpful, and ready for real users.&lt;/p&gt;

&lt;p&gt;It can fetch data, store context, call APIs, and answer in structured ways without you writing the logic by hand.&lt;/p&gt;

&lt;p&gt;That is what makes LangChain so powerful. It lets you focus on the behavior you want, not the plumbing underneath.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article. Sign up for my free newsletter &lt;a href="https://www.turingtalks.ai/" rel="noopener noreferrer"&gt;TuringTalks.ai&lt;/a&gt; for more hands-on tutorials on AI. You can also &lt;a href="https://manishshivanandhan.com/" rel="noopener noreferrer"&gt;visit my website.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Build, Manage, and Ship Python Projects the Easy Way using Poetry</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Mon, 24 Nov 2025 15:08:53 +0000</pubDate>
      <link>https://dev.to/manishmshiva/build-manage-and-ship-python-projects-the-easy-way-using-poetry-4ko</link>
      <guid>https://dev.to/manishmshiva/build-manage-and-ship-python-projects-the-easy-way-using-poetry-4ko</guid>
      <description>&lt;p&gt;&lt;strong&gt;A guide to understanding Python Poetry, how it works, and how to use it in your next Python project.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python development looks simple from the outside. But managing real projects is rarely easy.&lt;/p&gt;

&lt;p&gt;You need to install packages, update them, avoid version conflicts, create virtual environments, and prepare your project for distribution.&lt;/p&gt;

&lt;p&gt;Many beginners think they can handle everything with pip and venv. This works for small scripts, but becomes messy once your project grows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://python-poetry.org/" rel="noopener noreferrer"&gt;Poetry&lt;/a&gt; solves this problem by giving you one clean workflow for managing Python projects from start to finish.&lt;/p&gt;

&lt;p&gt;Poetry brings structure to your project. It automates package management, creates virtual environments independently, and prepares your project for building and publishing.&lt;/p&gt;

&lt;p&gt;It replaces many scattered tools, bringing clarity and reliability. With Poetry, you focus on writing code while it takes care of the setup.&lt;/p&gt;

&lt;p&gt;Poetry is also very helpful for AI projects. It locks exact dependency versions, which prevents sudden breaks when libraries like transformers, torch, or &lt;a href="https://www.turingtalks.ai/p/langchain-vs-langgraph" rel="noopener noreferrer"&gt;langchain&lt;/a&gt; release updates that can change model behaviour or API outputs.&lt;/p&gt;

&lt;p&gt;This article explains how Poetry works, how to use it with examples, and how it compares with other alternatives. The goal is to make Poetry simple to understand, even if you are new to Python.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem Poetry Tries to Solve
&lt;/h2&gt;

&lt;p&gt;Modern &lt;a href="https://www.freecodecamp.org/news/learn-python-basics/" rel="noopener noreferrer"&gt;Python projects&lt;/a&gt; need many moving parts.&lt;/p&gt;

&lt;p&gt;You install libraries from &lt;a href="http://pypi.org/" rel="noopener noreferrer"&gt;PyPI&lt;/a&gt;, update them over time, track versions to keep the project stable, and share those versions with your team. You also need to package your project if you want others to use it.&lt;/p&gt;

&lt;p&gt;The traditional way of using requirements.txt and pip install does not solve everything.&lt;/p&gt;

&lt;p&gt;Dependencies can break when a new version is released. Two developers may use different versions without knowing. You may forget which environment you used. When you want to package the project, you often need tools like setuptools and wheel.&lt;/p&gt;

&lt;p&gt;Poetry brings all these pieces together. It uses one file, &lt;a href="https://packaging.python.org/en/latest/guides/writing-pyproject-toml/" rel="noopener noreferrer"&gt;pyproject.toml&lt;/a&gt;, to define everything.&lt;/p&gt;

&lt;p&gt;It installs packages in a clean virtual environment. It locks versions to avoid surprises. And it can build and publish your package with a couple of commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with Poetry
&lt;/h2&gt;

&lt;p&gt;Poetry is easy to start with.&lt;/p&gt;

&lt;p&gt;You install it once, and it works on any Python project. Run this command to install Poetry on your system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pipx install poetry
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you can start a new project using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry new my_project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a folder with a basic structure. It includes a pyproject.toml file. This file is the heart of your project. It includes your project name, version, description, and dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[tool.poetry]
name = "myapp"
version = "0.1.0"
description = ""
authors = ["Manish Shivanandhan &amp;lt;manish@example.com&amp;gt;"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to add Poetry to an existing project, you use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This asks you simple questions about your project and creates the configuration file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This command will guide you through creating your pyproject.toml config.

Package name [myapp]:
Version [0.1.0]:
Description []:
Author [Manish Shivanandhan &amp;lt;manish@example.com&amp;gt;, n to skip]:
License []:
Compatible Python versions [^3.12]:

Would you like to define your main dependencies interactively? (yes/no) [yes]
You can specify a package in the following forms:
  - A single name (requests): this will search for matches on PyPI
  - A name and a constraint (requests@^2.23.0)
  - A git url (git+https://github.com/python-poetry/poetry.git)
  - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)
  - A file path (../my-package/my-package.whl)
  - A directory (../my-package/)
  - A url (https://example.com/packages/my-package-0.1.0.tar.gz)

Package to add or search for (leave blank to skip):

Would you like to define your development dependencies interactively? (yes/no) [yes]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can install packages using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry add &amp;lt;package_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Poetry will install the package inside its own virtual environment. You do not need to run venv manually. To run your Python program, you use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry run python main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or you can enter the environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry shell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple workflow becomes natural very quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding pyproject.toml
&lt;/h2&gt;

&lt;p&gt;The pyproject.toml file holds the data that defines your project. Poetry fills this file when you add or remove dependencies. An example of a simple file is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[tool.poetry]
name = "weather"
version = "0.1.0"
authors = ["Manish"]

[tool.poetry.dependencies]
python = "^3.10"
requests = "^2.32.0"
[tool.poetry.group.dev.dependencies]
pytest = "^8.2.0"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This single file replaces setup.py, requirements.txt, and many manual steps. Poetry acts as a manager for everything inside it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a Sample App
&lt;/h2&gt;

&lt;p&gt;Imagine you are creating a simple weather app that calls an API. After creating a poetry project, you add a dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry add requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you write a Python script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

def get_weather(city):
    url = f"https://wttr.in/{city}?format=3"
    response = requests.get(url)
    print(response.text)
get_weather("London")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry run python weather.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Poetry locks the version of requests so your app works the same for everyone. If a new version is released and breaks something, you are safe because Poetry keeps your locked version.&lt;/p&gt;

&lt;p&gt;When you want to build your project for publishing, you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a file you can upload to PyPI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This kind of simplicity is why Poetry has become a favourite among developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Lock File
&lt;/h2&gt;

&lt;p&gt;One of the quietly powerful features of Poetry is the lock file. When you add a package, Poetry writes exact versions to poetry.lock. This file ensures your project behaves the same across machines. If someone clones your project, all they need is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Poetry reads the lock file and installs the exact same versions you used. This helps with debugging because nothing changes silently after installation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparing Poetry With Other Tools
&lt;/h2&gt;

&lt;p&gt;Poetry is not the only tool for managing Python projects. To understand why developers choose Poetry, it helps to compare it with other popular options. Here are three alternatives and how they differ.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Poetry vs Pip and Virtual Environments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/pip/" rel="noopener noreferrer"&gt;Pip&lt;/a&gt; is the default Python package installer, and venv creates isolated environments. These two tools have been used together for years. They work fine for simple scripts but require manual steps for real projects.&lt;/p&gt;

&lt;p&gt;You create a virtual environment manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python -m venv env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you activate it, install packages, update requirements.txt, and manage version conflicts yourself. Packaging the project is a separate process entirely.&lt;/p&gt;

&lt;p&gt;Poetry automates all of this. It creates the environment, tracks versions, and builds packages. The workflow is cleaner and more modern. Pip and venv feel manual compared to Poetry’s automated approach.&lt;/p&gt;

&lt;p&gt;If you only need a quick script, pip and venv are enough. But for repeatable and sharable projects, Poetry wins by a wide margin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Poetry vs Pipenv&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pipenv.pypa.io/en/latest/" rel="noopener noreferrer"&gt;Pipenv&lt;/a&gt; was created to make pip easier to use. It combines pip and virtual environments into a single workflow. Many people thought Pipenv would become the main Python tool, but it has struggled with performance and reliability issues.&lt;/p&gt;

&lt;p&gt;For example, installing packages in Pipenv can be slow. Pipenv also uses a Pipfile instead of pyproject.toml, which makes it less aligned with modern Python standards.&lt;/p&gt;

&lt;p&gt;A basic Pipenv command to install requests looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pipenv install requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Poetry does the same with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry add requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The biggest difference is stability. Poetry resolves dependencies faster and more reliably. It works well for large projects. Pipenv is simpler than raw pip but still less polished than Poetry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Poetry vs Hatch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hatch.pypa.io/latest/" rel="noopener noreferrer"&gt;Hatch&lt;/a&gt; is another modern tool for managing Python projects. It also uses pyproject.toml, so it follows the same standards as Poetry.&lt;/p&gt;

&lt;p&gt;Hatch is known for being flexible and fast. It is popular among users who handle packaging, testing, and versioning.&lt;/p&gt;

&lt;p&gt;Hatch can create environments using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hatch env create
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dependencies are managed using sections in the configuration file. Hatch can feel more advanced, and it focuses more on packaging than dependency management.&lt;/p&gt;

&lt;p&gt;The main difference is that Poetry tries to be an all-in-one tool for dependency management, environments, building, and publishing. Hatch gives more control but less of a guided experience.&lt;/p&gt;

&lt;p&gt;For beginners and teams, Poetry feels smoother. Hatch is powerful for advanced users who want more customisation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Poetry Feels Enjoyable to Use
&lt;/h2&gt;

&lt;p&gt;One of the reasons developers enjoy Poetry is the feeling of clarity.&lt;/p&gt;

&lt;p&gt;Everything is clean, predictable, and organized. When you open a Poetry project, you always know where to look.&lt;/p&gt;

&lt;p&gt;You know that dependencies are managed properly. You know that your build will work. This reduces stress and makes you more confident.&lt;/p&gt;

&lt;p&gt;Poetry handles things you might forget about. It creates environments, controls versions, and keeps your workspace clean. It also has a friendly command-line interface that guides you with helpful messages.&lt;/p&gt;

&lt;p&gt;Another benefit is how easy it is to share your project. Anyone who wants to run your project only needs to run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;poetry install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This brings stability to teams and avoids many common issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Poetry Might Not Be the Best Choice
&lt;/h2&gt;

&lt;p&gt;Poetry is great for most projects, but there are cases where it may not be the best fit.&lt;/p&gt;

&lt;p&gt;If your project is extremely small, you may not need the extra structure. If you work in an environment that already uses pip, conda, or another strict workflow, introducing Poetry may cause friction.&lt;/p&gt;

&lt;p&gt;Poetry also tries to manage environments on its own. Some users prefer manual control. In those cases, tools like Hatch or plain pip may fit better.&lt;/p&gt;

&lt;p&gt;But for the majority of Python developers, Poetry brings huge value with very little setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Poetry is one of the clearest and most useful tools in the Python ecosystem. It helps you manage dependencies, create environments, build packages, and publish them with ease. It brings structure and reliability to your projects, making your code more stable and easier to share.&lt;/p&gt;

&lt;p&gt;If you are looking for a better workflow for your Python projects, Poetry is a great tool to use. It keeps your setup clean, prevents version problems, and gives you a smooth path from development to publishing. With a few commands, you can build strong and repeatable Python projects without the usual headaches.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article. Sign up for my free newsletter &lt;a href="https://hatch.pypa.io/latest/" rel="noopener noreferrer"&gt;TuringTalks.ai&lt;/a&gt; for more hands-on tutorials on AI. You can also &lt;a href="https://hatch.pypa.io/latest/" rel="noopener noreferrer"&gt;visit my website.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Compress Your Prompts and Reduce LLM Costs</title>
      <dc:creator>Manish Shivanandhan</dc:creator>
      <pubDate>Fri, 21 Nov 2025 12:33:36 +0000</pubDate>
      <link>https://dev.to/manishmshiva/how-to-compress-your-prompts-and-reduce-llm-costs-3pa</link>
      <guid>https://dev.to/manishmshiva/how-to-compress-your-prompts-and-reduce-llm-costs-3pa</guid>
      <description>&lt;p&gt;&lt;strong&gt;Microsoft just solved the hidden cost problem in AI with LLMLingua, making large language models faster, cheaper, and smarter.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every developer working with large language models eventually faces the same challenge.&lt;/p&gt;

&lt;p&gt;Prompts keep getting longer, models keep getting slower, and API bills keep getting higher.&lt;/p&gt;

&lt;p&gt;Whether you’re building a &lt;a href="https://www.freecodecamp.org/news/mastering-rag-from-scratch/" rel="noopener noreferrer"&gt;retrieval-augmented generation&lt;/a&gt;(RAG) system or a chatbot that remembers past conversations, every extra token adds cost and latency.&lt;/p&gt;

&lt;p&gt;Microsoft quietly introduced a fix that few people outside research circles noticed, with a project called &lt;a href="https://github.com/microsoft/LLMLingua" rel="noopener noreferrer"&gt;LLMLingua&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It compresses prompts before sending them to a model, keeping only the most important information. The result is faster responses, smaller bills, and an easier path to scaling LLMs.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will look at how to use LLM Lingua to optimze our prompts and make them more efficient while saving costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem Hidden in Plain Sight
&lt;/h2&gt;

&lt;p&gt;When an LLM processes a prompt, every token counts toward your cost and the model’s attention limit.&lt;/p&gt;

&lt;p&gt;For &lt;a href="https://www.turingtalks.ai/p/how-ai-agents-remember-things-the-role-of-vector-stores-in-llm-memory" rel="noopener noreferrer"&gt;context-heavy applications&lt;/a&gt;, it’s common to hit the maximum token window long before you reach the useful part of your data.&lt;/p&gt;

&lt;p&gt;Adding more context may help the model reason better, but it also slows down inference. Long prompts not only take more time to generate responses but also eat into your budget when using APIs like GPT-4 or Claude.&lt;/p&gt;

&lt;p&gt;LLMLingua targets this problem directly by compressing prompts intelligently without retraining or modifying the underlying model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What LLMLingua Does Differently
&lt;/h2&gt;

&lt;p&gt;LLMLingua uses a smaller, compact language model, like GPT-2 Small or LLaMA-7B. It uses them to identify and remove non-essential tokens in a given prompt.&lt;/p&gt;

&lt;p&gt;Instead of feeding thousands of tokens into your main model, you send a compact version that retains meaning.&lt;/p&gt;

&lt;p&gt;This approach achieves up to 20x compression with negligible accuracy loss. In simple terms, LLMLingua lets your LLM read the same content in fewer words.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working with LLMLingua
&lt;/h2&gt;

&lt;p&gt;Getting started is simple. The library is available on PyPI and works out of the box.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install llmlingua

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you can import it into Python to begin compressing prompts.&lt;/p&gt;

&lt;p&gt;Here’s how you can compress a large text prompt using LLMLingua.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from llmlingua import PromptCompressor

# Initialize the compressor
llm_lingua = PromptCompressor()

# Compress the prompt
prompt = "Sam bought a dozen boxes, each with 30 highlighter pens inside, for $10 each box..."

compressed_prompt = llm_lingua.compress_prompt(prompt, instruction="", question="", target_token=200)

print(compressed_prompt)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run this, you’ll get a dictionary like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  'compressed_prompt': 'Question: Sam bought a dozen boxes each with 30 highlighter pens...',
  'origin_tokens': 2365,
  'compressed_tokens': 211,
  'ratio': '11.2x',
  'saving': 'Saving $0.1 in GPT-4.'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also load different models depending on your resources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Use a more powerful compression model
llm_lingua = PromptCompressor("microsoft/phi-2")

# Or use a quantized model for GPUs with limited memory
# Requires: pip install optimum auto-gptq
llm_lingua = PromptCompressor("TheBloke/Llama-2-7b-Chat-GPTQ", model_config={"revision": "main"})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple setup can save hundreds of dollars in production if you’re processing long documents or chat histories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling Long Contexts with LongLLMLingua
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://llmlingua.com/longllmlingua.html" rel="noopener noreferrer"&gt;LongLLMLingua &lt;/a&gt;extends this concept to massive inputs like PDFs, transcripts, or multi-document retrievals. It reorders and filters context dynamically to ensure that the model sees only the most relevant sections.&lt;/p&gt;

&lt;p&gt;Here’s how you might use it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from llmlingua import PromptCompressor

llm_lingua = PromptCompressor()

compressed_prompt = llm_lingua.compress_prompt(
    prompt_list,
    question="What are the main regulatory changes in the last quarter?",
    rate=0.55,
    condition_in_question="after_condition",
    reorder_context="sort",
    dynamic_context_compression_ratio=0.3,
    condition_compare=True,
    context_budget="+100",
    rank_method="longllmlingua",
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works especially well in RAG systems where documents vary in length and relevance. By combining retrieval with compression, you can fit more context into your LLM without hitting token limits.&lt;/p&gt;

&lt;h2&gt;
  
  
  LLMLingua-2: Faster and Smarter
&lt;/h2&gt;

&lt;p&gt;Microsoft’s team didn’t stop there. They introduced &lt;a href="https://llmlingua.com/llmlingua2.html" rel="noopener noreferrer"&gt;LLMLingua-2&lt;/a&gt;, which is faster and more general-purpose.&lt;/p&gt;

&lt;p&gt;It uses data distillation from GPT-4 and a BERT-level encoder to improve compression fidelity.&lt;/p&gt;

&lt;p&gt;This version handles out-of-domain data better and performs 3–6 times faster than the original.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from llmlingua import PromptCompressor

# Initialize LLMLingua-2
llm_lingua = PromptCompressor(
    model_name="microsoft/llmlingua-2-xlm-roberta-large-meetingbank",
    use_llmlingua2=True,
)
compressed_prompt = llm_lingua.compress_prompt(prompt, rate=0.33, force_tokens=['\n', '?'])

# Or use a smaller multilingual model
llm_lingua = PromptCompressor(
    model_name="microsoft/llmlingua-2-bert-base-multilingual-cased-meetingbank",
    use_llmlingua2=True,
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For multilingual and enterprise scenarios, LLMLingua-2 offers the right balance between cost, accuracy, and speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Structured Prompt Compression
&lt;/h2&gt;

&lt;p&gt;Sometimes, you want control over which sections of a prompt should be compressed.&lt;/p&gt;

&lt;p&gt;LLMLingua supports structured compression using special tags. You can mark segments of text to compress at different rates or skip entirely.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;structured_prompt = """&amp;lt;llmlingua, compress=False&amp;gt;Speaker 4:&amp;lt;/llmlingua&amp;gt;
&amp;lt;llmlingua, rate=0.4&amp;gt; Thank you. And can we do the functions for content? Items I believe are 11, three, 14, 16 and 28, I believe.&amp;lt;/llmlingua&amp;gt;
&amp;lt;llmlingua, compress=False&amp;gt;Speaker 0:&amp;lt;/llmlingua&amp;gt;
&amp;lt;llmlingua, rate=0.4&amp;gt; Item 11 is a communication from Council on Price recommendation...&amp;lt;/llmlingua&amp;gt;"""

compressed_prompt = llm_lingua.structured_compress_prompt(
    structured_prompt,
    instruction="",
    question="Summarize the meeting notes",
    rate=0.5,
)
print(compressed_prompt['compressed_prompt'])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This feature is especially useful in meeting summarization or note-taking systems where speaker tags or section headers must remain intact.&lt;/p&gt;

&lt;h2&gt;
  
  
  SecurityLingua: Compression as a Defense
&lt;/h2&gt;

&lt;p&gt;A newer addition, SecurityLingua, uses security-aware compression to detect malicious jailbreak attempts.&lt;/p&gt;

&lt;p&gt;It reveals harmful intent hidden within complex prompts and defends against attacks with 100x less token cost compared to traditional guardrails.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from llmlingua import PromptCompressor

securitylingua = PromptCompressor(
    model_name="SecurityLingua/securitylingua-xlm-s2s",
    use_slingua=True
)
intention = securitylingua.compress_prompt(malicious_prompt)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This model offers a unique approach: instead of filtering after generation, it prevents malicious instructions from reaching the model in the first place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integration with the Ecosystem
&lt;/h2&gt;

&lt;p&gt;One of the reasons LLMLingua stands out is how seamlessly it fits into the modern AI ecosystem.&lt;/p&gt;

&lt;p&gt;Instead of being a standalone research prototype, it’s already integrated into popular frameworks like &lt;a href="https://www.turingtalks.ai/p/langchain-vs-langgraph" rel="noopener noreferrer"&gt;LangChain&lt;/a&gt;, LlamaIndex, and Microsoft Prompt Flow.&lt;/p&gt;

&lt;p&gt;This means you can plug it directly into your existing RAG or document-processing pipelines without rewriting code or changing your models.&lt;/p&gt;

&lt;p&gt;For example, in LangChain, LLMLingua acts as a smart middle layer that compresses retrieved context before it reaches the LLM.&lt;/p&gt;

&lt;p&gt;Imagine you’re using a retriever to pull documents from a knowledge base. Instead of sending those long texts straight to your model, LLMLingua filters out unnecessary tokens so your prompt stays concise and efficient.&lt;/p&gt;

&lt;p&gt;Here’s how you can integrate it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from langchain_classic.retrievers.contextual_compression import ContextualCompressionRetriever
from langchain_community.document_compressors import LLMLinguaCompressor
from langchain_openai import ChatOpenAI

# Initialize your base model
llm = ChatOpenAI(temperature=0)

# Create an LLMLingua-based compressor
compressor = LLMLinguaCompressor(model_name="openai-community/gpt2", device_map="cpu")

# Wrap your existing retriever with LLMLingua compression
compression_retriever = ContextualCompressionRetriever(
    base_compressor=compressor,
    base_retriever=retriever  # your existing document retriever
)
# Use it like a normal retriever, but now with smart compression
compressed_docs = compression_retriever.invoke(
    "What did the president say about Ketanji Jackson Brown"
)
pretty_print_docs(compressed_docs)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this setup, the retriever first gathers relevant documents, and LLMLingua compresses them before passing them to the LLM. The model receives a condensed but information-rich prompt, which keeps token usage low while maintaining accuracy.&lt;/p&gt;

&lt;p&gt;This integration works out of the box with any supported model on LangChain. It can be customized to use your preferred compression rate or model variant (like LLMLingua-2).&lt;/p&gt;

&lt;p&gt;The result is a more efficient pipeline. Your LLM reads less but understands more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why LLM Lingua Matters
&lt;/h2&gt;

&lt;p&gt;LLMLingua may not make headlines like GPT-5 or Gemini, but its impact is fundamental. It addresses the most expensive part of LLM workflows — context handling.&lt;/p&gt;

&lt;p&gt;By removing redundant tokens and preserving intent, it transforms how developers build scalable AI applications.&lt;/p&gt;

&lt;p&gt;Whether you’re summarizing regulatory data, processing long legal documents, or powering multilingual chatbots, LLMLingua gives you a new lever for optimization.&lt;/p&gt;

&lt;p&gt;The takeaway is simple: the future of AI efficiency won’t just come from larger models, but from smarter ones, and smarter prompts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Microsoft’s LLMLingua is more than a research project. It’s a quiet revolution in how we deliver information to LLMs. It lets developers stretch context limits, cut costs, and speed up inference — all without retraining a single model.&lt;/p&gt;

&lt;p&gt;By learning to compress prompts intelligently, LLMLingua helps you talk to machines more efficiently. And in the world of large language models, saying more with less is exactly the kind of progress that matters most.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article. Signup for my free newsletter &lt;a href="https://www.turingtalks.ai/" rel="noopener noreferrer"&gt;TuringTalks.ai&lt;/a&gt; for more hands-on tutorials on AI. You can also &lt;a href="https://manishshivanandhan.com/" rel="noopener noreferrer"&gt;visit my website.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
