📚aidp-knowledge-bases
- ソース
- GitHub で見る ↗
説明
RAG のための AIDP ナレッジベースを構築・管理します — カタログデータ上に KB を作成し、埋め込みモデルとチャンキング方式を選択、HNSW/IVF ベクトルインデックスを構築、データソース(ボリューム/テーブル)を追加、インジェスチョンジョブを実行、および KB のパーミッションを管理します。 次のような場合に使用: ユーザーが RAG、ナレッジベース、ドキュメント/ベクトル検索、エンベディング、セマンティック検索を必要とする場合、または RAG_TOOL の agent-flow ノードにデータを供給したい場合。 本プラグインはコーパス/インデックスレイヤーを担当します。構築した KB に対してクエリを実行する agent は、`aidp-agent-flows`(RAG_TOOL)または `aidp-agent-highcode` 上で作成します。
原文を表示
Build and manage AIDP Knowledge Bases for RAG — create a KB over catalog data, pick an embedding model + chunking, build an HNSW/IVF vector index, add data sources (volume/table), run ingestion jobs, and manage KB permissions. Use when the user wants RAG, a knowledge base, document/vector search, embeddings, semantic retrieval, or to feed a RAG_TOOL agent-flow node. This is the corpus/index layer; the agent that queries it is authored in aidp-agent-flows (RAG_TOOL) or aidp-agent-highcode.
ユースケース
- ✓RAG システムのためのナレッジベースを構築する
- ✓ドキュメント/ベクトル検索を実行するとき
- ✓セマンティック検索を行うとき
- ✓RAG_TOOL にデータを供給するとき
- ✓ベクトルインデックスを管理する
本文(日本語訳)
aidp-knowledge-bases — RAG コーパス + ベクターインデックス
Knowledge Base は AIDP が管理する RAG ストアです。ソースデータをベクターインデックスに埋め込み、直接、またはエージェントフロー内の RAG_TOOL ノードを経由して検索できます。LA AgentFlows ファミリー REST API 上で動作します。
エンジン:
oci raw-request --profile DEFAULT(v1.0.0 では KB 用の CLI グループなし)。Lake スコープ。 2026-06-10 実機検証済み:GET …/dataLakes/<ocid>/knowledgeBases?catalogKey=<key>&schemaKey=<key>→ 400 InvalidParameter はルートが存在するものの、実際の catalog/schema キーが必要であることを意味します(aidp-catalog-exploreで解決してください)。 ワークスペーススコープのパスは 404 になります。 書き込み操作の前に必ず実機で読み取りを確認し、references/rest-endpoint-map.mdに記録してください。2026-06-10 de-agent 実機検証・訂正: クエリ文字列なしの素の
GET …/knowledgeBasesは 400 InvalidParameter を返し、schemaKeyとcatalogKeyの両方のクエリパラメーターが必要です。 ルート自体はプロビジョニング済み(Lake スコープ)であり、400 の原因はルートの欠如ではなくパラメーターの欠如です。
次のような場合に使用
- 「RAG / Knowledge Base / ベクターインデックスを構築したい」「これらのドキュメント/テーブルを埋め込みたい」「X に対してセマンティック検索を行いたい」、またはエージェントフローの
RAG_TOOLノードのための前処理が必要な場合。 - 対象外: アドホックな LLM-in-SQL(→
aidp-ai-sql)、KB を利用する側のエージェント(→aidp-agent-flows/aidp-agent-highcode)。
KB の作成(CreateKnowledgeBaseDetails、ワイヤーフィールドは camelCase)
POST …/dataLakes/<ocid>/knowledgeBases
{
"displayName": "policy_kb",
"description": "RAG over policy docs",
"catalogKey": "<catalog-key>", "schemaKey": "<schema-key>",
"workspaceKey": "<ws-key>", "clusterKey": "<cluster-key>",
"type": "...", "modality": "...",
"embeddingModelSourceType": "...", "embeddingModelName": "<embedding-model>",
"chunkSize": 512, "chunkOverlap": 64,
"sourceFilePattern": "*.pdf",
"indexDetails": { "type": "HNSW", "distance": "COSINE", "neighbors": 32, "efConstruction": 200, "targetAccuracy": 95 }
}
-
indexDetails.typeはHNSW|IVFのいずれか。 両方のインデックスタイプで、以下の 7 値からなるdistance列挙型を使用できます:COSINE|DOT|EUCLIDEAN|HAMMING|JACCARD|L2_SQUARED|MANHATTAN(SDK:KbVHnswIndexDetails/KbVIvfIndexDetailsのdistanceセッターのallowed_values—kb_v_hnsw_index_details.py:110、kb_v_ivf_index_details.py:110)。 以下のチューニング値はあくまで例示です。 -
HNSW チューニングパラメーター(SDK:
KbVHnswIndexDetails、ワイヤーフィールドは camelCase、すべてint—kb_v_hnsw_index_details.py:74-79):フィールド 意味 neighbors各ベクターが任意のレイヤーで持てる最大近傍数(HNSW の M パラメーター) — :146efConstructionインデックス構築時に検討する最近傍候補の最大数 — :170targetAccuracy目標精度(1〜100 のパーセンテージ) — :122 -
IVF チューニングパラメーター(SDK:
KbVIvfIndexDetails、ワイヤーフィールドは camelCase、すべてint—kb_v_ivf_index_details.py:74-79):フィールド 意味 neighborPartitionsベクターデータを分割するパーティション(クラスター)数 — :146neighborPartitionProbes検索時に探索する最大パーティション数(大きいほど精度向上・速度低下) — :170targetAccuracy目標精度(1〜100 のパーセンテージ) — :122 -
embeddingModelName/SourceType— 利用可能な埋め込みモデルはaidp-models-catalog(modelType=EMBEDDING)で一覧取得してください。埋め込み計算には RUNNING 状態のclusterKeyが必要です。 -
事前検証について: 上記フィールド名は SDK の
CreateKnowledgeBaseDetailsに基づくものです。create 操作は埋め込み計算を起動するため、ラウンドトリップ検証は未実施です。本番環境での作成前に、埋め込みモデルおよびtype/modalityの列挙値を実機読み取りまたはaidp helpで必ず確認してください。値を推測して使用しないでください。
インジェスト + メンテナンス
| 操作 | エンドポイント / ボディ |
|---|---|
| データソースの追加/削除 | UpdateKnowledgeBaseAddSourceDetails / …DeleteSourceDetails(ソース種別: volume / table) |
| インジェストジョブの実行 | POST …/knowledgeBases/<key>/jobs — CreateKnowledgeBaseJobDetails {displayName, type, goal, sources, sourceKey, schedule}; …/jobs/<key>/jobRuns でジョブランをトリガー |
| ジョブランの一覧取得 / ステータス確認 | GET …/knowledgeBases/<key>/jobs/<key>/jobRuns |
| 権限管理 | KnowledgeBasePermission の assign / manage / revoke(プリンシパルは aidp-roles-access を参照) |
| KB の更新 / 削除 | PUT / DELETE …/knowledgeBases/<key> |
エージェントとの連携
インデックスが構築されたら、RAG_TOOL ノード(aidp-agent-flows、references/agent-flow-nodes.md 参照)またはハイコード(aidp-agent-highcode)から KB を参照してください。RAG ツールが検索を行うには、KB が存在し、かつインジェスト済みである必要があります。
ガードレール
- ミューテーションゲート: KB の作成・インジェストは埋め込み計算リソースを消費します。リクエストボディを提示して事前確認を取り、
.aidp/payloads/に保存してください(references/payloads.md)。 catalogKey/schemaKey/clusterKey(実際のキー)は、事前にaidp-catalog-explore/aidp-cluster-opsで解決してください。
参考情報
- aidp-agent-flows(RAG_TOOL コンシューマー) · aidp-models-catalog(埋め込みモデル) · aidp-catalog-explore(キーの解決)
- references/oci-raw-request.md · references/rest-endpoint-map.md · references/payloads.md
原文(English)を表示
aidp-knowledge-bases — RAG corpus + vector index
A Knowledge Base is AIDP's managed RAG store: it embeds source data into a vector index you can retrieve from
(directly, or via a RAG_TOOL node in an agent flow). Runs over the LA AgentFlows family REST API.
Engine:
oci raw-request --profile DEFAULT(no CLI group for KB in v1.0.0). Lake-scoped, live-verified 2026-06-10:GET …/dataLakes/<ocid>/knowledgeBases?catalogKey=<key>&schemaKey=<key>→ 400 InvalidParameter means the route exists but needs real catalog/schema keys (resolve viaaidp-catalog-explore); the workspace-scoped path 404s. Confirm with a live read before any write; record inreferences/rest-endpoint-map.md.Live-verified 2026-06-10 on de-agent — correction: a bare
GET …/knowledgeBases(no query string) returns 400 InvalidParameter requiring bothschemaKeyandcatalogKeyquery params — the route is provisioned (lake-scoped), it is the missing params that 400, not a missing route.
When to use
- "Build a RAG / knowledge base / vector index", "embed these docs/tables", "semantic search over X",
or any prerequisite for a
RAG_TOOLagent-flow node. - NOT ad-hoc LLM-in-SQL (→
aidp-ai-sql); NOT the agent that uses the KB (→aidp-agent-flows/aidp-agent-highcode).
Create a KB (CreateKnowledgeBaseDetails, camelCase wire fields)
POST …/dataLakes/<ocid>/knowledgeBases
{
"displayName": "policy_kb",
"description": "RAG over policy docs",
"catalogKey": "<catalog-key>", "schemaKey": "<schema-key>",
"workspaceKey": "<ws-key>", "clusterKey": "<cluster-key>",
"type": "...", "modality": "...",
"embeddingModelSourceType": "...", "embeddingModelName": "<embedding-model>",
"chunkSize": 512, "chunkOverlap": 64,
"sourceFilePattern": "*.pdf",
"indexDetails": { "type": "HNSW", "distance": "COSINE", "neighbors": 32, "efConstruction": 200, "targetAccuracy": 95 }
}
-
indexDetails.type∈HNSW|IVF. Both index types accept the full 7-valuedistanceenum:COSINE|DOT|EUCLIDEAN|HAMMING|JACCARD|L2_SQUARED|MANHATTAN(SDKKbVHnswIndexDetails/KbVIvfIndexDetailsdistancesetterallowed_values—kb_v_hnsw_index_details.py:110,kb_v_ivf_index_details.py:110). Tuning values below are illustrative. -
HNSW tuning params (SDK
KbVHnswIndexDetails, camelCase wire fields, allint—kb_v_hnsw_index_details.py:74-79):Field Meaning neighborsmax neighbors each vector can have on any layer (the HNSW M parameter) — :146efConstructionmax closest-vector candidates considered during index construction — :170targetAccuracytarget accuracy percentage 1–100 — :122 -
IVF tuning params (SDK
KbVIvfIndexDetails, camelCase wire fields, allint—kb_v_ivf_index_details.py:74-79):Field Meaning neighborPartitionsnumber of partitions (clusters) to divide the vector data into — :146neighborPartitionProbesmax partitions to probe during a search (higher = more accurate, slower) — :170targetAccuracytarget accuracy percentage 1–100 — :122 -
embeddingModelName/SourceType— list available embedding models viaaidp-models-catalog(modelType=EMBEDDING); needs a RUNNINGclusterKeyfor embedding compute. -
Verify-first: the field names above are from the SDK
CreateKnowledgeBaseDetails; the create was not round-tripped (it triggers embedding compute). Confirm the embedding-model +type/modalityenums against a live read /aidp helpbefore a production create — do not invent values.
Ingest + maintain
| Action | Endpoint / body |
|---|---|
| Add/remove a data source | UpdateKnowledgeBaseAddSourceDetails / …DeleteSourceDetails (source kind volume / table) |
| Run an ingestion job | POST …/knowledgeBases/<key>/jobs — CreateKnowledgeBaseJobDetails {displayName, type, goal, sources, sourceKey, schedule}; trigger runs via …/jobs/<key>/jobRuns |
| List job runs / status | GET …/knowledgeBases/<key>/jobs/<key>/jobRuns |
| Permissions | assign/manage/revoke KnowledgeBasePermission (aidp-roles-access for principals) |
| Update / delete KB | PUT/DELETE …/knowledgeBases/<key> |
Wire it to an agent
Once the index is built, reference the KB from a RAG_TOOL node (aidp-agent-flows,
references/agent-flow-nodes.md) or from high-code (aidp-agent-highcode). The KB must exist + be ingested
before the RAG tool can retrieve.
Guardrails
- Mutation gate: KB create/ingest consumes embedding compute — show the body, confirm first, persist to
.aidp/payloads/(references/payloads.md). - Resolve
catalogKey/schemaKey/clusterKey(real keys) first viaaidp-catalog-explore/aidp-cluster-ops.
References
- aidp-agent-flows (RAG_TOOL consumer) · aidp-models-catalog (embedding models) · aidp-catalog-explore (keys)
- references/oci-raw-request.md · references/rest-endpoint-map.md · references/payloads.md
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。