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

# Conversations

> Multi-turn conversations with automatic context tracking

Vrin supports multi-turn conversations where each query has access to the full conversation history. The client tracks session state automatically.

## Start a conversation

```python theme={null}
client.start_conversation()
```

Resets the current session. Returns `self` for chaining:

```python theme={null}
result = client.start_conversation().continue_conversation("What is ACME's revenue?")
```

## Continue a conversation

```python theme={null}
r1 = client.continue_conversation("What was ACME's Q4 revenue?")
r2 = client.continue_conversation("How does that compare to Q3?")
r3 = client.continue_conversation("What drove the difference?")
```

`continue_conversation()` is syntactic sugar for `query()` with `maintain_context=True`. All `query()` parameters are accepted as keyword arguments:

```python theme={null}
r = client.continue_conversation(
    "Explain the revenue trend",
    response_mode="thinking",
    stream=True,
)
```

### Parameters

<ParamField body="query" type="string" required>
  Natural-language question with automatic conversation context.
</ParamField>

All additional keyword arguments are forwarded to [`query()`](/sdk/querying).

## End a conversation

```python theme={null}
client.end_conversation()
```

Archives the current session ID to `conversation_history_ids` and clears the active session. Returns `self` for chaining.

## Resume a previous conversation

```python theme={null}
client.resume_conversation("sess_abc123")
```

Sets the active session to an existing conversation ID. Subsequent `continue_conversation()` calls will include that conversation's history.

### Parameters

<ParamField body="conversation_id" type="string" required>
  The session ID of a previous conversation to resume.
</ParamField>

## List conversations

```python theme={null}
conversations = client.list_conversations(limit=20)
for conv in conversations:
    print(f"{conv['session_id']}: {conv.get('title', 'Untitled')}")
```

### Parameters

<ParamField body="limit" type="int" default="50">
  Maximum number of conversations to return.
</ParamField>

## Get conversation history

```python theme={null}
history = client.get_conversation("sess_abc123")
# Returns full message history for the conversation
```

## Delete a conversation

```python theme={null}
success = client.delete_conversation("sess_abc123")
# Returns True on success, False on failure
```

Performs a soft-delete. If the deleted conversation is the current active session, the session is cleared.

## Rename a conversation

```python theme={null}
success = client.rename_conversation("sess_abc123", "Revenue Analysis")
# Returns True on success, False on failure
```

## Full example

```python theme={null}
from vrin import VRINClient

with VRINClient(api_key="vrin_live_abc123def456ghi789jkl012mno345pq") as client:
    # First conversation
    client.start_conversation()
    r1 = client.continue_conversation("What is ACME's Q4 revenue?")
    r2 = client.continue_conversation("Who is the CEO?")
    client.end_conversation()

    # Second conversation
    client.start_conversation()
    r3 = client.continue_conversation("Compare Widget Corp and ACME")
    client.end_conversation()

    # Review past conversations
    for conv_id in client.conversation_history_ids:
        history = client.get_conversation(conv_id)
        print(history)
```
