This page looks best with JavaScript enabled

You Can Also Implement AI Agents This Way - The SOPS Edition

 ·  β˜• 5 min read

1. Establish a SOPS Baseline

SOPS stands for Standard Operating Procedures. In the production activities we carry out, there are often some basic, repetitive operational flows, and these operations are the SOPS.

You need to build up a set of SOPS; by combining them you can finish tasks faster. In the past, establishing standard procedures required a senior engineer, but now with AI, producing SOPS is very easy.

Since it is all made by AI, why not create SOPS dynamically while solving a problem? That is the ultimate form, and current AI Agents have not yet reached that level of maturity. There are several reasons:

  • Every company’s practice path is different, and the generic solutions AI provides do not fully apply, so SOPS act as the Prompt
  • A finite set of SOPS keeps AI from thinking too divergently and helps it solve problems faster and more accurately, so SOPS provide few-shot samples
  • AI cannot bear responsibility in the physical world for us, so SOPS act as the goalkeeper

2. Export the MCP Protocol

I explained this in the MCP Edition: the greatest value of MCP is that, as the model wars are winding down and AI applications are about to explode, it gives developers a unified standard for invoking capabilities beyond the model itself.

Do not be fooled by the CLI pattern widely used in OpenClaw. The CLI is the key that opens the old world, and OpenClaw has used the CLI to drive many traditional applications that had no time to embrace AI. The limitation of the CLI is that it is bound to the system and the processor. If you are just handling some everyday applications, that is fine, because someone else has already made it compatible for you. But what about integrating with internal systems β€” would you be willing to write a separate CLI for each combination of Windows, Linux, and Mac with X86 and ARM?

MCP can be converted into a CLI. In many Skills, the tool mcporter is used to turn an MCP Server directly into CLI commands without extra development. If you have to choose, MCP is the better choice, and ideally one MCP Server should concentrate the capabilities. The MCP Server is a new application paradigm; more features and more invocations mean higher value output.

3. Do Not Be Superstitious About Tokens

This is a basic principle: try not to use tokens.

You may be puzzled β€” if an AI Agent does not use tokens, can it still be an AI Agent? In fact, the difficulties in engineering practice are usually not a single-point technical problem; it is not that a strong enough model alone can solve the problem directly.

The use of tokens brings the following problems:

  • Extra cost: although the unit price of tokens keeps dropping, a round of a million-level tokens is still a considerable expense
  • Reduced efficiency: calling the model API takes time, and using tokens makes the overall response time longer
  • Uncertainty: even when temperature is 0, there is no guarantee that the output is completely identical every time, and using tokens means facing this uncertainty
  • Privacy leakage: on one hand, the model service provider can directly obtain the user’s input; on the other hand, once user data is used for training, it may also leak to other users

Demystify the model. Do not use the model everywhere indiscriminately; doing so will cause the system to lose its ability to evolve. A system that cannot keep earning a high score easily loses the trust of others, and you will start to doubt yourself too.

4. The Paradigms for Executing SOPS

4.1 Delivering via a Page

In the age of AI Agents, continuing to execute SOPS by clicking on a page is nothing to be ashamed of. Having a traditional SOPS entry point has many benefits:

  • If there are no tokens, you can fall back to manual operation
  • You can look at the data directly, which helps align the AI Agent
  • It serves as a shared storage backend, connecting all such AI Agents
  • It records history and audit data, which is used to assign responsibility

We can also use AI Agents to help us generate SOPS projects; in the operations domain, these are projects like job platforms and pipeline platforms, and what I use is the open source project I wrote earlier, https://www.chenshaowen.com/ops/ .

As shown above, Ops provides operations capabilities for clusters, while the operations platform integrates business information and business scenarios to connect with business systems, offering direct encapsulation of production operations matters.

4.2 By Keyword

Filtering by keyword allows you to quickly match a specific pattern and automatically execute a preset SOPS.

As shown above, we implemented an ops-sops-keyword application that connects the SOPS handling flow for exception events and Copilot messages. It mainly implements the following functions:

  • Extract parameters through regular expression matching
  • Select the SOPS through action matching
  • Add extra parameters; a model can be used to accomplish the two things above

For tasks whose intent is very obvious, we can handle them entirely based on rules.

The figure above is a case from production: disabling an abnormal node by adding cordon-node. This handling approach has never failed, whereas the previous model-driven approach would occasionally pick the wrong SOPS.

4.3 Routing High-Risk Operations

This year we integrated OpenClaw for automated fault localization and handling, and we have achieved some results so far. Later I will share some related practices.

As shown above, various AI Agents connect to the SOPS capabilities through the ops mcp server. When a task reaches Ops, we route it into two categories:

  • Routine, safe operations are executed directly, which is extremely efficient
  • High-risk, complex operations go through the operations platform connected to business information and are executed via an approval flow

The figure above is a real example from production. On the OA side, replying directly to the Agent with a message, the Agent selects the appropriate SOPS based on the model and triggers the operations platform to restart the node. The operations platform immediately issues an approval notification, preparing to restart the node,


WeChat Official Account
WRITTEN BY
WeChat Official Account