CMDCRAGArcana.Maintenance (cmdc_rag_arcana v0.5.0)

Copy Markdown View Source

Arcana maintenance wrapper。

企业平台可从 Oban worker 或 release command 调用这里的函数,统一获得 telemetry 与 CMDC EventBus 进度事件。该模块不直接暴露给 Agent。

Summary

Functions

检测图 communities。

为图实体生成 embedding。

重建 GraphRAG 图索引。

重嵌入 collection 或全量 chunks。

生成 community summaries。

Functions

detect_communities(repo, opts \\ [])

@spec detect_communities(
  module(),
  keyword()
) :: {:ok, map()} | {:error, term()}

检测图 communities。

embed_entities(repo, opts \\ [])

@spec embed_entities(
  module(),
  keyword()
) :: {:ok, map()} | {:error, term()}

为图实体生成 embedding。

rebuild_graph(repo, opts \\ [])

@spec rebuild_graph(
  module(),
  keyword()
) :: {:ok, map()} | {:error, term()}

重建 GraphRAG 图索引。

reembed(repo, opts \\ [])

@spec reembed(
  module(),
  keyword()
) :: {:ok, map()} | {:error, term()}

重嵌入 collection 或全量 chunks。

选项:

  • :backend - 实现 CMDCRAGArcana.Maintenance.Backend 的模块。
  • :collection - 限定 collection。
  • :tenant_id / :session_id - 进度事件 metadata。
  • :progress - 用户自定义 progress callback,签名 fn current, total -> :ok end

summarize_communities(repo, opts \\ [])

@spec summarize_communities(
  module(),
  keyword()
) :: {:ok, map()} | {:error, term()}

生成 community summaries。