Quickstart
本页提供 SAK 的推荐集成路径。当前资料尚未给出正式 SDK 包名和 API 协议,因此这里使用概念性步骤表达产品接入顺序。
Status
正式 SDK 名称、安装命令、鉴权方式和 API schema 确认后,本页应升级为可复制运行的快速开始。
1. Create an agent profile
先定义 Agent 的角色、用途和权限边界。
ts
const agent = await sak.genauth.agents.create({
name: 'Research Agent',
owner: 'user_123',
purpose: 'Run web research and summarize findings'
})2. Delegate scoped authority
让 Agent 获得最小必要权限,而不是直接继承用户所有凭证。
ts
const auth = await sak.genauth.delegate({
userId: 'user_123',
agentId: agent.id,
scopes: ['web.search', 'web.extract'],
expiresIn: '30m'
})3. Recall user context
在执行任务前读取必要记忆。
ts
const memory = await sak.gum.recall({
userId: 'user_123',
query: 'laptop recommendations for local LLM workloads'
})4. Execute web work
使用 Web Agent 搜索、抽取和清洗网页内容。
ts
const results = await sak.web.search({
query: memory.rewrittenQuery,
authorization: auth.token
})Next step
阅读 Integration Patterns 了解更适合生产环境的模块组合方式。