# @leumas/chatbots

Programmable chatbots — persona + toolbanks + functioncalls (like leumas-cursor-agent-mvp). Programmed & priced in Studio, run on the Leviathan runtime.


Programmable chatbots — **persona + toolbanks + functioncalls**, like the leumas-cursor-agent-mvp,
built into Studio. Stored as the dynamic `chatbots` collection (CRUD via `/db/chatbots`), run on the
**Leviathan** runtime.

- **functioncalls** — capability adapters / MCP tools a bot may call (from `a.functioncalls`).
- **toolbanks** — named groups of functioncalls you assign to a bot.
- **Studio → Chatbots** — create, program (persona + banks + tools + memory), price, assign.

```js
import { defineChatbot, createChatbotRouter } from '@leumas/chatbots';
// mounted in leumas-api:
app.use('/api/chatbots', createChatbotRouter({ getBot: (id) => connector.get().getById('chatbots', id), complete }));
// run:  POST /api/chatbots/:id/run  { messages:[{role,content}] } -> { reply, tokens, cost }
```

`complete` is the LLM adapter — a stub today; wire `a.ollama` / a provider next (roadmap §6). Price a
turn by passing `gate: requirePassNode()`.


---
Source: shared/engines/chatbots/README.md
Canonical: https://docs.leumas.tech/p/engines/chatbots
