Orcha
Tutorial and Examples

Basic agent

Example of the simplest OrchaJS text chat agent with configuration and instructions.

order-support~/order-support/orcha/orderSupport/index.json
01{02  "name": "Order Support",03  "description": "Help customers understand and resolve order issues.",04  "provider": "anthropic",05  "model": "claude-sonnet-4-6",06  "maxTokens": 4096,07  "outputType": "text"08}

The simplest text chat agent

The project above is an example of the simplest text chat agent you can build with Orcha. It has a model configuration, instructions, one registry entry, and ordinary application code that runs it.

It can answer order-support questions from its instructions, but it cannot look up real order data yet. Its instructions therefore prevent it from inventing order details. The next tutorials add skills, actions, client actions, and subagents to this same project.

Select any file in the editor to inspect the complete example.

Understand each file

orcha/orderSupport/index.json

Configures the agent's identity, provider, model, token limit, and text output.

  • The provider must also be configured in orcha/index.ts.
  • The exact model identifier is passed to that provider.
  • Text output makes a completed result.output a string.
orcha/orderSupport/instructions.md

Defines the agent's stable behavior and boundaries for every session.

  • Keep changing user input and application data out of this file.
  • Pass those values to run() instead.
orcha/index.ts

Initializes Orcha, configures Anthropic, and registers the agent folder.

  • The orderSupport registration key creates orcha.orderSupport.
  • Only explicitly registered agents are compiled.
app.ts

Starts a durable session, awaits the result, and prints the final text output.

  • run() returns an execution handle immediately.
  • The result property is a promise.

Next: add a skill.