Skip to content

Simple Agent

A minimal Orca project with one model, one tool, and one agent.

Source (main.oc)

orca
model gpt4 {
  provider    = "openai"
  model_name  = "gpt-4o"
  temperature = 0.7
}

tool search {
  name = "web_search"
  desc = "Search the web for current information"
}

agent researcher {
  model   = gpt4
  persona = "
    You are a research assistant.
    You search the web for information and
    provide well-sourced answers.

    Always cite your sources.
    "
  tools   = [search]
}

Build

bash
orca build

Generated output (build/main.py)

python
# Auto-generated by Orca compiler — do not edit.

from langchain_openai import ChatOpenAI

# === variables ===

# === models ===

gpt4 = ChatOpenAI(model="gpt-4o", temperature=0.7)  # main.oc:1

Generated dependencies (build/pyproject.toml)

toml
[project]
name = "orca-build"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = [
    "langchain-core",
    "langchain-openai",
]

What's happening

  1. The model block creates a ChatOpenAI instance with GPT-4o and temperature 0.7.
  2. The tool block defines a web search tool the agent can use.
  3. The agent block wires the model and tool together with a persona that describes the agent's behavior.

Released under the MIT License.