VectorMethods

Docs / API reference

Chat sessions and agentic search

Build conversational retrieval and agent-search workflows with VideoVector chat sessions, scoped turns, and SSE streaming responses.

src/api/v2/controllers/chat_controller.pysrc/application/dtos/chat_dto.pyfrontend/src/services/api.ts

Search documentation

Search pages, API reference sections, and guide headings.

Summary

Chat sessions provide an agentic retrieval surface on top of search results and prompt-run scope. The API supports session CRUD, turn creation, optional scope narrowing, and streaming turn events over SSE for agent-search experiences.

Chat endpoints

MethodPathPurpose
POST/api/v2/chat/sessionsCreate a session
GET/api/v2/chat/sessionsList sessions
GET/api/v2/chat/sessions/{session_id}Retrieve one session with turns
GET/api/v2/chat/sessions/{session_id}/turnsList turns
POST/api/v2/chat/sessions/{session_id}/turnsCreate a non-streaming turn
POST/api/v2/chat/sessions/{session_id}/turns/streamStream a turn over SSE
DELETE/api/v2/chat/sessions/{session_id}Delete a session

Scope model

Each turn can optionally narrow retrieval scope with:

  • index_ids
  • prompt_run_ids

That scope is stored on the turn as effective_scope.

Example: create a session

curl -X POST /api/v2/chat/sessions \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"title":"Daily review assistant"}'

Example: create a scoped turn

curl -X POST /api/v2/chat/sessions/session_123/turns \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Find scenes where a reporter appears outside a station entrance.",
    "scope": {
      "index_ids": ["idx_archive"],
      "prompt_run_ids": ["run_123"]
    },
    "idempotency_key": "chat-turn-session-123-1"
  }'

Streaming protocol

POST /api/v2/chat/sessions/{session_id}/turns/stream returns text/event-stream.

The DTO layer documents event families such as:

  • turn_started
  • turn_resumed
  • agent_state
  • tool_call_started
  • tool_call_result
  • turn_completed
  • error

Use Idempotency-Key, X-Idempotency-Key, or the request-body idempotency_key when you need resumable turn behavior.

Response structure

Completed turns can include:

  • user_message
  • assistant_message
  • effective_scope
  • tool_trace
  • result_sets
  • stats
  • terminal error details when the turn fails

Related documentation

Concepts

Search in VideoVector is built around segment-level prompt output, indexed media context, and scoped conversational retrieval. This page explains the major search modes and the field-path conventions they rely on.

The search API combines semantic retrieval, exact metadata filtering, cross-run search, playground search, and analyst-style SQL execution on run-backed tables.

This page groups the supported public endpoints that do not fit cleanly into a primary workflow resource page but are still part of the public non-billing API surface.