Functor SDK Overview
Functor SDK is the official Python SDK for Functor system. It provides a clean, type-safe, and intuitive interface for all API operations with both synchronous and asynchronous support. The SDK interfaces with the MainOrchestrator-based architecture through REST API endpoints, including enhanced smart query, enhanced SQL processing, and enhanced re-ranking capabilities.
Key Features
- Clean API Design - Namespaced organization for intuitive usage
- Type Safety - Full Pydantic model validation
- Dual Interface - Both async and sync methods available
- Error Handling - Rich exception hierarchy with detailed information
- Automatic Retry - Built-in exponential backoff for resilience
- Context Managers - Proper resource management
- Environment Config - Auto-detect credentials from environment
Installation
Install the SDK using pip or uv:
Quick Start
Get started with a simple query in just a few lines:
Namespaces
The SDK is organized into logical namespaces for different operations:
Queries
Execute natural language queries with automatic routing
client.queries.execute()Ingestion
Upload and process data with unified ingestion, quality checks, and domain detection
client.ingestion.ingest_unified()Knowledge Graphs
Full CRUD operations for entities, relations, chunks, and bulk operations
client.knowledge_graphs.create_entity()Sources
Complete CRUD operations for data sources
client.sources.list_for_kg()Visualizations
Access visualization endpoints
client.visualizations.list()Health
System health and monitoring
client.health.check()Async vs Sync
Every method is available in both async and sync versions:
Authentication
The SDK supports multiple authentication methods:
Error Handling
The SDK provides detailed exception types for precise error handling:
Next Steps
- Installation Guide - Detailed setup instructions
- Quick Start - First query in 5 minutes
- Client Reference - FunctorClient configuration
- Queries Namespace - Execute queries