# Instrument your app (/docs/memory/automatic-capture/instrument)
Adding `capture` calls to every route takes time, and new routes get missed. `instrument` attaches `Dock` to your web app once, and every write request is captured for you.

<Callout type="info" title="Instrument your app when...">
- Your app's write requests already describe what users do, such as form submissions or settings changes.
- You want memory from day one, before you add hand-written captures.
</Callout>

## Availability [#availability]

| SDK | Frameworks |
| --- | --- |
| Python | FastAPI, Starlette, and other Starlette-based apps |
| TypeScript | Express, and other apps with Express-style `use` middleware |

## Set it up [#set-it-up]

<CodeTabs items={['Python', 'TypeScript']}>
  <Tab value="Python">
    ```python
    from fastapi import FastAPI
    from docklee import Dock

    app = FastAPI()
    dock = Dock()
    dock.instrument(app)
    ```
  </Tab>
  <Tab value="TypeScript">
    ```ts
    import express from 'express';
    import { Dock } from 'docklee';

    const app = express();
    app.use(express.json());

    const dock = new Dock();
    dock.instrument(app);
    ```
  </Tab>
</CodeTabs>

In Express, register your body parser before `instrument`, so request bodies are available to capture.

## What's captured [#whats-captured]

| Captured | Skipped |
| --- | --- |
| `POST`, `PUT`, `PATCH`, and `DELETE` requests with a body | `GET`, `HEAD`, and `OPTIONS` requests |
| Bodies under 10,000 characters | Larger bodies |
| | In Python, the paths `/health`, `/metrics`, `/docs`, `/openapi.json`, and `/favicon.ico` |

Each request becomes an `event` memory with this metadata:

| Key | Value |
| --- | --- |
| `source` | `instrument` |
| `method` | The HTTP method |
| `path` | The request path |

Capturing never blocks or fails a request. If a body can't be read, the request goes through as normal.

<Callout type="warn">
Request bodies can hold passwords, tokens, and personal data. Instrument only apps whose write requests are safe to remember, or capture by hand on routes that handle sensitive fields.
</Callout>

## Per-user memory [#per-user-memory]

Captured requests use the `Dock` instance's settings, including its default end user. In an app that serves many people, call `capture` with an `end_user` on the routes where memory belongs to one person. See [End users](/docs/docklee/end-users).

## Next steps [#next-steps]

Your app's requests are captured. Capture database changes next.

<Cards>
  <Card title="Watch a database" href="/docs/memory/automatic-capture/watch" description="Capture new and changed rows." />
  <Card title="Listen for webhooks" href="/docs/memory/automatic-capture/listen" description="Capture events from the tools you use." />
  <Card title="Metadata" href="/docs/memory/essentials/metadata" description="The keys instrument adds." />
</Cards>
