Mosoo Mosoo / Blog
← All posts
Engineering

From model calls to agent tasks

Evanchen Ennea By Evanchen & Ennea
A collage of green paper squares and wild plants climbing upward on a pale field, like sessions stacking into a living system.

Every generation of AI API gives developers a new primitive. Completions returned text. Chat APIs added structured messages. Tool calling let models request actions.

Each step moved more intelligence behind the API. But the application still owned the loop around it: tools, permissions, environment, state, retries, and the product experience.

Modern model APIs now include hosted tools, stored state, and background execution. They are useful building blocks. They still do not run your product-specific agent with its own environment, credentials, files, and lifecycle.

Local agents proved the runtime

Claude Code and Codex changed the experience because the model was no longer alone. It had a filesystem, shell, git, skills, and tools inside a real working environment.

That makes a familiar prototype possible. Point a coding agent at a repository, let it pull data and run an analysis, then feed the result into your own web page. The workflow can come together in one sitting.

The next request arrives naturally: move it to the cloud, run it on a schedule, run jobs concurrently, or turn it into a feature for teammates and customers.

Productizing agents exposes the runtime gap

When the workflow leaves the laptop, model intelligence is not the missing piece. Runtime is.

A production integration needs:

These are not model capabilities. They are runtime and product responsibilities. If every team rebuilds them, an agent feature becomes an agent platform project.

The unit of work is a task

We should not call this a new unit of compute. One agent task may contain many model calls, tool calls, retries, and files. It is a unit of work.

Your product hands a task to a purpose-built cloud agent. A managed runtime executes it in a configured sandbox, while your product remains the user interface.

This is serverless as a consumption model: you invoke the agent without operating its execution infrastructure. It does not mean the task is a short-lived function.

A managed agent runtime, exposed as an API

That is the abstraction Mosoo provides. Publish an Agent, call it from your backend, and Mosoo handles execution, Threads, and files.

Create a Thread with an initial message. Follow its run status through the Thread, observe progress through Events, and exchange attachments and recorded artifacts through Files.

curl -X POST "https://try.mosoo.ai/api/v1/agents/$AGENT_ID/threads" \
  -H "Authorization: Bearer $MOSOO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "type": "user.message",
      "content": [
        { "type": "text", "text": "Analyze the commits from last week." }
      ]
    }
  }'

Poll GET /threads/{threadId}/events, or use /events/stream for Server-Sent Events. Your product can show progress, tool activity, results, and downloadable artifacts in its own interface.

API tokens are backend secrets. Your app remains responsible for end-user authentication, authorization, and mapping its users to Mosoo Threads.

From local prototype to product

Every published Agent includes a copyable Instruction for LLM. It gives a coding agent the generated identifiers, endpoints, environment variables, and integration contract for that Agent.

Mosoo console showing a published agent with the "Instruction for LLM" menu item

Publish an Agent, copy its Instruction for LLM, and give your coding agent the exact contract it needs to integrate with Mosoo.

Paste the instruction into Claude Code or Codex and let it wire the API into your backend. You still review authentication, data access, and the user experience like any production integration.

Local agents proved the value of giving models a real runtime. The next step is not a larger model call. It is a managed agent task that your product can start, observe, and continue through an API.

Try it at try.mosoo.ai, or read the code on GitHub: langgenius/mosoo.


← More posts Learn More →