# Mindset 4 docs: full text > An agent framework with optimization at its core. Every page of https://docs4.mindset.ai, one block per page. --- Title: Mindset 4 docs: An agent framework with optimization at its core URL: https://docs4.mindset.ai/ Description: Docs, demos, skills and the platform deck for Mindset 4: an agent framework with optimization at its core. # Mindset 4 docs > An agent framework with optimization at its core. Docs, demos, skills and the platform deck for Mindset 4: an agent framework with optimization at its core. ## Sections - [Docs](https://docs4.mindset.ai/docs/overview): how to build on Mindset 4, from overview to MCP. - [Demos](https://docs4.mindset.ai/demos): working agents with their source and a write-up of how each is built. - [Skills](https://docs4.mindset.ai/skills): SKILL.md files that teach your coding agent to work with Mindset 4. - [Deck](https://docs4.mindset.ai/deck/platform/title): The Mindset 4 sales deck: an agent framework with optimization at its core. - [llms.txt](https://docs4.mindset.ai/llms.txt): every page as markdown, one line each. --- Title: Overview URL: https://docs4.mindset.ai/docs/overview Description: What Mindset 4 is, who it is for, and how to build on it. # Overview > What Mindset 4 is, who it is for, and how to build on it. Mindset 4 is an agent framework with optimization at its core. You build agents in configuration, then measure, test and improve them on cost, outcome and security. > Placeholder page. The real content arrives with the docs content Spec. ## Who it is for Teams running more than one or two agents, where the people closest to customers need to change them and someone needs to know whether each change helped. ## Where to go next - [Embed an agent](https://docs4.mindset.ai/docs/embed) to put an agent in your web app. - [For coding agents](https://docs4.mindset.ai/docs/for-coding-agents) if you are an agent reading this. --- Title: Embed an agent URL: https://docs4.mindset.ai/docs/embed Description: Put an agent in your web app with one script and one tag. # Embed an agent > Put an agent in your web app with one script and one tag. Add the Mindset script, create a session on your server, and place the `` element where the agent should appear. > Placeholder page. The real content arrives with the docs content Spec. ## 1. Create a session on your server ```ts const session = await mindset.sessions.create({ agentId: 'support', userId: user.id }) ``` ## 2. Add the element ```html ``` | Attribute | What it does | |---|---| | `session` | The token from step 1 | | `conversation-list` | Lets users reopen earlier conversations | --- Title: For coding agents URL: https://docs4.mindset.ai/docs/for-coding-agents Description: llms.txt, Markdown pages, skills and the docs MCP. # For coding agents > llms.txt, Markdown pages, skills and the docs MCP. Every page on this site is available as Markdown. Add `.md` to any page URL, for example [/docs/embed.md](https://docs4.mindset.ai/docs/embed.md). > Placeholder page. The real content arrives with the docs content Spec. - [`/llms.txt`](https://docs4.mindset.ai/llms.txt) lists every page with a one-line summary. - [`/llms-full.txt`](https://docs4.mindset.ai/llms-full.txt) has the full text of every page. - [`/.well-known/agent-skills/index.json`](https://docs4.mindset.ai/.well-known/agent-skills/index.json) lists published skills. --- Title: Demos URL: https://docs4.mindset.ai/demos Description: Working Mindset 4 agents you can try, read the source of, and see explained. # Demos > Working Mindset 4 agents you can try, read the source of, and see explained. - [Help widget](https://docs4.mindset.ai/demos/widget): The classic support bubble, with conversations that pick up where the customer left off. - [Store assistant](https://docs4.mindset.ai/demos/store): The assistant filters products, points at the right one and adds it to the basket. --- Title: Help widget demo URL: https://docs4.mindset.ai/demos/widget Description: The classic support bubble, with conversations that pick up where the customer left off. # Help widget demo > The classic support bubble, with conversations that pick up where the customer left off. Pattern: Floating widget. Brand: Ledgerly. Tags: embed, resume, conversation list. ## What it shows - One script and one tag, with the session created on your server - The `conversation-list` attribute, so customers can reopen earlier conversations - Resuming with `conversationId` and the `mindset:conversation` event ## Files - `widget/index.html` - `widget/server/session.ts` ## More - [Source](https://docs4.mindset.ai/demos/widget/source) - [How it works](https://docs4.mindset.ai/demos/widget/how) - [Embed an agent](https://docs4.mindset.ai/docs/embed) --- Title: Help widget demo: source URL: https://docs4.mindset.ai/demos/widget/source Description: The source files of the Help widget demo. # Help widget demo: source > The source files of the Help widget demo. The files live in the [mindset-demos](https://github.com/mindset-ai/mindset-demos) repository. - [`widget/index.html`](https://github.com/mindset-ai/mindset-demos/tree/main/widget/index.html) - [`widget/server/session.ts`](https://github.com/mindset-ai/mindset-demos/tree/main/widget/server/session.ts) --- Title: How the Help widget demo works URL: https://docs4.mindset.ai/demos/widget/how Description: How the Help widget demo is built, step by step. # How the Help widget demo works The page loads the agent script and renders `` with a session token that your server created. Because the session belongs to a known user, the element can list earlier conversations and resume one by id. > Placeholder write-up. The real demo arrives with the Demos Spec. --- Title: Store assistant demo URL: https://docs4.mindset.ai/demos/store Description: The assistant filters products, points at the right one and adds it to the basket. # Store assistant demo > The assistant filters products, points at the right one and adds it to the basket. Pattern: Side panel. Brand: Northwind Outdoor. Tags: page tools, situational awareness, React. ## What it shows - Page tools that filter the grid and change the basket - Validating the model's arguments inside each handler - `setSituationalAwareness` sending the basket and filters on every turn ## Files - `store/tools.ts` - `store/Assistant.tsx` ## More - [Source](https://docs4.mindset.ai/demos/store/source) - [How it works](https://docs4.mindset.ai/demos/store/how) - [Embed an agent](https://docs4.mindset.ai/docs/embed) --- Title: Store assistant demo: source URL: https://docs4.mindset.ai/demos/store/source Description: The source files of the Store assistant demo. # Store assistant demo: source > The source files of the Store assistant demo. The files live in the [mindset-demos](https://github.com/mindset-ai/mindset-demos) repository. - [`store/tools.ts`](https://github.com/mindset-ai/mindset-demos/tree/main/store/tools.ts) - [`store/Assistant.tsx`](https://github.com/mindset-ai/mindset-demos/tree/main/store/Assistant.tsx) --- Title: How the Store assistant demo works URL: https://docs4.mindset.ai/demos/store/how Description: How the Store assistant demo is built, step by step. # How the Store assistant demo works The storefront registers page tools for filtering and the basket. Each handler validates the model's arguments before it touches the page, and situational awareness sends the current basket and filters with every turn. > Placeholder write-up. The real demo arrives with the Demos Spec. --- Title: Skills URL: https://docs4.mindset.ai/skills Description: Build a SKILL.md that teaches your coding agent to work with Mindset 4, or install a published one. # Skills > Build a SKILL.md that teaches your coding agent to work with Mindset 4, or install a published one. ## Published skills - [Embed an agent](https://docs4.mindset.ai/skills/mindset-embed): Session handshake, the element and page tools, for any web stack. --- Title: Embed an agent skill URL: https://docs4.mindset.ai/skills/mindset-embed Description: Session handshake, the element and page tools, for any web stack. # Embed an agent > Session handshake, the element and page tools, for any web stack. The SKILL.md, verbatim: ```markdown --- name: mindset-embed description: Embed a Mindset agent in a web app - session handshake, the mindset-agent element and page tools. --- # Embed a Mindset agent 1. Create a session on the server with the Mindset SDK. 2. Load the agent script and render ``. 3. Register page tools for anything the agent should do in the app. Read more: https://docs4.mindset.ai/docs/embed.md ``` --- Title: An agent framework with optimization at its core · Mindset 4 platform URL: https://docs4.mindset.ai/deck/platform/title Description: Build agents in configuration. Then measure, test and improve them on cost, outcome and security. # An agent framework with *optimization at its core.* Slide 1 of 2 · Mindset 4 platform Build agents in configuration. Then measure, test and improve them on cost, outcome and security. ## Speaker notes One sentence to remember: an agent framework with optimization at its core. Everything after this slide either proves it or tells you whether you need it. --- Title: Stop paying a language model to do sorting · Mindset 4 platform URL: https://docs4.mindset.ai/deck/platform/cost Description: - classify_ticket as an LLM step: $412 a month - The same step as a pure function: $38 a month # Stop paying a language model *to do sorting.* Slide 2 of 2 · Mindset 4 platform - `classify_ticket` as an LLM step: **$412** a month - The same step as a pure function: **$38** a month ## Speaker notes Open the cost demo. Point out it is all done from Claude Code over the Admin MCP, which is agent parity in action. --- Title: Where does it run? · Mindset 4 platform URL: https://docs4.mindset.ai/deck/platform/objection-hosting Description: On our cloud, or in yours. The same release runs in both. # Where does it run? Appendix A1 · Mindset 4 platform On our cloud, or in yours. The same release runs in both. ## Speaker notes Only show this if hosting comes up.