---
title: Guild.ai
description: Import the openmemory OpenAPI document into Guild as an integration with API-key auth, so Guild agents get every operation as a tool.
---

<!-- Commands checked against the Guild CLI help (`guild integration ... --help`), November 2026. -->

Guild turns an OpenAPI document into agent tools. openmemory publishes OpenAPI 3.0.3 at `https://api.openmemory.sh/openapi.json` with stable `operationId`s (`context_get`, `memory_remember`, `action_transition`, ...), which become the tool names.

## 1. Download the OpenAPI document

```bash
curl -s https://api.openmemory.sh/openapi.json -o openmemory.openapi.json
```

## 2. Create the integration

openmemory takes the key as a bearer token, so use API-key auth with an `Authorization` header template:

```bash
guild integration create openmemory \
  --description "Memory for agents: facts, journal, records, approvals, KV, dreaming" \
  --base-url https://api.openmemory.sh \
  --auth-scheme api-key \
  --header-template "Authorization: Bearer {token}"
```

`X-API-Key: {token}` (Guild's default template) also works.

## 3. Add the operations, build, and publish

```bash
guild integration version create <owner>~openmemory
guild integration operation create <owner>~openmemory --openapi openmemory.openapi.json
guild integration version build <owner>~openmemory --version-number 1.0.0
guild integration version publish <owner>~openmemory --version-number 1.0.0
```

`guild integration operation list <owner>~openmemory` shows the generated tools.

## 4. Connect a key

Create a space (`POST https://api.openmemory.sh/v1/spaces`) and connect its key as the credential:

```bash
guild integration connect <owner>~openmemory --owner <owner> --token om_...
```

Guild injects the credential server-side, so agents never see the key.

## 5. Use it in an agent

Give your agent the operations it needs. A good minimal set:

| Tool | When |
| --- | --- |
| `context_get` | Start of every run |
| `memory_remember`, `memory_recall` | Learning and lookup |
| `action_propose`, `action_transition`, `action_list` | Approvals |
| `journal_put` | End of a run |
| `batch_apply` | Atomic end-of-run writes |
| `dream_job_next`, `dream_job_submit` | A nightly scheduled run |

`space_create` needs no key and should not be exposed to agents. Create spaces yourself.

## Related

- [API reference](/docs/api-reference)
- [Build your own agent loop](/docs/guides/agent-loop)
