# Tenchi > Build and verify Python backends with humans and agents, using explicit contracts and plain async functions. Tenchi pairs a small, contract-first application model with inspection, generation, and verification for humans and agents. The full extracted documentation is available at https://tenchi.io/llms-full.txt. ## Start - [Tenchi](https://tenchi.io): Build and verify Python backends with humans and agents, using explicit contracts and plain async functions. - [Build your first Tenchi app](https://tenchi.io/getting-started): Create a Tenchi application, call its API, follow one request through the code, and change its behavior. - [Build a feature end to end](https://tenchi.io/build-a-feature): Carry one persisted operation through its contract, port, adapters, use case, route, tests, and OpenAPI snapshot. - [Secure the todos API](https://tenchi.io/secure-todos): Add bearer authentication and owner-scoped persistence to the todos tutorial, then test cross-user isolation. - [How Tenchi works](https://tenchi.io/concepts): Understand the small application model shared by HTTP, workers, tools, tests, and agent workflows. - [Add Tenchi to an existing project](https://tenchi.io/existing-project): Add Tenchi without the application generator and build the first complete contract, use case, ASGI application, test, and OpenAPI baseline. ## Core - [Structure your application](https://tenchi.io/architecture): Place features, use cases, policies, ports, infrastructure, and server composition where their dependencies remain explicit. - [Declare an HTTP contract](https://tenchi.io/contracts): Declare methods, paths, validated inputs, responses, headers, errors, media types, examples, and runtime limits. - [Write use cases and ports](https://tenchi.io/application): Keep behavior in plain async functions and infrastructure behind application-owned typing.Protocol ports. - [Bind routes and compose the server](https://tenchi.io/server): Bind contracts to use cases and create an ASGI application with explicit context, lifecycle, hook, and adapter wiring. - [Model successful responses](https://tenchi.io/responses): Model fixed and status-dependent success bodies, typed headers, media types, and controlled Starlette passthrough responses. - [Expose honest application errors](https://tenchi.io/errors): Declare stable application errors and keep server, OpenAPI, and typed-client error behavior aligned. - [Authenticate and authorize requests](https://tenchi.io/authentication): Authenticate at the HTTP boundary, authorize in use cases, and keep policies pure and reusable from every entrypoint. - [Test at the right boundary](https://tenchi.io/testing): Test use cases directly and exercise complete applications through lifespan-aware typed and raw in-process clients. - [Call contracts with the typed client](https://tenchi.io/client): Call Tenchi contracts through async httpx with validated inputs, responses, errors, retries, and payload-safe outcomes. ## Develop - [Let an agent change your backend](https://tenchi.io/agents): Inspect, preview, implement, check, and review backend changes with the same workflow for people and agents. - [Connect an agent over MCP](https://tenchi.io/mcp): Connect an MCP-aware agent to Tenchi's application map, generation previews, compatibility reports, and checks. - [Verify a generated change](https://tenchi.io/change-plans): Record the intended structure of a generated use case, then verify its wiring and planned-test execution against one Git baseline. - [Review API compatibility](https://tenchi.io/openapi): Generate OpenAPI 3.1, store canonical snapshots, and classify contract changes against a historical baseline. ## Operate - [Prepare the application for production](https://tenchi.io/production): Turn Tenchi's application model into concrete decisions for configuration, transactions, retries, workers, telemetry, and deployment. - [Load configuration and secrets](https://tenchi.io/configuration): Validate process configuration at startup, keep secrets out of application behavior, and wire settings at the composition root. - [Own database transactions](https://tenchi.io/database): Own pools with lifespan, create one unit of work per request, run migrations safely, and prevent lost updates. - [Make operations retry-safe](https://tenchi.io/idempotency): Reserve scoped keys, fingerprint validated input, and replay typed results without coupling application behavior to storage. - [Limit application operations](https://tenchi.io/rate-limits): Apply authenticated fixed-window quotas with atomic shared storage and deterministic memory-backed tests. - [Receive signed webhooks](https://tenchi.io/webhooks): Verify exact request bytes before parsing, attach service identity, and make provider redeliveries idempotent. - [Design for retries and partial failure](https://tenchi.io/reliability): Make commands safe to retry, commit deferred work through a transactional outbox, and classify worker failures. - [Run use cases outside HTTP](https://tenchi.io/execution): Run application behavior from workers and scripts with the same request validation and context-scoping guarantees. - [Dispatch validated background jobs](https://tenchi.io/jobs): Declare durable job messages, validate producers and consumers, and dispatch through queue-neutral handlers. - [Run validated operational tasks](https://tenchi.io/tasks): Declare, discover, and safely run backfills, repairs, replays, and maintenance commands. - [Observe behavior without exposing payloads](https://tenchi.io/observability): Export stable outcomes through OpenTelemetry, instrument non-HTTP work, and keep durable audit records separate. - [Verify a deployment environment](https://tenchi.io/preflight): Run read-only, timeout-bounded checks against the environment a release is about to use. - [Deploy the ASGI application](https://tenchi.io/deployment): Configure the production process, lifecycle resources, middleware, health checks, and release gates. ## AI capabilities - [Add AI capabilities](https://tenchi.io/ai): Adopt application tools, model-provider ports, MCP endpoints, and evaluation gates when your backend needs AI behavior. - [Expose use cases as AI tools](https://tenchi.io/tools): Give existing use cases stable names, typed inputs and outputs, declared errors, and safety metadata for machine callers. - [Serve application tools over MCP](https://tenchi.io/tool-mcp): Publish authenticated tools with caller-specific discovery, explicit destructive-call approval, and structured results. - [Gate AI behavior with evaluations](https://tenchi.io/evaluations): Set typed cases, metric thresholds, execution limits, and token or cost budgets for application-owned AI behavior. - [Study the cited AI reference backend](https://tenchi.io/fieldnotes): Run and adapt a cited research backend with background indexing, authenticated application tools, evidence, and evaluation gates. ## Reference - [CLI reference](https://tenchi.io/cli): Look up commands for scaffolding, generation, inspection, compatibility, operational entrypoints, and verification. - [Python module reference](https://tenchi.io/reference): Map Tenchi's supported modules to the declarations, protocols, exceptions, and runtime helpers each one owns. - [Upgrade Tenchi safely](https://tenchi.io/stability): Understand Tenchi's pre-1.0 compatibility expectations, versioned surfaces, and upgrade workflow. - [Choose the right framework](https://tenchi.io/comparisons): Compare Tenchi with FastAPI, Starlette, Litestar, and Django Ninja, including when another framework is the better choice. ## Optional - [llms-full.txt](https://tenchi.io/llms-full.txt): Full text of every documentation page. - [GitHub](https://github.com/taylorbryant/tenchi): Source code, changelog, examples, and issue tracker.