- a real page instead of a chat transcript
- saved data instead of in-memory state
- a scheduled sync or background job
- a way for users to connect GitHub, AWS, or Gmail
- the runtime environment
- a persisted collection
- a sidebar page
- a chat handler
What Capsule is for
Capsule is a good fit when the chat loop is only one part of the product. Typical Capsule apps mix a few layers together:- a chat surface for free-form user input
- structured pages for dashboards, workflows, and review steps
- collections for durable application state
- data handlers for computed or external data
- tasks and schedules for slow, recurring, or asynchronous work
The core model
The framework is easier to learn if you keep a few core objects in mind:cpsl.Appis the root object. It is both your app definition and the thing Capsule deploys.Sessionis the live request or conversation context.- Collections are your persistent documents. They can be shared app-wide or scoped per user, owner, or session.
- Data handlers are just Python functions that return JSON.
- Pages can be declared in Python or written in React.
- Tasks and schedules move slow work out of the request path.
Learn Capsule
If you are new to the framework, follow this order:- Installation to install the SDK and CLI.
- Quickstart to run a minimal app.
- First Chat App to learn the session model.
- Collections And Scopes and Data Handlers And Pages to build real product surfaces.
- Tasks And Schedules when you need background work.
- Reference when you want exact API behavior.
Example apps
The repository also ships a set of examples worth reading once you have the basics down:echofor the smallest chat appplatform_testfor collections, scopes, auth, and custom pagescustom_pagesandnootropicsfor data handlers, DSL pages, React pages, and theme worktest_suitefor tasks, schedules, TaskBoard, and integration promptsinfra_analystfor owner-scoped collections, streaming replies, and pricing