# Getting Started Examples

> Welcome to Tactus! This chapter introduces the fundamental concepts of the Tactus programming language through simple, self-contained examples.

Canonical: https://tactus.anth.us/examples/getting-started/

::band{columns="document-hero wide"}

[Examples](/examples/) / Getting Started

# Getting Started

Welcome to Tactus! This chapter introduces the fundamental concepts of the Tactus programming language through simple, self-contained examples.

::band{tone="muted"}

## Examples in This Chapter

### [Hello World](/examples/getting-started/hello-world/)

A minimal Tactus program demonstrating the core workflow without the formal `Procedure` structure. This example shows how to:
- Define an agent with a provider and model
- Write simple Tactus code that just returns an agent call
- Include an embedded BDD specification with Gherkin syntax
- Use fuzzy matching to validate agent responses flexibly

*Has Specs · Requires API Keys*

### [Simple Logic](/examples/getting-started/simple-logic/)

A pure logic example that demonstrates Tactus procedures without using any AI agents. This example shows:
- How to define procedures with input and output schemas using field definitions
- State management with the `state` primitive
- Multiple BDD specifications testing different aspects of the procedure
- Basic Lua control flow (loops, conditionals)

*Has Specs*

### [Parameters](/examples/getting-started/parameters/)

Demonstrates how to work with procedure parameters (inputs) and use them throughout your workflow. This example shows:
- Defining input schemas with descriptions and default values
- Accessing input parameters within the procedure function
- Using parameters in loops and logic
- Logging with the Log utility
- State management with `State.increment()`
- Returning structured output that references input parameters

*Has Specs*

### [Simple Agent](/examples/getting-started/simple-agent/)

A complete agent interaction demonstrating real LLM workflows with tool calling. This example shows:
- Defining an agent with a system prompt and initial message
- Tool integration using the built-in `done` tool
- Multi-turn agent loops with a maximum turn limit
- Checking if a tool was called using `done.called()`
- Extracting tool call arguments and using them in outputs
- Pattern matching in specifications to validate varied agent responses

*Has Specs · Requires API Keys*

### [Hello World With Validation](/examples/getting-started/hello-world-with-validation/)

The hello-world example revisited with the formal `Procedure` structure and input/output validation. This example shows:
- Defining input schema with required and optional fields
- Setting default values for optional parameters
- Defining output schema with field descriptions
- Type validation for inputs and outputs
- Using input parameters within the procedure function
- Returning structured output that matches the schema
- Testing with multiple scenarios including default values

*Has Specs · Requires API Keys*

::band{columns="neighbors"}

-
- [*Next Chapter →* **Agents**](/examples/agents/)

::band{columns="cta"}

## Want to contribute?

The examples repository is open source. Add your own examples or improve existing ones.

::button{href="https://github.com/AnthusAI/Tactus-examples" label="View on GitHub" size="lg"}
