跳转至

public.agents_memory_entry_candidates

列

名称 类型 默认值 可空 子表 父表 备注
agentId varchar(36) false public.agents 拥有此情景记忆捕获候选项的 Agent
attemptCount smallint 0 false 处理失败的尝试次数
content text false Agent 提出的持久化记忆内容
createdAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false
evidenceText text false 来自源消息的经脱敏处理的确切证据
id varchar(36) false public.agents_memory_entry_sources
kind varchar(32) false Agent 标记此候选的原因;参见 @n8n/agents 中的 EpisodicMemoryCaptureKind
resourceId varchar(255) false public.agents_resources 最终情景记忆条目的资源作用域
runId varchar(255) false 发出记忆捕获工具调用的 Agent 运行
sourceMessageId varchar(36) true public.agents_messages 包含确切源证据的持久化消息
status varchar(16) 'pending'::character varying false 候选处理状态
threadId varchar(255) false public.agents_threads Agent 标记此候选所在的对话线程
toolCallId varchar(255) false 用于保证入队重放安全性的模型工具调用 ID
updatedAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false

约束

名称 类型 定义
CHK_agents_memory_entry_candidates_status CHECK CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'completed'::character varying, 'failed'::character varying, 'deleted'::character varying])::text[])))
FK_5123f71435736664d2676084a85 FOREIGN KEY FOREIGN KEY ("resourceId") REFERENCES agents_resources(id) ON DELETE CASCADE
FK_ac7ada75df7cc8ced228921d5a9 FOREIGN KEY FOREIGN KEY ("threadId") REFERENCES agents_threads(id) ON DELETE CASCADE
FK_b3d0f5fe54565580bc1f5febb6e FOREIGN KEY FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE
FK_f1857f6716aa258393dd6f33243 FOREIGN KEY FOREIGN KEY ("sourceMessageId") REFERENCES agents_messages(id) ON DELETE SET NULL
PK_d5c36484cafd23222df4c564159 PRIMARY KEY PRIMARY KEY (id)
agents_memory_entry_candidates_agentId_not_null n NOT NULL "agentId"
agents_memory_entry_candidates_attemptCount_not_null n NOT NULL "attemptCount"
agents_memory_entry_candidates_content_not_null n NOT NULL content
agents_memory_entry_candidates_createdAt_not_null n NOT NULL "createdAt"
agents_memory_entry_candidates_evidenceText_not_null n NOT NULL "evidenceText"
agents_memory_entry_candidates_id_not_null n NOT NULL id
agents_memory_entry_candidates_kind_not_null n NOT NULL kind
agents_memory_entry_candidates_resourceId_not_null n NOT NULL "resourceId"
agents_memory_entry_candidates_runId_not_null n NOT NULL "runId"
agents_memory_entry_candidates_status_not_null n NOT NULL status
agents_memory_entry_candidates_threadId_not_null n NOT NULL "threadId"
agents_memory_entry_candidates_toolCallId_not_null n NOT NULL "toolCallId"
agents_memory_entry_candidates_updatedAt_not_null n NOT NULL "updatedAt"

索引

名称 定义
IDX_5123f71435736664d2676084a8 CREATE INDEX "IDX_5123f71435736664d2676084a8" ON public.agents_memory_entry_candidates USING btree ("resourceId")
IDX_6dc22e132cf1a34e5bca672b99 CREATE INDEX "IDX_6dc22e132cf1a34e5bca672b99" ON public.agents_memory_entry_candidates USING btree ("agentId", "resourceId", status, "createdAt", id)
IDX_ac7ada75df7cc8ced228921d5a CREATE INDEX "IDX_ac7ada75df7cc8ced228921d5a" ON public.agents_memory_entry_candidates USING btree ("threadId")
IDX_e3e49861a5452db63b036a2561 CREATE UNIQUE INDEX "IDX_e3e49861a5452db63b036a2561" ON public.agents_memory_entry_candidates USING btree ("agentId", "runId", "toolCallId")
IDX_f1857f6716aa258393dd6f3324 CREATE INDEX "IDX_f1857f6716aa258393dd6f3324" ON public.agents_memory_entry_candidates USING btree ("sourceMessageId")
PK_d5c36484cafd23222df4c564159 CREATE UNIQUE INDEX "PK_d5c36484cafd23222df4c564159" ON public.agents_memory_entry_candidates USING btree (id)

关系

erDiagram

"public.agents_memory_entry_candidates" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"
"public.agents_memory_entry_sources" }o--o| "public.agents_memory_entry_candidates" : "FOREIGN KEY (#quot;candidateId#quot;) REFERENCES agents_memory_entry_candidates(id) ON DELETE CASCADE"
"public.agents_memory_entry_candidates" }o--|| "public.agents_resources" : "FOREIGN KEY (#quot;resourceId#quot;) REFERENCES agents_resources(id) ON DELETE CASCADE"
"public.agents_memory_entry_candidates" }o--o| "public.agents_messages" : "FOREIGN KEY (#quot;sourceMessageId#quot;) REFERENCES agents_messages(id) ON DELETE SET NULL"
"public.agents_memory_entry_candidates" }o--|| "public.agents_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agents_threads(id) ON DELETE CASCADE"

"public.agents_memory_entry_candidates" {
  varchar_36_ agentId FK
  smallint attemptCount
  text content
  timestamp_3__with_time_zone createdAt
  text evidenceText
  varchar_36_ id
  varchar_32_ kind
  varchar_255_ resourceId FK
  varchar_255_ runId
  varchar_36_ sourceMessageId FK
  varchar_16_ status
  varchar_255_ threadId FK
  varchar_255_ toolCallId
  timestamp_3__with_time_zone updatedAt
}
"public.agents" {
  varchar_36_ activeVersionId FK
  varchar_36_ approvalWorkflowId FK
  boolean availableInMCP
  timestamp_3__with_time_zone createdAt
  varchar_36_ id
  uuid identityId FK
  json integrations
  boolean isArchived
  varchar_128_ name
  varchar_36_ parentFolderId FK
  varchar_255_ projectId FK
  integer publicationRevision
  integer revision
  json schema
  varchar_16_ scope
  timestamp_3__with_time_zone setupCompletedAt
  json skills
  json tools
  timestamp_3__with_time_zone updatedAt
  varchar_36_ versionId
}
"public.agents_memory_entry_sources" {
  varchar_36_ agentId FK
  varchar_36_ candidateId FK
  timestamp_3__with_time_zone createdAt
  varchar_64_ evidenceHash
  text evidenceText
  varchar_36_ id
  varchar_36_ memoryEntryId FK
  varchar_36_ observationId FK
  varchar_255_ threadId FK
  timestamp_3__with_time_zone updatedAt
}
"public.agents_resources" {
  timestamp_3__with_time_zone createdAt
  varchar_255_ id
  text metadata
  timestamp_3__with_time_zone updatedAt
}
"public.agents_messages" {
  json author
  json content
  timestamp_3__with_time_zone createdAt
  varchar_36_ id
  json modelContent
  timestamp_3__with_time_zone modelContextAt
  json origin
  varchar_255_ resourceId
  varchar_36_ role
  varchar_255_ threadId FK
  varchar_36_ type
  timestamp_3__with_time_zone updatedAt
}
"public.agents_threads" {
  timestamp_3__with_time_zone createdAt
  varchar_128_ id
  text metadata
  varchar_255_ resourceId
  varchar_255_ title
  timestamp_3__with_time_zone updatedAt
}

由 tbls 生成

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 n8/n8n