Skip to main content
The Definitive Mental Model & Architecture Guide

What is an AI Agent?

A chatbot answers questions in a single turn. An AI agent does real-world work in an autonomous loop.

The Agent Equation
Model+Instructions+Memory+Tools=Autonomous Agent
Core PhilosophyPractical
An Agent is a Directory

Markdown for instructions & skills, files for memory, TypeScript/MCP for tools.

Tools are the Bottleneck

An agent without tools is an advisor. An agent with verified tools is an executor.

The Fundamental Difference

Chatbot vs. AI Agent: How They Actually Differ

Standard Chatbot (Single-Turn)

Prompt Ind → Tekst Ud

A user asks a question, the model responds with text generated from static training weights, and the interaction ends.

AI Agent Runtime (Multi-Step)

Mål Ind → Autonom Handlingsløkke

You give the agent a high-level goal. It plans steps, selects tools, queries live databases, parses results, and iterates until done.

The File-System Architecture

An Agent is a Directory

~/my-agent/
markdown
Agent Project Structure
Click any file above to explore how modern agents maintain memory, instructions, and tools in plain files.
01. Instructions

The agent’s identity, operating constraints, and boundary conditions written in plain Markdown.

# Identity & Mission
You are an autonomous Operations Agent for an Acme logistics hub.

## Rules & Constraints
1. Always validate company registration IDs via the Acme Registry API before creating records.
2. Read MEMORY.md before beginning any multi-step action.
3. If an action involves a bank transfer or step-up signature, pause and request human approval.
4. Keep all invoice summaries with correct tax totals.

Web Standards & In-Browser Tools

From Fragile DOM Actuation to WebMCP

When an agent interacts with a web application lacking a backend API, developers have historically relied on browser actuation: streaming DOM snapshots, calculating coordinate clicks, and guessing form fields via heuristics. It is slow, token-intensive, and breaks with any UI redesign. WebMCP (a proposed W3C standard spearheaded by Chrome) inverts this model: the web page explicitly declares structured tools directly to the browser agent runtime.

Server & Desktopstdio / HTTP

Server MCP (Anthropic)

Connects AI agents (Claude Desktop, Cursor, local runtimes) to databases, local filesystems, and backend APIs via JSON-RPC.

Strength: Direct backend infrastructure access
In-Browser ClientW3C Standard

WebMCP (W3C / Chrome)

Web pages declare typed tools via HTML form attributes or JavaScript (window.modelContext) running directly in the active browser session.

Strength: Zero scraping; runs in user's authenticated session
Headless SimulationPlaywright

DOM Actuation

Headless browsers stream screenshots and simulate mouse clicks and keystrokes on rendered DOM nodes via heuristic CSS selectors.

Limitation: High latency; brittle against CSS changes
WebMCP Implementation Patterns
Chrome 146+ / W3C
1. Declarative HTML Form API
<!-- Annotér eksisterende formularer -->
<form action="/registry/search" method="GET"
      toolname="registry_search"
      tooldescription="Søg i register på firmanavn eller ID">
  <input name="q"
         toolparam="registry_query"
         toolparamdescription="Registrerings-ID eller firmanavn"
         required />
  <button type="submit">Søg</button>
</form>

Zero JavaScript overhead. The browser automatically registers the form as a typed agent tool.

2. Imperative JavaScript API
// Registrér direkte i browserens runtime
if (window.modelContext) {
  window.modelContext.registerTool({
    name: 'geo_lookup',
    description: 'Slå officiel adresse op via geo-API',
    inputSchema: {
      type: 'object',
      properties: { adresse: { type: 'string' } },
      required: ['adresse']
    },
    execute: async ({ adresse }) => {
      const res = await fetch('/api/geo?q=' + encodeURIComponent(adresse))
      return res.json()
    }
  })
}

Executes client-side logic with strict JSON Schema validation under browser Origin Isolation.

Why WebMCP Matters for Protected Portals

Headless automation bots cannot store or bypass login credentials. With WebMCP, the human logs in normally within their own browser. The agent then operates safely inside that active, origin-isolated session using the site's explicitly declared tools—pausing for explicit user confirmation before executing any irreversible transaction.

Common Questions

Frequently Asked Questions

Connect Your AI Agent to Catalog Systems

Acme Directory is the open index of machine interfaces, REST endpoints, and MCP servers.