MDAN MDAN Docs
Site

Agent App Demo

This page shows how an agent actually moves through an MDAN agent app, starting from the small examples and ending with the full agent-tasks demo.

Basic Flow

In MDAN, an agent loop is not “call a JSON API, then rebuild the next step yourself”.

It looks like this:

  1. Read the full page Markdown.
  2. Discover the operations available from the current content.
  3. Execute one of those operations.
  4. Read the returned Markdown fragment.
  5. Continue from the updated context.

That loop works both for simple state updates like guestbook and for auth flows like login, register, and vault.

Example A: Guestbook

Reference: examples/guestbook/app/server.ts

Server behavior:

The key point is that both reads and writes stay inside the block, so the agent works with a smaller and more stable context.

Example B: Auth Session

Reference: examples/auth-session/app/server.ts

This example adds two important patterns:

Typical transitions:

That means the agent does not have to guess where to go next. The returned content already carries the next path.

Example C: Agent Task Handoff

Reference: demo/agent-tasks/app/server.ts

Message walkthrough: demo/agent-tasks/README.md

This demo pushes the same model into a multi-step delegation flow:

The important pattern is the split between:

That lets one agent create a task, another agent continue from the same page URL, and the reviewer return to the same page to close or re-open the loop.

If you want the most complete runnable example in the repository, start here.

Agent-Facing Error Strategy

Avoid opaque errors. Return actionable Markdown fragments that include the next legal operation.

In auth-session, unauthenticated writes to vault return a recoverable fragment that includes a GET "/login" operation.

Verification Checklist