Skip to main content
You’ll run the agent from Part 1 on your own machine, first with no DecimalAI account, then connected to it. The code stays the same throughout. This part uses the OpenAI Agents SDK; the OpenAI Agents SDK page has the reference for everything here. You need Python 3.10 or later and an OpenAI API key.

1. Install

decimalai reads .env when it is imported. Work in a git repository: step 4 writes a file to commit.

2. Add the three skills

Add the agent’s three skills from the registry, billing-dispute-resolution, account-deletion-verification-policy and diagnostic-triage-questions:
Each command writes the skill’s files to .agents/skills/, lists it in .decimal/skills.toml, and records its exact bytes in .decimal/skills.lock. No account is needed. Commit both directories:

3. Run it with no DecimalAI account

Save this as main.py:
main.py
With no DECIMAL_API_KEY, agent_config() runs keyless and says so once:
Then the agent’s reply. What happened is what Part 1 showed:
  • instructions=support.instructions gives the model the fallback= prompt, then the skill menu: the three skills’ names and descriptions, and a sentence telling it to load a skill before using it.
  • *support.tools adds one tool, load_skill. The model calls it with a skill’s name and gets that skill’s full instructions back, read from .agents/skills/.
  • lookup_order is your own tool. Here it reads a dictionary; in your app it reads your database.
  • Nothing is sent to DecimalAI. No account, no traces.
Change the question to "Please delete my account and all my data today." and run it again. The model loads account-deletion-verification-policy instead.

4. Add a DecimalAI key

Sign up at app.decimal.ai, get a key from Settings → API Key, and add it to the same .env:
Run main.py again, unchanged. Its first run connects the project (example output):
What changed:
  • The agent exists in your workspace, at app.decimal.ai/agents/order-support. It has no saved prompt yet, so the fallback= text keeps running.
  • Its skills were copied onto it, once. From now on they live on DecimalAI: you change them in the dashboard or with decimalai skills add, and editing .decimal/skills.toml no longer does.
  • Every run is traced from now on: the model calls, lookup_order, load_skill, and the prompt and skills the run used. Runs from before the key are not uploaded.
  • .decimal/link.toml records the connection. With it committed, agent_config() with no key raises an error instead of running keyless, so a deploy that lost its key fails at startup instead of running without its saved prompt.

5. Change the prompt without redeploying

Open the agent in the dashboard. On its Prompt tab, write a prompt and save it:
Run main.py again within a minute or so. The reply is signed: agent_config() re-reads the saved prompt in the background at most once a minute, so it reaches the next runs with no redeploy. support.prompt_source is now "decimalai". fallback= still matters: with a key, it is what runs when the agent has no saved prompt, or when DecimalAI can’t be reached at startup.

Next: 3. Start from a template

Give order-support the Support pack’s prompt and five more skills, then make one skill your own.