What problem does it solve? Managing conversation history, tool-call loops, and session persistence manually in AI applications is error-prone and repetitive. This Skill provides expert guidance for using the Effect v4 Chat module, which automatically accumulates history, serializes generations, and handles export/restore of chat state. ## Core Features & Use Cases - Stateful Conversations: Create chat sessions with system prompts, generate text or structured objects, and let the module manage history via an internal Ref<Prompt.Prompt>. - Agentic Tool Loops: Integrate Toolkit definitions so the model can call tools, handle approval requests, and loop until a final answer is produced. - Persistence & Streaming: Export sessions to JSON and restore them later, use Chat.Persistence for automatic saving, and stream responses with streamText. - Use Case: Build a support assistant service that keeps a conversation alive across turns, calls internal tools to look up order data, and persists the session to a database so users can resume later. ## Quick Start Ask the AI to create an Effect service that uses Chat.fromPrompt with a system prompt and generateText to answer user messages across multiple turns.