Skip to content

Latest commit

 

History

History
93 lines (69 loc) · 3.84 KB

File metadata and controls

93 lines (69 loc) · 3.84 KB
title Build AI Apps In Python
description Capsule is a framework and hosted runtime for shipping AI apps with chat, pages, state, integrations, tasks, and auth.

Capsule turns one Python app definition into a hosted AI product.

You write the app. Capsule deploys it as a hosted product where each app user gets an isolated, sandboxed runtime. Inside that runtime, your agents can use Python packages, container-local files, mounted filesystems, secrets, integrations, tasks, pages, and chat together.

Build assistants with persistent session history, streaming replies, uploads, integration prompts, and user identity. Add dashboards, tables, settings, task boards, workflow screens, or custom React pages to the same app. Store queryable records in collections, keep lightweight session state, and expose data handlers to pages. Deploy one app definition into sandboxed per-user runtimes with packages, filesystems, tasks, schedules, and secrets.

prod setup

Capsule is a serverless runtime for agent apps. You do not provision containers yourself; Capsule creates the isolated runtime your app needs when users chat, open pages, start workflows, or run scheduled work.

Create an agent app from a template:

capsule create my-app --template quickstart
cd my-app
uv sync

Add any required secrets printed by the template:

capsule secret create ANTHROPIC_API_KEY=sk-ant-...

Deploy the same package entry point:

capsule deploy app.py:app

The deployed app gets a hosted URL, app-scoped sign-in, and the same chat handlers, pages, workflows, tasks, schedules, collections, secrets, and filesystems declared in Python. Each signed-in app user gets their own runtime context, so agents can work with files and long-running state without sharing another user's sandbox.

templates

Start with the product shape closest to what you want to ship.

  • quickstart for a chat app grounded in packaged context files with BAML.
  • media-studio for fal.ai image generation displayed directly in chat.
  • browser-agent for visible browser workflows and agent-assisted browsing.
  • background-agent for scheduled or on-demand agent loops with a results page.

learn by building

Start with the shortest path, then add one product surface at a time.

feature pages

Use these when you know the feature you need.

examples

Capsule includes examples you can copy from in project templates and example apps:

  • quickstart for a BAML-backed assistant with packaged context
  • media-studio for generated media in chat
  • browser-agent for browser workflows
  • background-agent for scheduled agent loops