effect-ai-chat

Build stateful AI chat sessions with Effect TypeScript and LanguageModel.

22|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-ai-chat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-ai-chat
Source: https://github.com/mpsuesser/pi-effect-harness/tree/main/harnesses/effect/skills/effect-ai-chat
Command: npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-ai-chat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you implement reliable stateful AI conversations in TypeScript by managing conversation history, tool-call loops, and structured outputs without hand-rolling prompt plumbing.

Core Features & Use Cases

  • Stateful multi-turn chat: Maintains a conversation history reference and appends user/model messages automatically across turns.
  • Streaming responses: Produces streamed text deltas while keeping session history consistent after completion.
  • Structured object generation: Generates typed results that conform to an Effect Schema, enabling safe downstream processing.
  • Agentic tool-calling loops: Supports iterative tool use by recording tool calls and results in the same chat context.

Quick Start

Create a session with Chat.fromPrompt, then call generateText with a message prompt while providing LanguageModel in context.

Frequently Asked Questions about effect-ai-chat

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build stateful multi-turn AI chat sessions in Effect TypeScript?

Stateful multi-turn AI chat sessions in Effect TypeScript are built by creating a session with Chat.fromPrompt and calling generateText with a message prompt while providing a LanguageModel layer in context to automatically maintain conversation history.

How does streaming chat response work with conversation history in Effect?

Streaming chat responses produce streamed text deltas while keeping session history consistent after completion. The Effect chat session automatically appends user and model messages across turns to maintain the conversation context.

Can I generate structured objects conforming to an Effect Schema from AI chat?

Structured object generation produces typed results that conform to an Effect Schema, enabling safe downstream processing. This schema-guided generation works within the same Effect chat session context used for standard text responses.

Do I need a LanguageModel layer to use agentic tool-calling loops in Effect?

Agentic tool-calling loops require a LanguageModel layer provided in context to support iterative tool use. The Effect chat session records tool calls and results in the same chat context to enable multi-turn reasoning.

What is the best way to persist and restore Effect AI chat session history?

Effect AI chat sessions support export and import persistence APIs to save and restore conversation history. This allows stateful multi-turn chat contexts to be persisted across application restarts without losing the reasoning chain.