Skip to main content
Getting Started

Quick Start

Create a knowledge base in 5 steps and perform one retrieval and Q&A

After completing this guide, you’ll have created a document-based knowledge base, uploaded documents, experienced retrieval and Q&A in the Playground, and made a retrieval request via API.
When you first log in to the console, the RAG Knowledge Base service is automatically activated, and you receive a free quota of 720 hours.

Prerequisites

Procedure

1

Create a knowledge base and upload documents

Go to the console’s Data Ingestion → Knowledge Management and click Create Knowledge Base.
  1. Enter a name and description. Select Document Search as the knowledge base type and Basic Document Q&A as the use case, then click Next.
  2. Choose Upload Files as the data source, and drag & drop or click to upload a PDF / Word / Markdown file.
  3. Keep the indexing settings at their defaults and click Create Knowledge Base.
The system automatically performs parsing, chunking, vectorization, and index building. Once the knowledge base status changes to Ready, it becomes available for retrieval.
For complete configuration details—including knowledge base type, use case, chunking strategy, etc.—see Creating a Knowledge Base.
2

Try Q&A in the Playground

Click Playground on the left sidebar, select the knowledge base you just created, switch to Knowledge Q&A at the top, and enter a question.The system first retrieves relevant chunks, then invokes a large language model to generate an answer with citations. You can switch between different models (e.g., Qwen / DeepSeek) to compare results.
3

Integrate via API into your application

First, configure your API Key as an environment variable:
export DASHSCOPE_API_KEY="sk-xxxxxxxxxxxxxxxx"
Then make a retrieval request:
curl -X POST https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index/retrieve \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "index_id": "<knowledge-base-id>",
    "query": "<your-query>",
    "top_k": 5
  }'
You can copy the index_id by clicking the corresponding knowledge base on the Knowledge Management page. The returned nodes array contains matched chunks, sorted in descending order by relevance score.

Next Steps