# aparté > aparté is a framework-agnostic AI-chat library: vanilla web components with zero third-party dependencies (@aparte/core, whose only dependency is @aparte/engine, the agent loop), plus thin React, Vue, Svelte and Angular wrappers. It is backend-agnostic — a transport sends requests either browser-direct (bring your own key, or a local model) or to your own endpoint, where the key stays server-side. It connects to any OpenAI-compatible endpoint or an AG-UI agent, runs tools with a person's approval, and draws tool results as interactive cards (generative UI: weather, products, places, orders) with @aparte/plugin-cards. Providers and plugins are opt-in packages. How it compares to assistant-ui, AI Elements, deep-chat and Loquix: /compare/. Three families, three places. **Components** are custom elements (``, ``, ``…) under /components/. **Segments** are the data a message bubble renders (text, thinking, code, tool_call, error, custom) under /segments/ — an artifact is a plugin's segment (/components/artifact/). **The UI kit** is plain CSS classes on plain elements (`aparte-btn`, `aparte-field`, `aparte-alert`, `aparte-tag`, `aparte-menu`, tabs, switches, avatars) for the controls a host puts around the chat, listed with their HTML at /kit/ (one page per family, live) and /reference/classes/ (every class) — they exist, they are themed by the same variables as the chat, do not rewrite your own. Asking the user something mid-run is built in: a tool marked `needsApproval` pauses for a human decision (guide: /guides/tools/#require-approval-human-in-the-loop), `requestUserInput()` asks a typed question or a yes/no decision (`kind: 'approval'`) through a panel in the composer (/guides/elicitation/), and `@aparte/plugin-ask-user` gives the model a ready-made `ask_user` tool (/components/question/, with `systemPrompt: false` to send no system message). Approval MODES — plan / ask / auto-edit / auto, from a read/write/exec classification of your tool names, with an `` switch for the composer toolbar — are `@aparte/plugin-approval` (/components/approval-mode/), built on core's per-call `setApprovalPolicy()`. A reply draws more than Markdown: maths through `@aparte/plugin-katex` (/guides/math/) and Mermaid diagrams through `@aparte/plugin-mermaid` (/guides/diagrams/), both while they stream, under any Markdown provider; and the sources it cites, as a chip after each cited passage, a card and a list (/guides/citations/), from a provider's `sources` stream event or two fields on a text segment. Charts come from `@aparte/plugin-echarts` or `@aparte/plugin-chartjs` (/guides/charts/), from a fenced block or a tool's result. A tool's result can be drawn as a rich card with `@aparte/plugin-cards` (/guides/cards/): weather, items, products, places, key figures, orders, market quotes, an agent's plan, matches, media and link previews, one entry per card, each reading the tool's own fields through `map`. `onChange` makes a card answer its own controls (the stock card's range buttons), redrawn in place; `defineCard` builds a card of your own. Running the agent loop on your own server, next to your tools, is built in: `createAparteAgentHandler` on the server and `createAgentStreamRunner` in the page, with tool approvals that cross the network and survive a reload, and browser tools that still run in the page (/guides/server-loop/). An agent served over AG-UI (Agno, LangGraph, Mastra, CrewAI, Pydantic AI) or a TanStack AI chat route plugs in as `createAgUiRunner` from `@aparte/runner-ag-ui` (/providers/agent/ag-ui/, /providers/agent/tanstack-ai/). An n8n chat workflow (a Chat Trigger and its AI Agent) plugs in as `createN8nRunner` from `@aparte/runner-n8n` (/providers/agent/n8n/), inside any aparté chat or ``. Driving a loop you own instead (a backend that streams over its own SSE, another agent framework): the display-only API — `appendMessage`, `addSegment`, `appendToSegment`, `updateSegment`, then `updateMessage(id, { status: 'completed' })` to finish the turn — is documented at /guides/bring-your-own-loop/. Plain `content` and `segments` are mutually exclusive on a message. ## Documentation Sets - [Abridged documentation](https://apartejs.dev/llms-small.txt): a compact version of the documentation for aparté, with non-essential content removed - [Complete documentation](https://apartejs.dev/llms-full.txt): the full documentation for aparté - [Getting started, frameworks and guides](https://apartejs.dev/_llms-txt/getting-started-frameworks-and-guides.txt): Install, first render in vanilla or a framework, and every guide (theming, tools, persistence, branching, localisation, accessibility, troubleshooting). - [Tools, approval and asking the user](https://apartejs.dev/_llms-txt/tools-approval-and-asking-the-user.txt): Registering tools, the tool-call row, human-in-the-loop approval, typed questions to the user (elicitation), and the ask-user plugin. - [Run the agent loop on your server](https://apartejs.dev/_llms-txt/run-the-agent-loop-on-your-server.txt): createAparteAgentHandler on the server and createAgentStreamRunner in the page: tools run next to your server, approvals cross the network and survive a reload, browser tools still run in the page. - [Bring your own loop (display-only)](https://apartejs.dev/_llms-txt/bring-your-own-loop-display-only.txt): Driving the transcript from a loop you own: appendMessage, segments, token streams, finishing a turn, the wrappers' imperative API, the backend transport. - [Theming and the UI kit](https://apartejs.dev/_llms-txt/theming-and-the-ui-kit.txt): CSS variables, dark mode, the customization hooks, and the kit of plain classes (buttons, fields, alerts, tags, menus, tabs) with their HTML. - [Providers and transports](https://apartejs.dev/_llms-txt/providers-and-transports.txt): OpenAI-compatible endpoints, the AI SDK bridge, a model in the browser, the scripted scenario provider, local models, writing your own provider. - [Reference: components, segments, events, config](https://apartejs.dev/_llms-txt/reference-components-segments-events-config.txt): Every custom element with its attributes, events and CSS properties; every segment shape; the event map; the config object; the icons. ## Notes - The complete documentation includes all content from the official documentation - The content is automatically generated from the same source as the official documentation ## Optional - [Source and issues](https://github.com/apartejs/aparte): The monorepo — open an issue here. - [npm](https://www.npmjs.com/package/@aparte/core): Every @aparte/* package ships at one version.