> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

> Tiny recipes here. Full runnable files live in the agentium-examples repo.

# Examples

## In plain terms

These pages are **short recipes**. Copy a snippet, then go run a real file.

Full programs (with comments, env vars, extra cases) live here:

[github.com/agentiumOS/agentium-examples](https://github.com/agentiumOS/agentium-examples)

```bash theme={null}
git clone https://github.com/agentiumOS/agentium-examples.git
cd agentium-examples
npx tsx basics/01-basic-agent.ts
```

<CardGroup cols={2}>
  <Card title="Ask a question" icon="play" href="/examples/agents">
    `new Agent` + `run()` + tools + `Agent.deep()`
  </Card>

  <Card title="Remember a chat" icon="comments" href="/examples/memory-sessions">
    Same `sessionId` = memory. Facts, notes, learnings.
  </Card>

  <Card title="Tools" icon="wrench" href="/examples/tools-toolkits">
    `defineTool` and built-in toolkits
  </Card>

  <Card title="Save to a database" icon="database" href="/examples/storage">
    SQLite / Postgres / Mongo — `memory: { storage }`
  </Card>
</CardGroup>

### The two options people mix up

```typescript theme={null}
const agent = new Agent({ name: "bot", model: openai("gpt-4o") });

// Constructor = how the worker is built (brain, tools, memory…)
// run() = one question, with who/which-chat extras:

await agent.run("Hi", {
  sessionId: "chat-1",  // same id = remember
  userId: "alex",
});
```

Every field: [Agents](/agents/overview).
