How to Access the Memory Core v3 API Documentation

The Memory Core v3 API documentation is housed in MemoryCore/v3-api-memorycore-doc.md within the TencentDB-Agent-Memory repository, serving as the definitive reference for RPC-style endpoints available on port 8420.

The TencentDB-Agent-Memory project provides a persistent memory layer for AI agent systems through its Memory Core service (记忆内核). Accessing the Memory Core v3 API documentation allows developers to implement conversation history, atomic operations, and skill management using the stable v3 interface.

Where to Find the Memory Core v3 API Documentation

The comprehensive v3 API reference is maintained in the markdown file MemoryCore/v3-api-memorycore-doc.md. This document contains the complete specification for all RPC-style endpoints including conversation management, atomic operations, scenario handling, core utilities, skills, and knowledge bases.

You can view the documentation directly on GitHub at the following location:

The file is synchronized with every pull request that modifies the API, ensuring the repository always contains the current source of truth for the v3 interface.

Memory Core v3 API Conventions

All v3 endpoints follow consistent patterns for transport, authentication, and response formatting as implemented in the MemoryCore/index.ts entry point.

HTTP Transport and Headers

  • Method: All calls use POST requests with Content-Type: application/json
  • Port: The service exposes v3 endpoints on port 8420
  • Base URL: http://localhost:8420/v3/

Authentication Requirements

The API implements Layer 1 authentication using Bearer tokens:

Authorization: Bearer <KERNEL_AUTH_TOKEN>

Additional isolation context headers are required:

  • x-tdai-service-id: Service identifier (e.g., srv_123)
  • x-tdai-team-id: Team identifier
  • x-tdai-agent-id: Agent identifier
  • x-tdai-user-id: User identifier
  • x-tdai-task-id: Task identifier

Response Envelope and Pagination

Every response follows a standardized JSON envelope:

{
  "code": 0,
  "message": "ok",
  "request_id": "...",
  "data": { ... }
}

Error codes are numeric where 0 indicates success. For list-type endpoints, pagination uses:

  • limit: Number of results (default 20, maximum 100 unless specified otherwise)
  • offset: Starting position (default 0)

Practical Code Examples

The following examples demonstrate how to interact with key Memory Core v3 endpoints using curl. All request and response schemas are fully defined in the v3-api-memorycore-doc.md file.

Adding a Conversation Message

To append raw messages to a session using the /v3/conversation/add endpoint:

curl -X POST http://localhost:8420/v3/conversation/add \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <KERNEL_AUTH_TOKEN>" \
  -H "x-tdai-service-id: srv_123" \
  -d '{
    "session_id": "sess_1",
    "messages": [
      { "role": "user", "content": "帮我看看这个 bug" }
    ],
    "team_id": "t_1",
    "agent_id": "agt_1",
    "user_id": "u_1"
  }'

Querying L0 Conversation History

Retrieve historical messages using the /v3/conversation/query endpoint with pagination:

curl -X POST http://localhost:8420/v3/conversation/query \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <KERNEL_AUTH_TOKEN>" \
  -H "x-tdai-service-id: srv_123" \
  -d '{
    "session_id": "sess_1",
    "limit": 10,
    "offset": 0,
    "team_id": "t_1",
    "agent_id": "agt_1",
    "user_id": "u_1"
  }'

Creating a New Skill

Define agent capabilities using the /v3/skill/create endpoint:

curl -X POST http://localhost:8420/v3/skill/create \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <KERNEL_AUTH_TOKEN>" \
  -d '{
    "team_id": "t_1",
    "agent_id": "agt_1",
    "user_id": "u_1",
    "name": "code-review",
    "content": "---\nname: code-review\n---\n# Code Review"

  }'

Key Source Files and Implementation

Understanding the underlying implementation helps when working with the Memory Core v3 API documentation:

  • MemoryCore/index.ts: The entry point that registers v3 route handlers and connects them to the underlying services
  • MemoryCore/src/utils/: Contains utility modules including the pipeline manager, stateful queue, and environment handling used by the API implementation
  • MemoryCore/package.json: Defines project metadata and dependencies for the Memory Core service
  • MemoryCore/Dockerfile: Build configuration that exposes port 8420 for containerized deployments

Summary

  • The Memory Core v3 API documentation is located at MemoryCore/v3-api-memorycore-doc.md in the TencentDB-Agent-Memory repository
  • The v3 service runs on port 8420 and accepts POST requests with application/json payloads
  • Authentication requires a Bearer token plus isolation headers including x-tdai-service-id and x-tdai-team-id
  • Responses follow a standardized envelope with numeric code fields and support pagination via limit and offset parameters
  • Implementation code in MemoryCore/index.ts and utility modules handle the RPC routing and business logic

Frequently Asked Questions

Where is the Memory Core v3 API documentation located?

The documentation resides in the MemoryCore/v3-api-memorycore-doc.md file within the TencentDB-Agent-Memory repository on the feat/server_team branch. This markdown file serves as the primary reference for all v3 endpoints and is updated with every API change.

What authentication is required for Memory Core v3 API calls?

All v3 endpoints require an Authorization: Bearer <KERNEL_AUTH_TOKEN> header for Layer 1 authentication. Additionally, you must provide isolation context headers including x-tdai-service-id, x-tdai-team-id, x-tdai-agent-id, and x-tdai-user-id to identify the execution scope.

Which port does the Memory Core v3 API use?

The Memory Core v3 API exposes its RPC-style endpoints on port 8420 by default. This is configured in the service entry point and exposed in the provided Dockerfile for containerized deployments.

How does the v3 API differ from v1 and v2?

The v3 API represents the current stable surface for the Memory Core service, while v1 and v2 endpoints are deprecated and listed only in the "废弃接口" (obsolete interfaces) section of the documentation for reference. The v3 interface provides standardized response envelopes, consistent pagination, and improved isolation through mandatory context headers.

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 →