Understanding the Memory Asset Model in TencentDB Agent Memory

The Memory Asset Model treats every reusable piece of knowledge—Chat Memory, Skills, LLM Wiki pages, and Code Graph data—as a versioned, permission-aware Memory Asset defined by the AssetEntity type.

The TencentDB Agent Memory repository (TencentCloud/TencentDB-Agent-Memory) implements a unified asset system that enables AI agents to retrieve, share, and evolve knowledge in a controlled manner. At its core, the model provides a standardized schema for managing the lifecycle, visibility, and injection of knowledge resources into agent prompting pipelines.

Core Components of the Memory Asset Model

The asset architecture revolves around several key TypeScript definitions located in metadata-types.ts and their corresponding service implementations.

AssetEntity: The Central Record

The AssetEntity type serves as the backbone of the Memory Asset Model, storing essential properties for any knowledge asset. According to the source code in [metadata-types.ts](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/feat/server_team/sdk/memory-core/typescript/src/v3/metadata-types.ts#L85‑L100), this interface captures:

  • Unique identifier (asset_id) and owning team (team_id)
  • Asset classification via asset_type and name
  • Visibility controls determining who can access the resource
  • Lifecycle status tracking maturity from draft to archived
  • Versioning and usage metrics for governance
  • Flexible metadata JSON for extensible properties

AssetType Categorization

The system recognizes four distinct asset categories through the AssetType enumeration (line 13 in metadata-types.ts):

  • skill – Executable capabilities and procedural knowledge
  • llm_wiki – RAG-ready documentation and reference material
  • code_graph – Structured code relationship data
  • chat_memory – Historical conversation context and extracted insights

This typed categorization allows the Memory Hub to handle each asset appropriately, applying RAG retrieval for Wiki content while enabling direct execution for Skills.

AssetVisibility and AssetStatus

Access control and lifecycle management are enforced through two critical enumerations:

AssetVisibility (line 14) defines five access tiers:

  • private – Restricted to the owner
  • team – Shared within the owning team
  • restricted – Limited to specific users or roles
  • agent – Accessible to specific agent instances
  • task – Scoped to particular task executions

AssetStatus (line 15) tracks the asset lifecycle:

  • draft – Initial creation phase
  • candidate – Under review
  • approved – Production-ready
  • deprecated – Scheduled for removal
  • archived – Retained but inactive
  • failed – Failed validation or processing

FixedAssetBindingEntity

Assets are attached to agents through the FixedAssetBindingEntity interface (lines 107‑113 in metadata-types.ts). This structure controls how assets are injected into agent contexts through:

  • Priority levels determining precedence when multiple assets conflict
  • Injection modes including direct (full content), summary (compressed), tool (callable interface), and reference (linked mention)

AclEntity for Fine-Grained Permissions

The AclEntity type (lines 118‑124) implements row-level security, granting or denying specific permissions (read, write, delete, assign, share, use) to individual users, team roles, or agent principals.

Storage and Service Architecture

The Memory Asset Model persists data through adaptable storage layers and exposes functionality via structured service boundaries.

Metadata Store Implementations

Assets are persisted through the MetadataStore contract, with two primary adapters:

Both implementations handle the complex relationships between assets, bindings, and ACL entries.

Service and API Layers

The MetadataService class (metadata-service.ts) encapsulates business logic for asset creation, validation, and binding enforcement. This service validates team-level permissions before accepting mutations.

HTTP endpoints defined in v3-meta-router.ts (v3-meta-router.ts line 244) map REST operations to service methods, exposing routes such as /asset/create, /asset/get, and /agent-fixed-asset/set.

Implementing the Memory Asset Model

The TypeScript SDK (memory-core) provides practical interfaces for interacting with the asset system. The MetadataClient class (metadata-client.ts) wraps the underlying HTTP endpoints with type-safe methods.

Creating and Binding Assets

import { MemoryClient } from 'memory-core';

// Initialize the client with endpoint configuration
const client = new MemoryClient({ 
  baseURL: 'https://memory.tencentcloud.com', 
  token: 'YOUR_TOKEN' 
});

// Create a new Skill asset with team visibility
await client.createAsset({
  asset_id: 'skill-001',
  team_id: 'team-abc',
  asset_type: 'skill',
  name: 'Release Skill',
  description: 'Steps to package and release a product',
  owner_user_id: 'user-123',
  source_type: 'manual',
  visibility: 'team',
  status: 'draft',
});

Configuring Agent Asset Bindings

Bind specific assets to agents with controlled injection parameters:

// Bind the skill to an agent with high priority and direct injection
await client.setAgentFixedAssets('agent-xyz', [
  {
    asset_id: 'skill-001',
    asset_type: 'skill',
    injection_mode: 'direct',
    priority: 10,
  },
]);

Querying and Updating Assets

Retrieve ACL-filtered asset lists and modify visibility:

// Query assets accessible to the current user
const assets = await client.listAccessibleAssets({
  asset_type: 'skill',
  visibility: 'team',
});

// Update asset visibility to restrict access
await client.updateAsset({
  asset_id: 'skill-001',
  visibility: 'private',
});

Summary

The Memory Asset Model in TencentDB Agent Memory provides a comprehensive framework for managing AI knowledge resources:

  • Unified schema via AssetEntity standardizes metadata across Chat Memory, Skills, Wiki pages, and Code Graphs
  • Four asset types (skill, llm_wiki, code_graph, chat_memory) enable specialized handling for different knowledge formats
  • Hierarchical visibility (private through task) and ACL entries enforce granular access control
  • Lifecycle management through AssetStatus ensures safe progression from draft to production to archival
  • Flexible binding with injection modes (direct, summary, tool, reference) controls how assets enter agent context

Frequently Asked Questions

How does the Memory Asset Model handle permissions for team collaboration?

The model implements a layered permission system combining AssetVisibility levels with AclEntity entries. Visibility settings provide coarse boundaries (private, team-wide, or agent-specific), while ACL entries grant fine-grained permissions (read, write, delete, assign, share, use) to specific users, roles, or agents. The MetadataService validates these permissions before executing create, update, or bind operations.

What are the differences between the four AssetType categories?

Each category determines how the Memory Hub processes the asset: Skills are executable procedures that agents can invoke as tools; LLM Wiki assets support RAG retrieval for factual grounding; Code Graph provides structured relationship data from codebases; Chat Memory stores conversational history and extracted insights for personalization. The AssetType field in AssetEntity routes each asset to appropriate processing pipelines.

How does asset injection work when binding assets to agents?

The FixedAssetBindingEntity controls injection through the injection_mode and priority fields. Direct mode inserts full asset content into the prompt; Summary mode compresses content to fit context limits; Tool mode exposes the asset as a callable function; Reference mode includes only a citation or link. Priority values resolve conflicts when multiple assets compete for limited context window space.

Which storage backends support the Memory Asset Model?

The architecture abstracts storage through the MetadataStore interface, with concrete implementations for SQLite (sqlite-adapter.ts) suitable for development or edge deployments, and MongoDB (mongodb-adapter.ts) for production-scale distributed systems. Both adapters persist the full AssetEntity schema along with binding and ACL relationships.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →