kind: 'read'Looks something up
Runs as the signed-in user through asUser, so your own row-level rules apply.
A server handler, a React chat panel and Postgres tables. Your users get an assistant that sees the screen they're on, answers from your data as them, and proposes changes as cards they confirm — with undo.
npm install @teovo/server @teovo/react @teovo/db
Not on npm yet — run it from source today.
| # | Customer | Paid | Due |
|---|---|---|---|
| 140 | Asha Rao | ₹1,200 | ₹0 |
| 141 | Riya Sharma | ₹0 | ₹880 |
| 142 | Riya K | ₹200 | ₹250 |
| 143 | Chand Bakers | ₹0 | ₹3,150 |
list_orders readYou define tools with a Zod schema. Teovo decides what the model may call, for whom, and how the result reaches the user.
kind: 'read'Runs as the signed-in user through asUser, so your own row-level rules apply.
kind: 'propose'The user confirms. Teovo checks the record hasn't changed, applies once, and keeps undo for 10 minutes.
kind: 'action'Open a screen or run an app action. Tools a role may not use are never offered.
Mount it under one path in any server that speaks fetch — Node, Cloudflare Workers or Cloud Run.
import { createAssistant, defineTool } from '@teovo/server'
import { postgresStorage } from '@teovo/db'
export const teovo = createAssistant({
identify: async (req) => sessionUser(req), // your sign-in
models: [google('gemini-2.5-flash'), google('gemini-2.5-flash-lite')],
storage: postgresStorage(query),
tools: [
defineTool({
name: 'record_payment', kind: 'propose',
input: z.object({ no: z.number(), amount: z.number() }),
run: ({ no, amount }) => ({ title: `Payment ₹${amount}`, before, after, payload }),
}),
],
cards: { record_payment: { apply, undo, current } }, // runs as the user
})
app.all('/api/assistant/*', (c) => teovo.fetch(c.req.raw))
import { AssistantProvider, AssistantPanel, useAssistantContext } from '@teovo/react'
import '@teovo/react/styles.css'
<AssistantProvider endpoint="/api/assistant">
<AssistantPanel welcome="Ask about your shop" />
</AssistantProvider>
// in each screen — the assistant now knows where the user is
useAssistantContext({ path: '/orders/141', title: 'Order #141' })
$ npx teovo init --features proposals
Wrote teovo.config.json.
Row-level rules: off. Add --tenant-sql and --user-sql to turn them on (recommended when the browser can reach the database).
Next: npx teovo migrate (or generate, to keep the SQL with your own migrations)
$ npx teovo migrate
Applied: 0001_core, 0002_proposals, 0003_tenant_formats, 0004_proposal_sources
$ npx teovo status
done 0001_core
done 0002_proposals
done 0003_tenant_formats
done 0004_proposal_sources
All tables are there.
Pick a capability to see the setting that turns it on and what your users get. See every feature →
From the app's suggestions callback, with real names — no model call.
Tried in order. No switch once a tool has changed something.
list_ordersreadrecord_paymentproposechange_totalpropose · ownernever offeredlist_expensesreadChecked before anything is saved: replies at once, then messages and tokens per person and per tenant.
Masked in the run log and hidden from the model too.
Every check happens before anything is saved. Scroll to follow a message through the handler.
Your identify callback returns the tenant, user and role.
Tenant switch, replies at once, messages and tokens per person and per tenant.
Loaded only if it belongs to this tenant and this user. The server keeps the history.
Your instructions, the tenant's notes, the untrusted-text rule, then the screen — fenced.
If the first model fails before any output, the next one answers.
text, data-step, data-card, data-action, data-suggestions.
Run, steps and usage are logged. Confirm applies once; Undo works for 10 minutes.
Teovo owns the panel, the handler and its own tv_ tables. Everything that is your product stays yours.
apply, as the userOpen source, MIT, TypeScript end to end.