Tallgeese AI Developers
Lesson 6 of 8⏱ 15 minSome code

Create a specialist

Combine a tool, a focused assistant and a page into a mini-app.

In 30 seconds

  • A specialist = your tool + an assistant with one job + a page in the sidebar.
  • The page can't do risky things. Those are confirmed in the chat.
  • Skills can also use a ready-made Python.

Create a specialist

A specialist is a mini-app: a tool, an assistant with one job, and a page in the sidebar. People can use it on its page, or just ask Tallgeese's main chat, which hands the question over. The Financial Advisor is built this way: it keeps a watch list, fetches prices and news, and shows them on a page.

How a specialist fits together

Main chatgets one new "ask the specialist" ability
Your specialistan assistant with one job, following your instructions
Your pagea screen in the sidebar, drawn with HTML
Your tooldoes the real work, reaches only the addresses you listed
The person's datastored on their computer, kept when your item updates
The main chat never carries your tool's details, so a specialist doesn't slow it down.

Four files make a specialist

1. item.toml: the parts

[[provides]]
kind = "sandboxedServer"
server = "finance"
grants = ["storage"]                       # lets the tool keep a database
allow = { http = ["https://www.sec.gov:443"] }
tools = { ask = ["record_trade", "delete_account"] }

[[provides]]
kind = "agent"
role = "tg_financial_advisor"
# When should the main chat hand a question over?
area = "their investments, portfolio or watch list, or prices or news about a stock or fund"

[[provides]]
kind = "page"
id = "financial-advisor"
glyph = "chart"
calls = ["list_portfolio", "watch", "delete_account"]   # what the page may do itself
confirms = ["delete_account"]                           # the page asks "are you sure?" first
actions = ["review", "news"]                            # buttons that start a chat message

2. agent/agent.toml: the assistant's job

name = "tg_financial_advisor"
description = "The person's investments: holdings, a watch list, prices and news."
developer_instructions = """
You are the Financial Advisor. Your only job is the person's investments.
- Always use your tools. Never estimate a number yourself.
- Say "as of" with the time and source for any price.
- Don't recommend buying or selling particular securities.
"""

The instructions can be up to 16 KB. Say what the job is, which tool answers which question, what to do when nothing is set up yet, and what never to do.

3. plugin.toml: settings and permissions

[[settings]]
id = "price_key"
kind = "secret"           # typed in the app's settings and kept safely; the page never sees it
group = "prices"

[[permissions]]
id = "trades"
default = "ask"           # the person can change this to "allow"
tools = ["record_trade"]

[data]
storage = true
export = ["json", "csv"]  # lets people export their own data

4. page/: your screen

A normal web page (HTML, CSS, JavaScript) that you build into a single file. It talks to Tallgeese through a small helper called host:

import { host } from "@tallgeese/plugin-page";

const info = await host.init();                    // always first: language, theme, settings
const result = await host.call("list_portfolio");  // run one of the tools you listed in "calls"
host.onChanged(() => refresh());                   // data changed (even if the assistant changed it)
host.onTheme((t) => applyTheme(t));                // follow the app's light or dark mode
host.ask("Review my mix");                         // start a chat message when the person clicks
host.openSettings("prices");                       // send them to settings to type a key

The page runs in a sealed frame: no network, no files, no access to the conversation. It can only do what the helper allows.

Design rules that keep people safe

Using Python in your skills

Skills are only text, but Tallgeese can supply a ready-made Python for them. Add one line to your item and, when someone gets it, Tallgeese offers to download Python once (they see how large it is first).

[[provides]]
kind = "skillPack"
skills = ["python-scripts"]

[[provides]]
kind = "runtime"
family = "python"