Skip to main content

What is Definable?

Definable is a Python framework for building AI-powered applications. It provides a unified interface across multiple LLM providers, a powerful agent runtime with tool execution, a complete RAG pipeline for knowledge retrieval, and first-class MCP (Model Context Protocol) support.

Architecture Overview

Definable is organized into composable layers that work together:

Key Features

  • Multi-provider: Switch between OpenAI, DeepSeek, Moonshot, xAI, or any OpenAI-compatible API with one line.
  • Sync and async: Every API has both synchronous and asynchronous variants.
  • Streaming: Stream responses token-by-token with rich event types for tool calls, reasoning, and content.
  • Structured output: Return Pydantic models directly from LLM calls with JSON Schema validation.
  • Middleware: Compose logging, retry, metrics, and custom middleware around agent execution.
  • Full RAG pipeline: Ingest documents from text, PDF, or URLs; chunk, embed, store, and retrieve with reranking.
  • MCP support: Connect to any MCP server and use its tools, resources, and prompts inside your agents.
  • Testing: Mock models, test agents without API calls, and assert on tool execution.
  • Cost tracking: Automatic token counting and cost calculation across providers.
  • Interfaces: Deploy agents to Telegram, Discord, and Signal with sessions, hooks, identity resolution, and multi-interface serving.
  • Memory: Persistent multi-tier cognitive memory with automatic recall, distillation, and 8 storage backends.
  • File readers: Extract text from PDF, DOCX, XLSX, and audio files attached to agent messages.
  • Type-safe: Built on Pydantic with full type annotations and mypy support.

Next Steps