@tablestore/agent-storage
v0.0.1
Published
TypeScript SDK for Tablestore agent storage
Readme
Tablestore Agent Storage TypeScript SDK
This package contains the TypeScript SDK for Tablestore agent storage, including knowledge-base and memory APIs.
Entrypoints
src/index.ts: cross-runtime core clientsrc/node.ts: Node-only client with local file upload support
Usage
import { AgentStorageClient } from './src/index.js';
const client = new AgentStorageClient({
endpoint: 'https://your-instance.cn-beijing.ots.aliyuncs.com',
instanceName: 'your-instance',
accessKeyId: process.env.OTS_ACCESS_KEY_ID!,
accessKeySecret: process.env.OTS_ACCESS_KEY_SECRET!,
});import { NodeAgentStorageClient } from './src/node.js';
const client = new NodeAgentStorageClient({
endpoint: 'https://your-instance.cn-beijing.ots.aliyuncs.com',
instanceName: 'your-instance',
accessKeyId: process.env.OTS_ACCESS_KEY_ID!,
accessKeySecret: process.env.OTS_ACCESS_KEY_SECRET!,
ossEndpoint: 'https://oss-cn-beijing.aliyuncs.com',
ossBucketName: 'tantan-source',
});Signatures
- default:
v2 - optional:
v4withregion
Input Modes
All APIs accept:
- plain JSON requests
- model instances with
toJSONRequest()
API Surface
AgentStorageClient: cross-runtime client for knowledge-base and memory APIsNodeAgentStorageClient: Node client that adds OSS-backed document upload
Memory APIs include:
- memory store lifecycle:
createMemoryStore,getMemoryStore,listMemoryStores,updateMemoryStore,deleteMemoryStore - memory CRUD/search:
addMemories,searchMemories,listMemories,getMemory,updateMemory,deleteMemory - audit/message queries:
listMemoryStoreMessages,listMemoryStoreRequests
Tests
Run unit tests:
npm run test:unitRun e2e tests:
OTS_ENDPOINT=https://your-instance.cn-beijing.ots.aliyuncs.com \
OTS_ACCESS_KEY_ID=your-ak \
OTS_ACCESS_KEY_SECRET=your-sk \
OTS_INSTANCE_NAME=your-instance \
OTS_REGION=cn-beijing \
OTS_SIGN_VERSION=v2 \
OSS_ENDPOINT=https://oss-cn-beijing.aliyuncs.com \
OSS_BUCKET_NAME=tantan-source \
npm run test:e2e