Skip to main content
VRINClient is the single entry point for queries, knowledge management, file uploads, conversations, auth, and health checks.

Constructor

from vrin import VRINClient

client = VRINClient(
    api_key="vrin_your_api_key",
    timeout=120.0,      # default request timeout in seconds
    max_retries=2,      # retries on 5xx / connection errors
)

Parameters

api_key
string
required
Your Vrin API key. Keys starting with vrin_ route to Vrin shared infrastructure. Keys starting with vrin_ent_ route to your enterprise AWS account — use VRINEnterpriseClient for those.
timeout
float
default:"120.0"
Default timeout in seconds for all HTTP requests. Individual methods may override this.
max_retries
int
default:"2"
Number of retries on server errors (5xx) and connection failures. Client errors (401, 429) are never retried. Uses exponential backoff (2^attempt seconds).

Context manager

VRINClient implements the context manager protocol. The underlying HTTP session is closed on exit.
with VRINClient(api_key="vrin_abc123") as client:
    result = client.query("What is ACME's revenue?")
# session closed automatically

Properties

current_session_id
Optional[str]
The active conversation session ID, or None if no conversation is in progress.
conversation_history_ids
List[str]
List of ended conversation session IDs from this client instance.

Auto-detection

If you are not sure whether a key is standard or enterprise, use the factory helper:
from vrin import get_enterprise_client

# Returns VRINEnterpriseClient for vrin_ent_* keys, VRINClient otherwise
client = get_enterprise_client(api_key=my_key)

Methods overview

MethodDescription
query()Query the knowledge base
query_facts()Fast fact retrieval without AI summary
insert()Insert text content
upload_file()Upload a file
upload_bytes()Upload raw bytes
start_conversation()Start a conversation session
continue_conversation()Query with conversation context
specialize()Set AI persona
login()Authenticate (static)
register()Create account (static)
health_check()Check service health

Health check

status = client.health_check()
# {"status": "healthy", "version": "..."}
Returns service health information. Useful for connectivity validation and monitoring.

Retry behavior

The client automatically retries on:
  • HTTP 5xx responses
  • requests.ConnectionError
  • requests.Timeout
It does not retry on:
  • HTTP 401 (AuthenticationError)
  • HTTP 429 (RateLimitError)
  • ValidationError
Backoff is exponential: 1s, 2s, 4s for retries 1, 2, 3.