Backend for AI agents

A backend for AI agents is one Python file: tables, computed columns, and HTTP routes. The agent writes app.py, insert runs the models, you review one diff.

Install: pip install 'pixeltable[serve]'

The wall is the stitch

Cohesivity removes signups. Pixeltable removes the four systems the signup was for.

A coding agent can write the app until the app needs a database, a bucket, a vector index, an orchestrator, and the endpoint that copies between them. Each of those is a product. Cohesivity holds the provider accounts and provisions them over one HTTP API, then you claim the project. That is their page. Pixeltable collapses the stitch: object storage, a vector database, an orchestrator, and the endpoint code that copies between them become one application file. That file is what a coding agent can hold.

What the agent writes

Stored columns are annotations. Computed work is an assignment. HTTP is the same file.

app.py
import pixeltable as pxt
import pixeltable.functions as pxtf
from pixeltable.serving import FastAPIRouter
TableModel = pxt.model_base()
@pxt.udf
def excerpt(text: str, n: int = 12) -> str:
return text if len(text) <= n else f'{text[:n]}...'
class Docs(TableModel, name='docs'):
id = pxt.Column(value=pxtf.uuid.uuid7(), primary_key=True)
title: pxt.String
body: pxt.String | None
title_upper = pxtf.string.upper(title)
summary = excerpt(title)
ingest = FastAPIRouter(name='ingest')
ingest.add_insert_route(
Docs,
path='/docs',
inputs=[Docs.title, Docs.body],
outputs=[Docs.id, Docs.title_upper, Docs.summary],
)
ingest.add_update_route(
Docs,
path='/docs/update',
inputs=[Docs.title],
outputs=[Docs.id, Docs.title_upper],
)

pxt schema update creates the tables. It does not start HTTP. pxt service update starts HTTP. It does not create tables. Write this file, then run the commands below. Do not also run pxt service example, which would replace it.

Local first. Cloud is the same file.

Local needs no account. An agent’s shell has no TTY to confirm in, so each update carries -f.

Local

No Cloud account. No card. The agent writes the file and applies it.

terminal
pip install 'pixeltable[serve]'
pxt init
pxt schema update app.py my_app -f
pxt service update app.py my_app -f

Cloud

Add the database to pixeltable.toml, then apply the same file to it.

pixeltable.toml
[[pixeltable.database]]
name = 'pxt://myorg:main'
terminal
pxt db update pxt://myorg:main -f
pxt schema update app.py pxt://myorg:main -f
pxt service update app.py pxt://myorg:main -f
  • Replace myorg with your organization slug. If pxt init wrote pyproject.toml, use [[tool.pixeltable.database]] there instead.
  • pxt login signs in to an account you have. pxt new makes one hosted database with no account; claim it within 48 hours.
  • Run the database first: a schema applied before it fails with 404: UDF not found.
  • An API key is optional for the CLI and required for hosted HTTP. pxt service run is local only.

What is actually in the file

Cohesivity’s catalog is the right tool when the app is CRUD plus auth plus hosting.

  • Media and computed columns

    summary = excerpt(title)

    Images, video, audio, and documents are columns. A transform is an assignment. Insert runs it.

  • Embedding index

    __indexes__ = [pxt.EmbeddingIndex(title, string_embed=embed)]

    The index is a declaration on the column. You do not add a second vector database to keep in sync.

  • HTTP from the same file

    ingest.add_insert_route(Docs, path='/docs')

    FastAPIRouter declares insert, update, and query routes. pxt service update starts them.

  • Coding-agent install

    npx skills add pixeltable/pixeltable-skill

    Skill, MCP, and per-agent setup for Cursor, Claude Code, Codex, and the rest. The agent writes app.py.

Backend for AI agents, answered

What is a backend for AI agents?
A backend for AI agents is one Python file: tables, computed columns, and HTTP routes. Pixeltable is that file. The agent writes it; insert runs the models; you review one diff. Cohesivity provisions other vendors (Postgres, Redis, auth, hosting) behind one API. Use that when the app is CRUD. Use Pixeltable when the app is media, models, and retrieval.
Can a coding agent build that backend without a dashboard?
Yes, locally. The agent writes app.py, then runs pxt schema update and pxt service update. No Cloud account and no dashboard. You publish the same file later if you want Pixeltable Cloud.
How is this different from Cohesivity?
Cohesivity is one HTTP API that provisions other vendors: Postgres, Redis, object storage, hosting, social login, an inbox, and a browser. A new project is ephemeral for 72 hours, then you claim it. Pixeltable is the multimodal schema: media, models, indexes, and the route in one file. pxt new is a 48-hour claim, and it is one Pixeltable database, not that catalog.
Do I still need Postgres, Redis, and a vector database?
Not as the default for a multimodal app. EmbeddingIndex lives on the column. Keep Postgres, Redis, auth, and a host when the app is CRUD plus a website. That is Cohesivity’s catalog, or the database you already run.
Do I have to sign up before the agent starts?
No for a local file: pip install, pxt init, then pxt schema update and pxt service update on the app.py above. A signed-in organization uses pxt login. pxt new creates one hosted database with no account; claim it within 48 hours. That database is still Pixeltable, not Cohesivity’s catalog. An API key is optional for the CLI and required for hosted HTTP. pxt service run is local only.

Declare the file. Apply it. Insert a row.

Same file locally and on Cloud.