---
title: "Introduction"
description: "Build and operate an AI agent in your React or Next.js product with knowledge, memory, actions, conversations, files, and a complete integration surface."
---

Mordn is a complete agent system for software products. Configure the agent in
one place, then add it to your React or Next.js product with one server handler
and one component. The system provides streaming, conversation history,
knowledge, memory, private attachments, actions, and operations without making
your team assemble each layer separately.

`@mordn/chat-widget` is the integration surface. Identity and policy remain on
your server, while hosted or self-managed contracts let you choose where the
rest of the system runs.

> **Identity is established on your server**
>
> The browser never tells the server who it is. Implement `getChatUserId(request)`
> from a verified session; the handler must not trust any client-supplied id. The
> store and storage factories are then bound to that server-derived identity.

## Minimum integration decisions

**Identity**

Resolve the user from a verified server session.

**Model**

Provide a Vercel AI SDK model in code or through hosted configuration.

**Persistence**

Provide a Drizzle, hosted, or custom `ChatStoreFactory`.

Tools and attachment storage are optional. Omitting storage disables uploads.

## Request flow

```text
Browser ChatWidget
  → createChatHandler
    → getUserId(request)
    → ChatStoreFactory(verifiedUserId)
    → optional StorageAdapterFactory(verifiedUserId)
    → model + optional tools/retrieval/memory
```

`createChatHandler` returns `GET`, `POST`, `DELETE`, and `OPTIONS`. Export
`OPTIONS` when using its cross-origin CORS support.

## Start here

**[Quickstart](/docs/quickstart)**

Create, connect, and run your first Mordn agent.

**[MCP server](https://mordn.com/mcp-server)**

Let your coding agent create, configure, publish, and install Mordn for you.

**[Security model](/docs/security)**

Understand the identity boundary.

**[Choosing a backend](/docs/backends/overview)**

Select persistence and storage.

**[API reference](/docs/api/create-chat-handler)**

Review every server option.
