> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memorylake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How It Works

> A transparent gateway that intercepts, recalls, forwards, and remembers — scoped by Boundaries

## A Transparent Gateway

Memory Router sits between your application and the model provider. Your app talks to the Router exactly as it would talk to the provider — same payload, same SDK, same response shape — and the Router adds a memory layer transparently on the way through.

Because the Router speaks your provider's protocol, integrating it is a **base-URL change plus a `boundary_id` query parameter**. Nothing else in your code needs to move.

## The Four Steps

<Steps>
  <Step title="Intercept">
    Your app sends the request to Memory Router instead of the provider — same payload, same SDK, same response shape. The `boundary_id` on the URL tells the Router which memory scope this conversation belongs to.
  </Step>

  <Step title="Recall">
    The Router searches prior memories within the Boundary's scope and injects only the relevant context into the prompt.
  </Step>

  <Step title="Forward">
    The enhanced request goes to the model — your own provider (BYOK) or a MemoryLake-hosted model.
  </Step>

  <Step title="Remember">
    New memories are extracted and stored asynchronously in the background — the response is never delayed.
  </Step>
</Steps>

## Boundaries Define the Scope

Every memory-enabled request carries a `boundary_id`. A **Boundary** binds the conversation to a workspace, one or more projects, a human actor, and an assistant actor — so the Router knows exactly whose memory to read and where to write new memories.

* One user talking to one assistant? One Boundary.
* The same product serving many users? One Boundary per user (or per user–assistant pair), so memories never leak across users.
* A request **without** `boundary_id` skips the memory layer entirely and passes straight through to the model.

<Info>
  Memory extraction and storage happen **asynchronously**. The model's response is returned as soon as it is ready; writing new memories never adds latency to the call.
</Info>

## Shared Memory Pool

The Router and the [MemoryLake API](/features/memorylake/overview) operate on the same memory pool. Anything stored through the Router is retrievable through the API (and visible in the console), and vice versa — one source of truth across sessions, apps, and models.

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/features/memory-router/quickstart">
    Go live in three steps.
  </Card>

  <Card title="Deployment Modes" icon="key" href="/features/memory-router/deployment-modes">
    BYOK vs. MemoryLake-hosted, endpoints, and supported providers.
  </Card>
</CardGroup>
