# How Skills Are Managed and Shared Within TencentDB Agent Memory

> Discover how TencentDB Agent Memory manages and shares versioned, asset-based skills. Explore ACL systems for ownership, visibility, and runtime permissions across teams.

- Repository: [Tencent Cloud/TencentDB-Agent-Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory)
- Tags: internals
- Published: 2026-08-23

---

**Skills in TencentDB Agent Memory are versioned, asset-based knowledge containers that encapsulate reusable agent expertise, shared across teams through a hierarchical ACL system evaluating ownership, visibility, and runtime permissions.**

The TencentDB Agent Memory system treats Skills as first-class entities that transcend simple prompt templates. According to the TencentCloud/TencentDB-Agent-Memory repository, a Skill bundles metadata, resource files, trigger boundaries, execution steps, and validation rules into an immutable, versioned asset that agents can create, search, and invoke via structured HTTP APIs.

## Core Architecture of Skill Management

The Skill management stack operates through four coordinated layers that handle everything from type definitions to runtime injection.

### API Definitions and Types

All Skill-related data structures are centralized in [`sdk/memory-core/typescript/src/v3/skill-types.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/sdk/memory-core/typescript/src/v3/skill-types.ts). This file defines the contract for the entire system, including `SkillSummary` for list views, `SkillDetail` for full retrieval, `SkillVersionSummary` for version history, and enumeration types for pagination, search modes, and conversation extraction.

The type system supports complex operations like `SkillSearchMode` (supporting BM25, embedding, or hybrid retrieval) and `SkillSearchHit` objects that carry relevance scores and concise summaries back to the client.

### Client SDK Implementation

The [`sdk/memory-core/typescript/src/v3/skill-client.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/sdk/memory-core/typescript/src/v3/skill-client.ts) file provides a thin but comprehensive wrapper around the 15 `/v3/skill/*` HTTP endpoints. This client handles CRUD operations, version management, resource file I/O, and conversation-driven extraction APIs.

Key methods include `create()` for initial Skill instantiation, `search()` for RAG-based retrieval, and `update()` for modifying visibility and access controls.

### MemoryCore Gateway and Proxy Layer

The MemoryCore service (`MemoryCore/src/core/`) persists Skill data and executes RAG search algorithms. It processes `SkillConversationAddRequest` payloads to automatically extract new Skills from agent conversations when trigger boundaries match.

