Skip to main content
agentscope-extensions-rag-bailian integrates Alibaba Cloud Bailian Knowledge Base — embeddings, indexing, and retrieval are all managed by Bailian. The Agent only sends the query and receives documents back.

When to use

  • Your documents are already uploaded and processed in the Bailian console.
  • You want enterprise features: rerank, filtering, and structured / unstructured / image KBs.
  • You don’t want to run your own vector store.

Add the dependency

Quickstart

Wire into an Agent

Or expose it as a tool:

Rerank / rewrite

BailianConfig.builder() accepts optional rerankConfig(...) and rewriteConfig(...):
When enabled, Bailian re-ranks initial recall results or rewrites the query for better relevance — at the cost of more latency and quota usage. Turn on what you actually need.

Retrieval only

BailianKnowledge.addDocuments(...) is unsupported — use the Bailian console or platform SDK to manage documents. This is consistent with Dify, HayStack, and RAGFlow integrations: third-party RAG platforms keep ingestion responsibility, the Java side only reads.

Configuration