Skip to content
Go to Dashboard

Quickstart

Status

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.gumem.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 了解更适合生产环境的模块组合方式。