The MemoryProxy layer (documented in [`MemoryProxy/README.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/README.md)) acts as an intermediary that injects Skill context into LLM prompts using XML blocks like `<cloud_skills>` and `<skill_tools>`, while forwarding Skill tool calls to the backend without exposing implementation details to the agent.

### Asset-Level Access Control

Skills are stored as Memory Assets with a fixed binding model. The ACL system evaluates permissions through a hierarchy of Team → User → Agent → Visibility, ensuring that only authorized entities can read, write, or invoke a Skill during runtime.

## The Skill Lifecycle

Skills progress through a structured lifecycle from creation to invocation, with immutability guarantees at each version.

### Creation and Versioning

When an agent or human submits a `SkillCreateRequest` through [`skill-client.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/skill-client.ts), the system creates an initial version with optional resource files (markdown documentation, configuration schemas, or validation scripts). Each subsequent edit generates a new `SkillVersionSummary`, leaving previous versions immutable and enabling rollback to any historical state.

### Automatic Extraction from Conversations

After human-agent interactions, the MemoryProxy posts conversation slices to `/v3/skill/conversation/add`. If the underlying workflow matches defined trigger boundaries (specific intent patterns or successful task completions), the system automatically archives a new Skill version without manual intervention.

### Search and Retrieval

Agents discover Skills through the `search()` method, which supports three modes:

- **BM25**: Keyword-based lexical matching
- **Embedding**: Semantic vector similarity  
- **Hybrid**: Combined lexical and semantic scoring

Retrieval returns `SkillSearchHit` objects containing summaries, version IDs, and relevance metadata that the proxy can inject into system prompts.

### Invocation and Runtime Permissions

During execution, agents receive `<cloud_skills>` blocks containing summaries and `<skill_tools>` blocks with curl-style invocation snippets. The boolean flag `skillRuntime.allowLlmWrite` controls whether the LLM can mutate Skill state or remains restricted to read-only invocation.

## Sharing Mechanics and Access Control

Skill sharing operates through explicit visibility transitions and hierarchical permission evaluations.

### Ownership and Visibility States

By default, every Skill is **private** to its creator. After administrative review through the MemoryPanel UI (documented in [`MemoryPanel/README.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryPanel/README.md)), the `visibility` field can transition to `team` or `public` states, widening the access scope.

### ACL Evaluation Hierarchy

When an agent requests a Skill, the Memory Hub applies a strict filter order:

1. **Team** membership verification
2. **User** ownership checks  
3. **Agent** binding validation
4. **Visibility** state (private/team/public)

Only assets passing all four tiers are returned in search results or allowed for direct invocation.

### Cross-Agent Reuse

Once shared at the team level, any agent belonging to that team can import the Skill into its context using `SkillConversationAddRequest`. This enables proven workflows extracted from one agent's experience to augment another agent's capabilities without retraining or prompt engineering.

## Practical Implementation Examples

The following examples demonstrate how to interact with the Skill system using the TypeScript SDK.

### Creating a New Skill

```typescript
import { SkillClient } from '@tencentdb/memory-core';

const client = new SkillClient({ 
  baseURL: 'http://localhost:8420', 
  serviceToken: 'YOUR_TOKEN' 
});

await client.create({
  user_id: 'u123',
  team_id: 't456',
  agent_id: 'a789',
  name: 'Release Checklist',
  description: 'Standard steps for releasing a product',
  resources: [
    { 
      path: 'checklist.md', 
      encoding: 'utf-8', 
      content: '# Release Checklist\n...' 

    }
  ],
});

```

This creates a Skill with an embedded markdown resource that subsequent agents can reference.

### Searching for Relevant Skills

```typescript
const result = await client.search({
  user_id: 'u123',
  team_id: 't456',
  query: 'how to release a new version',
  mode: 'hybrid',
});

console.log(result.items.map((s: SkillSummary) => s.name));

```

The hybrid mode combines BM25 text matching with vector embeddings to surface semantically related Skills even when terminology differs.

### Invoking Skills from LLM Prompts

When the MemoryProxy processes a response containing `<skill_tools name="Release Checklist"/>`, it expands the tag into executable HTTP commands:

```bash
curl -X POST http://localhost:8420/v3/skill/run \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"skill_id":"skill-xyz","input":{}}'

```

The LLM receives this curl snippet within its context window, allowing it to formulate the appropriate JSON payload for Skill execution.

### Sharing Skills Across Teams

```typescript
await client.update({
  user_id: 'admin',
  team_id: 't456',
  skill_id: 'skill-xyz',
  visibility: 'team',
});

```

Setting visibility to `team` immediately grants access to all agents operating under team `t456`, while maintaining audit trails through the versioning system.

## Summary

- **Skills are versioned assets** combining metadata, resources, and execution logic in [`skill-types.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/skill-types.ts) and persisted through the MemoryCore gateway.
- **Management flows through the SDK** in [`skill-client.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/skill-client.ts), which wraps 15 REST endpoints for CRUD, search, and versioning operations.
- **Sharing follows hierarchical ACLs** evaluated as Team → User → Agent → Visibility, with explicit transitions from private to team or public states.
- **Automatic extraction** captures workflows from conversations when trigger boundaries match, posting to `/v3/skill/conversation/add`.
- **Runtime injection** uses `<cloud_skills>` and `<skill_tools>` XML blocks via MemoryProxy, governed by `skillRuntime.allowLlmWrite` permissions.

## Frequently Asked Questions

### How does TencentDB Agent Memory handle Skill versioning?

Each edit to a Skill creates a new `SkillVersionSummary` while keeping previous versions immutable. This append-only approach enables rollback to any historical version and maintains audit trails for compliance. The version history is accessible through the `search()` and detail retrieval methods in [`skill-client.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/skill-client.ts).

### What permissions control whether an LLM can modify a Skill?

The boolean flag `skillRuntime.allowLlmWrite` determines write access. When set to false (the default for shared Skills), the LLM can only invoke the Skill via `<skill_tools>` snippets generated by MemoryProxy. Administrative users must explicitly grant write permissions through the `update()` method for the LLM to mutate Skill content.

### Can Skills be shared across different teams?

Skills can be elevated from `private` to `team` visibility, allowing reuse within the same team. Cross-team sharing requires setting visibility to `public` or explicit ACL grants, subject to the Memory Hub's Team → User → Agent → Visibility hierarchy. The [`MemoryPanel/README.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryPanel/README.md) describes the UI workflow for administrative review before public publication.

### How does automatic Skill extraction work during conversations?

After each human turn, MemoryProxy posts the conversation slice to `/v3/skill/conversation/add`. The MemoryCore service analyzes the dialogue against trigger boundaries—specific patterns indicating successful task completion or novel problem-solving. When boundaries match, the system automatically generates a new Skill version, archiving the workflow for future retrieval without manual documentation.