# OPC Agent — Examples

These runnable examples show how to use the core APIs. Each file is self-contained and works with the published `opc-agent@alpha` package.

## Prerequisites

```bash
npm install -g opc-agent@alpha
# or, from a local checkout:
npm install
npx tsc
```

## Running Examples

```bash
# Basic agent with a custom skill
npx tsx examples/basic-agent.ts

# Multi-channel setup (Web + Telegram)
npx tsx examples/multi-channel.ts

# DeepBrain knowledge base integration
npx tsx examples/brain-integration.ts
```

## What Each Example Demonstrates

| Example | Key Concepts |
|---------|-------------|
| `basic-agent.ts` | `BaseAgent`, `AgentRuntime`, `BaseSkill`, message handling, OAD-style config |
| `multi-channel.ts` | `WebChannel`, `TelegramChannel`, running multiple channels on one runtime |
| `brain-integration.ts` | `DeepBrainMemoryStore`, `InMemoryStore`, swapping memory backends |

## Full Project Example

`customer-service-demo/` is a complete, deployable agent workspace:

```
customer-service-demo/
  oad.yaml      # Agent definition (model, channels, skills, memory)
  README.md     # Setup and deployment instructions
```

It shows how a real production agent is structured: `oad.yaml` declares everything declaratively, and `opc run` brings the whole stack up.

```bash
cd examples/customer-service-demo
opc run
```

## Creating Your Own Agent Workspace

The fastest way to start a new project is with a Workstation Template:

```bash
opc init --template ceo-coach-socratic   # executive coaching agent
opc init my-agent                         # blank workspace
```

Templates generate a complete workspace — `EGO.md`, `SOUL.md`, `CONTEXT.md`, `oad.yaml`, and a pre-configured knowledge base — ready for `opc run`.

## Further Reading

- [README.md](../README.md) — Full feature overview and architecture
- [CONTRIBUTING.md](../CONTRIBUTING.md) — How to add channels, tools, and tests
- [CHANGELOG.md](../CHANGELOG.md) — Full rc.1–rc.14 release history
