TrustPager Docs

← Help Center

AI Features

Agent Memory — API and MCP Reference

How AI agents read and write persistent memory in TrustPager — the 6 MCP tools, REST path, field reference, upsert mechanic, tags, linked entities, and a worked NurtureAgent example.

Agent Memory lets your AI agents store and retrieve structured knowledge between runs. An agent can write a memory after pitching a feature, and read it back before the next email to avoid repeating itself. Memory is scoped per-agent, per-subject — so the NurtureAgent remembers what it said to each contact independently.

For a general overview of AI agents in TrustPager, see https://trustpager.com/help-center/how-to-monitor-ai-agents-in-agent-hub.

What agent memory is

Each memory record has a few key fields:

API scopes

Your API key needs the following scopes:

Manage scopes at https://app.trustpager.com/settings/api.

REST path

All memory endpoints are under /v1/memory.

MCP tools

All six memory operations are available as MCP tools:

The upsert mechanic

Passing key on write_memory makes the call an upsert against the tuple (agent_registry_id, subject_type, subject_id, kind, key). Re-running the same tuple updates the existing memory row instead of creating a duplicate. Soft-deleted rows are restored and updated when upserted.

This is the natural way to enforce a never-twice gate. For example, a NurtureAgent pitching article slugs uses key: "<article_slug>". Pitching the same article a second time simply updates the existing row — no duplicate, no second pitch.

Worked example — NurtureAgent pitch tracking

A NurtureAgent wants to track that it pitched a feature to a contact, along with the angle used and next angles to try. The memory is contact-level because both the cooldown gate (“don’t email the same person twice in 3 days”) and the never-twice gate (“don’t pitch the same article twice”) are enforced per-contact. The related opportunity is linked via linked_entities.

write_memory(
  agent_registry_id: "<your own id from kickoff>",
  subject_type: "contact",
  subject_id: "<contact_uuid>",
  kind: "pitch",
  key: "automated-follow-up-sequences",
  content: "Pitched automated follow-up sequences to Sarah. Angle: their team is stretched thin; sequences save 3 hours per week on manual follow-up.",
  metadata: {
    feature_pitched: "Automated follow-up sequences",
    pitch_angle: "saves 3 hours per week on manual follow-up",
    stated_need_addressed: "team stretched thin on manual follow-up",
    next_angles_to_try: [
      "ROI calculator — show dollar value of time saved",
      "Case study — similar business in their industry",
      "Free trial offer — remove the risk of committing"
    ]
  },
  linked_entities: [
    { type: "opportunity", id: "<opportunity_uuid>" },
    { type: "email_log",   id: "<email_log_id_from_send_response>" }
  ],
  tags: ["feature:follow_up_sequences", "angle:time_savings"],
  source_kind: "email_send",
  source_id: "<email_log_id>"
)

On the next run, the agent calls list_memory(subject_type="contact", subject_id="<uuid>", kind="pitch") to see every pitch already made — and skips any article whose slug appears as a key in the results.

Lookup patterns

Visibility

visibility: "private" is the default — only the agent that wrote the memory can read it. Set visibility: "shared" if you want other agents in the same workspace to read the memory. For example, a SupportAgent and a NurtureAgent might both need to know that a contact expressed a pricing objection.

Troubleshooting

← Back to Help Center Open on trustpager.com ↗