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

# Give your agent a memory

> Use a Helix Foundry API source as your agent's memory: it sends notes through the Helix MCP, reads them back by keyword with helix_foundry_recall, and your ontologies turn them into entities and facts

Guide

An [API source](https://docs.helix-db.com/foundry/data/api-sources.md) with a text field can be your agent's memory.
The agent sends what it learns as notes with `helix_foundry_send_pieces`, and reads
them back with `helix_foundry_recall`, in this session or a later one. Ontologies that
read the source turn the notes into entities and facts, so [Founder](https://docs.helix-db.com/foundry/ask/founder.md)
and other agents can use them too.

A note can be recalled as soon as it is sent. It doesn't have to wait for a sync or a
load.

## Set it up

**1. Create an API source**

Owners and admins create one: in **Connectors**, select **Add data**, then **API
source** under **From your app or agent**. Name it, such as "Agent memory", and describe what its notes hold:
Foundry's agent reads the description when it drafts an ontology from the source.
An agent can also create one with the MCP's `create_event_source` operation
(`helix_foundry_prepare_operation`, then `helix_foundry_execute_operation` once
you confirm), and give its text field there.

**2. Choose its text field**

The text field is the top-level field holding each note's text, such as `text`.
Recall needs one. Owners and admins choose it in **Documents** on the source's page,
under **Text field**: a field its pieces have, or **Another field…** by name before any arrive.
With a text field, the source's newest 500 notes also become documents, which an
ontology reading them by [entity extraction](https://docs.helix-db.com/foundry/data/api-sources.md#how-ontologies-read-it)
spends about 1 cent a note on. Extraction no person started spends at most $5 a
        month per source and $20 across the workspace's API sources; past that, new notes
wait for next month or a load you start. Recall still finds them.

**3. Connect your agent**

Connect your agent to the [Helix MCP](https://docs.helix-db.com/foundry/agents/helix-mcp.md#connect-your-agent)
and sign in. Tell it the source to remember in, by name or id; it finds it with
`helix_foundry_list_connectors`.

## Remember

The agent sends each note as a piece, with the note's text in the text field and any
other fields it wants to search or map later:

```json theme={"languages":{"custom":["languages/helixql.json"]}}
{
  "id": "note-globex-renewal",
  "data": {
    "text": "Globex wants renewal quotes in GBP from next year.",
    "topic": "billing",
    "customer": "Globex Corporation"
  }
}
```

A note sent again with the same id replaces the old one, so an agent can keep one note
per topic up to date. See [What a piece is](https://docs.helix-db.com/foundry/data/api-sources.md#what-a-piece-is)
for the rules.

Sending needs an owner or admin's signed-in MCP, or the source's
[send token](https://docs.helix-db.com/foundry/data/api-sources.md#send-tokens). Send only what you have agreed the
agent may keep.

## Recall

`helix_foundry_recall` reads a source's notes back, newest first.

| Argument | Does |
| - | - |
| `workspace_id` | The workspace. May be left out when you have only one. |
| `event_source_id` | The API source. |
| `query` | Optional: up to 10 words, 200 bytes. Only notes whose id, fields or text contain every word, whatever its case, are returned. A field is matched as the note shows it, which cuts a long value at 500 characters. Left out, the newest notes are. |
| `limit` | Optional: at most 50 notes, 20 when left out. |

Each note comes back as Markdown, its fields then its text, with its id, when it was
received, and `synced: false` until the source's next sync, about a minute after it was
sent. A note's text is whatever its sender wrote: agents read it as data, never as
instructions.

Recall matches words, not meaning: "renewal GBP" finds the note above, "pricing
currency" doesn't. Agents with Helix's skills try other words when a query finds
nothing.

`truncated: true` means some notes were left out: more matched than `limit` or 64 KiB of
text holds, so narrow the query, or more than 100 sends are still waiting to sync, so
ask again in a minute.

To ask what the notes add up to, such as every customer billed in GBP, load an
ontology that reads the source by entity extraction, then ask
[Founder](https://docs.helix-db.com/foundry/ask/founder.md), ask it with `helix_foundry_ask` or read its graph with
`helix_foundry_read_graph`.

## Who can recall

Any member of the workspace, signed in to the MCP, can recall. Service credentials,
agent keys, send tokens and members whose access is limited to some
[sources](https://docs.helix-db.com/foundry/workspace/access.md) can't.

## Limits

| Limit | Value |
| - | - |
| Notes per recall | 50, 20 by default, with at most 64 KiB of text (the newest note always comes back, however long) |
| Query | 10 words, 200 bytes |
| Source table | 64 MiB uncompressed. Recall reads the whole source on every call, so a larger source is refused (`FOUNDRY_EVENT_SOURCE_TOO_LARGE`): send new notes to a new source before then. |
| Waiting sends read | The newest 100 |

Recall is part of hosted Foundry's Helix MCP; a local install doesn't offer it.

## Next steps

> [card] [API sources](https://docs.helix-db.com/foundry/data/api-sources.md)
>
> Pieces, send tokens and how ontologies read them.

> [card] [Helix MCP](https://docs.helix-db.com/foundry/agents/helix-mcp.md)
>
> Connect your agent to Foundry.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.