---
title: "Chat"
description: "Provider-neutral conversations and model/tool loops."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cortavyn.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat

`cortavyn-chat` provides a reusable `ChatAgent` over a provider-neutral `ChatModel`. Each turn appends the user message, invokes the model, executes requested tools concurrently, appends tool results, and repeats until the assistant returns no tool calls.

The agent owns the loop; provider adapters only map Cortavyn messages to provider protocols. This separation keeps tools, application context, and persistence under application control.

## Core types

| Type | Responsibility |
| --- | --- |
| `Conversation` | Immutable provider-neutral history |
| `ChatAgent` | Model/tool orchestration loop |
| `ChatTool` | Tool definition and executor pairing |
| `ToolRuntime` | Run-scoped context, store, and progress writer |

Continue with the [Chat quickstart](/chat/quickstart).

Source: https://docs.cortavyn.org/chat/overview/index.mdx
