Introduction
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.
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
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.