Types of Memory Assets in TencentDB Agent Memory and Their Storage Locations
TencentDB Agent Memory defines four distinct memory asset types—skill, llm_wiki, code_graph, and chat_memory—that are persisted across a hierarchical storage backend comprising COS, SQLite, and in-memory caches, with metadata definitions declared in sdk/memory-core/typescript/src/v3/metadata-types.ts.
TencentDB Agent Memory is an open-source framework that structures reusable knowledge units for AI agents. Understanding the specific types of memory assets and their physical storage locations enables developers to optimize retrieval latency, configure appropriate persistence layers, and manage data lifecycle in production environments.
The Four Core Memory Asset Types
The system classifies every memory asset as a discrete unit of reusable knowledge that agents can load, query, or update. These assets are partitioned into four categories defined in the metadata model.
Skill Assets
Skill assets are executable playbooks encoding how a task should be performed, including orchestration scripts and AI-assisted operational procedures. According to the source code, these assets store their metadata records in the metadata store (SQLite by default) while the actual skill payload resides in the Memory Core, specifically handled by MemoryCore/src/metadata/store/sqlite-adapter.ts.
LLM Wiki Assets
LLM wiki assets consist of structured textual knowledge pages optimized for retrieval-augmented generation (RAG) workflows. These assets persist in the Wiki store under the Memory Knowledge component, backed by a SQLite database implementation found in MemoryKnowledge/src/store/sqlite-store.ts.
Code Graph Assets
Code graph assets represent knowledge graphs of source-code entities—including functions, classes, and dependencies—enabling semantic code search. These are kept in the Code-Graph store of the Memory Knowledge service, utilizing the same SQLite backend (MemoryKnowledge/src/store/sqlite-store.ts) that manages the Wiki tables.
Chat Memory Assets
Chat memory assets capture session-level conversational context and historical interactions for future retrieval. These records are saved in the Chat Memory tables of the core metadata store (SQLite) and can be optionally mirrored to COS (Cloud Object Storage) for distributed deployments, as implemented in MemoryCore/src/metadata/store/sqlite-adapter.ts.
Storage Backend Architecture
The physical storage of memory assets follows a configurable hierarchy defined in MemoryCore/src/gateway/config.ts. Developers can select backends based on durability requirements and deployment scale.
Metadata Type Definitions
All asset classifications—including AssetType, AssetVisibility, and AssetStatus—are centralized in sdk/memory-core/typescript/src/v3/metadata-types.ts of the TypeScript SDK. This module serves as the single source of truth for the asset taxonomy and lifecycle states.
SQLite Persistence Layer
SQLite functions as the default local backend for development and offline modes. The architecture separates concerns across two primary adapters:
MemoryCore/src/metadata/store/sqlite-adapter.tsmanages core asset metadata, skill payloads, and chat memory tables.MemoryKnowledge/src/store/sqlite-store.tsprovides dedicated tables for Wiki and Code-Graph storage.
Cloud Object Storage (COS)
For production-grade, multi-node persistence, TencentDB Agent Memory supports COS as the primary durable backend. When configured, asset payloads and metadata replicas are synchronized to COS, ensuring availability across distributed agent deployments while maintaining the SQLite layer for local caching.
Hierarchical Backend Priority
The gateway configuration establishes the following fallback chain:
- COS – Distributed object storage for production clusters.
- SQLite – Local file-based database using
node:sqliteorbetter-sqlite3. - File System (FS) – Simple JSON/flat-file fallback for minimal deployments.
- In-memory – Ephemeral storage active when all persistent backends are unavailable.
Working with Memory Assets Programmatically
The TypeScript SDK provides unified clients for interacting with memory assets across all storage backends.
Querying Assets by Type
import { MetadataClient } from '@tencentdb/memory-core';
// Initialize client with default SQLite backend
const client = new MetadataClient({ backend: 'sqlite' });
// Retrieve all skill assets with team visibility
const skillAssets = await client.searchAssets({
type: 'skill',
visibility: 'team',
});
console.log('Skill assets:', skillAssets);
Creating LLM Wiki Assets
// Insert a new LLM-wiki asset into the metadata store
await client.createAsset({
type: 'llm_wiki',
name: 'API Integration Guide',
visibility: 'private',
status: 'draft',
content: '## Overview\nThis wiki explains the integration steps...',
});
Retrieving Chat Memory
import { MemoryClient } from '@tencentdb/memory-core';
const mem = new MemoryClient({ backend: 'sqlite' });
// Query recent chat sessions from SQLite store
const recentChats = await mem.searchChatMemory({ limit: 10 });
console.log('Recent conversations:', recentChats);
Summary
- Four asset types—
skill,llm_wiki,code_graph, andchat_memory—represent distinct knowledge categories with specialized storage requirements. - Metadata definitions reside in
sdk/memory-core/typescript/src/v3/metadata-types.ts, establishing the schema for asset types, visibility levels, and status fields. - Storage hierarchy prioritizes COS for production, SQLite for development (
MemoryCore/src/metadata/store/sqlite-adapter.tsandMemoryKnowledge/src/store/sqlite-store.ts), File System for minimal setups, and in-memory for ephemeral caching. - Programmatic access is unified through
MetadataClientandMemoryClient, enabling CRUD operations across all backend types without modifying storage-specific logic.
Frequently Asked Questions
What are the four types of memory assets in TencentDB Agent Memory?
TencentDB Agent Memory categorizes knowledge into skill (executable playbooks), llm_wiki (structured textual knowledge), code_graph (source-code entity relationships), and chat_memory (conversational session logs). These types are enumerated in the AssetType definition within src/v3/metadata-types.ts.
Where is asset metadata stored in TencentDB Agent Memory?
Asset metadata—including type, visibility, status, and ownership—is primarily stored in SQLite databases via MemoryCore/src/metadata/store/sqlite-adapter.ts. In production deployments, this metadata is replicated to COS (Cloud Object Storage) for distributed access, while the Memory Knowledge component maintains separate SQLite tables in MemoryKnowledge/src/store/sqlite-store.ts for Wiki and Code-Graph assets.
How do I query specific asset types using the SDK?
Import MetadataClient from @tencentdb/memory-core and invoke searchAssets() with a filter object specifying the type property (e.g., { type: 'skill', visibility: 'team' }). This method queries the configured backend—whether SQLite, COS, or in-memory—and returns matching asset records with full metadata.
What storage backends does TencentDB Agent Memory support?
The framework supports a four-tier hierarchy: COS for production distributed storage, SQLite for local file-based persistence, File System (JSON/flat-file) for lightweight deployments, and In-memory for ephemeral caching. Backend selection is configurable via MemoryCore/src/gateway/config.ts, defaulting to SQLite when no external storage is specified.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →