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

# Sharing

> Team feed within one instance, mesh sync across instances

Two sharing layers, both audited: a team feed inside a single instance, and a mesh that syncs whole scopes between instances.

## Team feed

Set `TEAM_MODE=shared`, `TEAM_ID`, and `USER_ID` in the env; memories are then scoped to (team, user) tuples.

| Surface                                              | What it does                                                                                                                         |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `memory_team_share` / `POST /agentmemory/team/share` | Share a memory, pattern, or observation (observations also need `sessionId`) into the team feed, stamped with who shared it and when |
| `memory_team_feed` / `GET /agentmemory/team/feed`    | Recent shared items across all team members, newest first                                                                            |
| `GET /agentmemory/team/profile`                      | Members seen in the feed with share counts                                                                                           |

Records received through sharing carry the `shared` provenance channel, so recall can tell them apart from your own writes.

## Mesh

The mesh syncs data between separate agentmemory instances (`memory_mesh_sync`, `mesh/*` routes).

Register a peer with a name and URL via `POST /agentmemory/mesh/peers`. Peer URLs must be public http or https addresses: localhost, private ranges, and link-local addresses are rejected, including after DNS resolution.

`POST /agentmemory/mesh/sync` pushes, pulls, or both (`direction: "push" | "pull" | "both"`) against one peer or all of them. Sync requires `AGENTMEMORY_SECRET` to be set and fails without it. Default scopes: `memories`, `actions`, `semantic`, `procedural`, `relations`, `graph:nodes`, `graph:edges`; peers can narrow scopes and filter by project.

Conflicts resolve last-write-wins on the record timestamp, per record, under a keyed lock. `POST /agentmemory/mesh/receive` is the inbound half; `GET /agentmemory/mesh/export` returns the outbound payload. Every register, sync, and receive lands in the audit trail.
