# How TencentDB Agent Memory Lets AI Agents Share Experience

> Learn how TencentDB Agent Memory lets AI agents share experience. TDAI's MemoryCore gateway and shared flag enable instant teammate recall of memories.

- Repository: [Tencent Cloud/TencentDB-Agent-Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory)
- Tags: how-to-guide
- Published: 2026-08-22

---

**TLDR: TencentDB Agent Memory (TDAI) enables AI agents to share experience through a team-scoped memory plane — the `MemoryCore` gateway enforces `team_id` on every request, assets carry a `shared` flag, and any memory written by one agent becomes instantly retrievable by every teammate via the recall API.**

TencentDB Agent Memory is an open-source project from Tencent Cloud that builds a full memory stack for AI agents — raw conversation turns, semantic knowledge, code graphs, and team context. Rather than isolating each agent in its own memory silo, the project's core design exposes a \"team-shared\" dimension so that insights learned by one agent directly benefit all its teammates. In this article, we walk through the exact architecture, code paths, and SDK calls that make this shared-experience workflow work, based on the source in the `TencentCloud/TencentDB-Agent-Memory` repository.

## Shared-Experience Architecture

At the heart of the system is the **`MemoryCore`** HTTP gateway. Every v3 data-plane API request (`/v3/*`) requires three identifiers — `team_id`, `agent_id`, and `user_id` — as documented in [`MemoryCore/README.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/README.md). The backend uses these IDs to filter and return team-scoped data, which is exactly what lets one agent read another agent's contributions.

The table below summarizes the key components involved in sharing experience:

| Component | Role in Sharing | Key Implementation |
|-----------|----------------|--------------------|
| **MemoryCore** | Central HTTP gateway that enforces `team_id`, `agent_id`, and `user_id` on every request. The v3 data-plane APIs require these IDs, allowing the backend to filter data by team and return team-shared assets. | [`MemoryCore/README.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/README.md) – the gateway's request model describes the need for `team_id` + `agent_id` + `user_id`. |
| **Asset Metadata** | Each asset (skill, wiki, code-graph, memory) carries a `shared` flag (permission \"share\"). The permission enum is defined in [`metadata-types.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/metadata-types.ts). | [`metadata-types.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/metadata-types.ts) – defines the `\"share\"` permission. |
| **Skill Service** | Skills can be created as team-shared. The SDK method `cloneWithOverrides` returns a client that shares the same transport but can override defaults, enabling multiple agents to use the same skill front end. | [`skill-client.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/skill-client.ts) – "Return a clone that shares the same transport…" |
| **MemoryPanel UI** | UI lets owners toggle `Shared` for skills and memories. Shared assets are listed under \"Team assets\" and can be bound to any agent. | UI strings expose the \"Shared\" label in [`MemoryPanel/web/src/i18n/en-US.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryPanel/web/src/i18n/en-US.ts). |
| **MemoryKnowledge** | When processing knowledge (wiki, code-graph), the module-level `BuildQueue` is single-instance (`sharedQueue`), so all agents benefit from a common indexing pipeline. | [`MemoryKnowledge/src/module.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryKnowledge/src/module.ts) – shared queue definition. |
| **MemoryProxy** | Adapter layer for agents (e.g., OpenClaw, Hermes). It forwards requests to the MemoryCore gateway, preserving the `team_id` so agents automatically read from the shared pool. | [`MemoryProxy/src/handler.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/src/handler.ts) – forwards calls while preserving shared session IDs. |

When an agent writes a conversation turn (L0), the payload includes its `team_id`. The gateway stores the turn under that team — making it instantly visible to any other agent that queries the same team. Retrieval through `/v3/recall` respects the same team filter, returning both private and shared memories.

## How Sharing Works in Practice

The sharing workflow follows a clear path of create → bind → recall provided in the TDAI SDK and the MemoryPanel UI:

1. **Create a shared skill** — an admin creates a skill with the `shared: true` flag set.
2. **Bind the skill to an agent** — the agent's asset list includes the skill ID, associating it with that agent's runtime.
3. **During a conversation** — the agent SDK calls `recall` with its `team_id`. The backend merges:

   - **Private turns** (user-specific memory)
   - **Team-shared turns** (experience contributed by any teammate)

4. **The agent receives a combined context** — it can \"remember\" what the team collectively discovered and answer using that shared knowledge.

This means any memory written by one agent (for example, a support ticket resolution) is scrapable by a teammate agent in the same `team_id` during a future invocation. No explicit synchronization or syncing step is required — the shared dimension is inherent in the data model.

## Code Examples

The TypeScript SDK in `sdk/memory-core/typescript/src/v3` provides direct methods to exercise this shared-experience flow. Below are three runnable examples based on the source.

### Create a Shared Skill

```ts
import { SkillClient } from '../sdk/memory-core/typescript/src/v3/skill-client';

// Initialise the client (uses same transport for all agents)
const client = new SkillClient({ endpoint: 'http://127.0.0.1:8420' });

// Create a new skill that is shared across the team
await client.createSkill({
  name: 'TeamFAQ',
  description: 'Frequently asked questions for the support team',
  shared: true,                 // <-- shared flag
  ownerId: 'user-123',
  teamId: 'team-alpha',
});

```

The `shared: true` flag makes the skill available to every agent in `team-alpha`. Other agents can reference it by name or ID without being the creator.

### Bind a Skill to an Agent

```ts
import { AgentClient } from '../sdk/memory-core/typescript/src/v3/metadata-client';

const agent = new AgentClient({ endpoint: 'http://127.0.0.1:8420' });

await agent.updateAgent('agent-007', {
  boundSkills: ['TeamFAQ'],   // Reference the shared skill by name or ID
  teamId: 'team-alpha',
});

```

Now **Agent 007** can invoke `TeamFAQ` even though it didn't create the skill — binding attaches the shared knowledge to the agent's runtime.

### Recall Shared Experience

```ts
import { MemoryClient } from '../sdk/memory-core/typescript/src/v3/memory-prompt-client';

const memory = new MemoryClient({ endpoint: 'http://127.0.0.1:8420' });

const result = await memory.recall({
  query: 'What is the escalation path for ticket #12345?',
  teamId: 'team-alpha',          // Ensures shared turns are considered
  agentId: 'agent-007',
  userId: 'user-456',
});

console.log(result.documents);   // Contains private plus team-shared memories

```

The `teamId` parameter tells the gateway to **merge** private and shared L1/L2 memories into the response, so the agent answers using collective context.

## Key Files in the Repository

| File | Why It Matters |
|------|----------------|
| [`MemoryCore/README.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/README.md) | Describes the gateway API, the `team_id` requirement, and the overall architecture. |
| [`sdk/memory-core/typescript/src/v3/metadata-types.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/sdk/memory-core/typescript/src/v3/metadata-types.ts) | Defines the `\"share\"` permission used throughout the asset model. |
| [`sdk/memory-sdk/typescript/src/v3/skill-client.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/sdk/memory-sdk/typescript/src/v3/skill-client.ts) | Shows how `cloneWithOverrides` shares transport, enabling multiple agents to use the same skill service. |
| [`MemoryPanel/web/src/i18n/en-US.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryPanel/web/src/i18n/en-US.ts) | UI strings that expose the \"Shared\" toggle to users. |
| [`MemoryKnowledge/src/module.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryKnowledge/src/module.ts) | Implements a shared build queue that all agents benefit from when indexing knowledge. |
| [`MemoryProxy/src/handler.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/src/handler.ts) | Proxy logic that forwards calls while preserving shared session identifiers. |

These files together define a unified, team-scoped memory plane for AI agents: any experience written by one agent becomes instantly visible to all teammates, enabling collective learning and consistent behavior across a full deployment.

## Summary

- **Team-scoped memory** — `MemoryCore` enforces `team_id` on all requests so data is automatically partitioned and shared within a team.
- **`shared` permission design** in asset metadata is what marks skills, memories, and knowledge as team-visible.
- **Storage any agent's writes** to the team pool via its `team_id`; retrieval via `/v3/recall` merges private and shared turns.
- **`MemoryProxy` preserves the team context** when acting as an adapter for external agents.
- **The `memory-knowledge` `sharedQueue`** globally shares the indexing pipeline, so all agents benefit from knowledge processed once.
- **The SDK methods** (`createSkill`, `updateAgent`, `recall`) provide the practical interface for implementing shared-experience in any agent framework.

## Frequently Asked Questions

### How does TencentDB Agent Memory enforce which agents can access shared memory?

TencentDB Agent Memory enforces access through the `MemoryCore` gateway, which requires `team_id`, `agent_id`, and `user_id` on every v3 request. The gateway filters assets and memories by `team_id` (the boundary) plus the asset's `shared` permission flag, so only agents in the same team can read or write the shared pool. Data outside the team is invisible by default due to that team-level filter.

### What is the difference between private and shared memory in TencentDB Agent Memory?

Private memory is user- or agent-specific — it is stored under a single `user_id` or `agent_id` and returned only for queries from that same entity. Shared memory is tagged with the `team_id` and can be read by any agent within that team. On a `/v3/recall` call, the gateway merges both private and team-shared memory into a single context window, giving the agent access to collective knowledge while keeping per-user privacy.

### How do I mark a skill as shared in the TencentDB Agent Memory SDK?

In the TypeScript SDK's `SkillClient.createSkill`, you set the `shared: true` flag in the payload (as shown in the code examples above). The skill is then stored with the asset's `\"share\"` permission, making it available to all agents bound to the same `teamId`. The MemoryPanel UI also exposes a \"Shared\" toggle that writes this same permission flag.

### Can existing private memories be manually converted to shared ones?

According to the source code's permission model, the `shared` flag is a property of the asset metadata ([`metadata-types.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/metadata-types.ts)) and can be edited at runtime via the `updateAgent` or `updateSkill` SDK methods. Updating the permission to `\"share\"` and keeping the `team_id` the same will make the asset visible to the team. The UI also provides a toggle to switch the visibility after creation.