All Products
Search
Document Center

OpenSearch:Tutorial deep search

Last Updated:Jun 22, 2026

Deep search adalah sistem tanya jawab (Q&A) profesional berbasis arsitektur multi-agent yang menghasilkan jawaban yang tepat, fokus, dan mendetail. Sistem ini mampu mengambil data secara efisien, memahami maksud pengguna, mengintegrasikan informasi dari berbagai sumber, serta menghasilkan respons komprehensif dan terstruktur. Berbeda dengan mesin pencari tradisional, deep search unggul dalam memecah pertanyaan kompleks, mengintegrasikan data dari berbagai sumber, dan menghubungkan pengetahuan lintas domain.

Perbandingan kemampuan

Tabel berikut membandingkan deep search dengan pencarian AI tradisional.

Dimensi

Deep search

Pencarian AI tradisional

Pemahaman

Inferensi kontekstual dan pengenalan maksud.

Pengambilan berbasis semantik dan kata kunci.

Mode respons

Secara proaktif meminta klarifikasi, seperti rentang waktu atau cakupan wilayah.

Hanya menerima kueri asli secara pasif.

Sumber data

Mendukung agregasi lintas platform dari sumber seperti data privat, web, dan database.

Mengandalkan satu sumber data saja.

Kerapatan pengetahuan

Mengembalikan beberapa referensi yang dikutip dalam satu respons untuk menjawab pertanyaan secara akurat.

Hanya mengembalikan 3 hingga 5 cuplikan data relevan tetap.

Kedalaman interaksi

Mendukung percakapan profesional berkelanjutan dengan banyak giliran.

Jumlah giliran percakapan sangat memengaruhi hasilnya.

Jenis pertanyaan yang sesuai

Pertanyaan kompleks dan terbuka untuk tugas seperti analisis atau perbandingan.

Pertanyaan faktual sederhana.

Arsitektur

Deep search dibangun di atas arsitektur multi-agent dan terdiri dari agen-agen berikut:

  • Query understanding agent: Memahami dan menulis ulang kueri asli pengguna.

  • Autonomous planning agent: Mengidentifikasi maksud pengguna, merencanakan dan menyesuaikan jalur eksekusi, serta memvalidasi dan mengoreksi jawaban.

  • Search agent: Mengambil dan meringkas pengetahuan untuk percakapan saat ini.

  • Casual chat agent: Merespons masukan percakapan, seperti "Hello".

  • Clarification agent: Menghasilkan pertanyaan lanjutan untuk mengklarifikasi kueri pengguna yang ambigu.

  • Summary agent: Menghasilkan jawaban akhir atas pertanyaan pengguna.

Penggunaan

Konsol

1. Masuk ke Konsol OpenSearch dan pilih OpenSearch LLM-Based Conversational Search Edition. Di panel navigasi sebelah kiri, klik Instance Management. Temukan instans yang ingin Anda kelola, lalu klik Manage di kolom Actions.

2. Di halaman detail instans, klik Q&A Test. Aktifkan Deep Search, masukkan kueri Anda di kotak dialog, lalu klik Send.

3. Lihat hasil uji tanya jawab.

API

Parameter permintaan

Parameter

Tipe

Wajib

Bawaan

Deskripsi

options.chat.enable_deep_search

Boolean

Tidak

true

Menentukan apakah akan mengaktifkan deep search.

  • true: Mengaktifkan deep search. Layanan melakukan beberapa putaran penalaran dan mensintesis data untuk menghasilkan respons. Satu sesi percakapan mengonsumsi lebih banyak waktu dan sumber daya komputasi.

  • false: Menonaktifkan deep search.

options.chat.agent.think_process

Boolean

Tidak

true

Menentukan apakah akan mengembalikan proses berpikir.

options.chat.agent.max_think_round

Integer

Tidak

10

Jumlah putaran berpikir (maksimum: 20).

options.chat.agent.language

String

Tidak

AUTO

Bahasa yang digunakan untuk proses berpikir dan jawaban.

AUTO: Secara otomatis menentukan apakah menggunakan bahasa Tiongkok atau Inggris berdasarkan kueri pengguna.

CN: Bahasa Tiongkok.

EN: Bahasa Inggris.

Catatan

Untuk daftar lengkap parameter pengujian Q&A, lihat Parameter Q&A.

Contoh isi permintaan

{
    "question" : {
        "text" : "Recommend 3 Jay Chou albums",
        "type" : "TEXT"
    },
    "options": {
      "retrieve": {
      "web_search": {
        "enable": true
        }
      },
      "chat": {
        "enable_deep_search": true,
        "model": "qwen3-235b-a22b"
      },
      "agent": {
        "think_process": true,
        "max_think_round": 10,
        "language": "AUTO"
      }
    }
  }

Parameter respons

Parameter

Tipe

Deskripsi

request_id

String

ID permintaan.

status

String

Status pemrosesan permintaan.

  • OK: Permintaan berhasil.

  • FAIL: Permintaan gagal.

latency

Float

Waktu yang diperlukan server untuk memproses permintaan yang berhasil, dalam milidetik.

id

Integer

ID primary key.

title

String

Judul dokumen.

category

String

Nama kategori.

url

String

URL dokumen.

answer

String

Hasil tanya jawab.

type

String

Tipe hasil yang dikembalikan.

scores

Array

Skor konten dokumen.

event

String

Event berpikir.

Satu putaran berpikir terdiri dari event THINK, ACTION, dan ANSWER, meskipun THINK tidak selalu dikembalikan. THINK menunjukkan agen sedang melakukan penalaran, ACTION menunjukkan aksi yang sedang dilakukan, dan ANSWER memberikan kesimpulan untuk putaran tersebut. Event SUMMARY berisi jawaban akhir, dan hanya satu event SUMMARY yang dikembalikan per permintaan.

event_status

String

Menunjukkan apakah hasil sudah lengkap.

PROCESSING: Jawaban sedang dihasilkan.

FINISHED: Jawaban telah lengkap.

code

String

Kode kesalahan yang dikembalikan jika terjadi error.

message

String

Pesan kesalahan yang dikembalikan jika terjadi error.

Contoh isi respons

{
    "request_id": "f1b9*****************2853a",
    "status": "OK",
    "latency": 33967.562031,
    "result": {
        "data": [
            {
                "answer": "The user wants a recommendation of 3 Jay Chou albums. I need to first find out what albums Jay Chou has and then select 3 representative ones to recommend.",
                "type": "TEXT_MARKDOWN",
                "reference": [],
                "rich_text_ref": [],
                "event": "THINK",
                "event_status": "FINISHED"
            },
            {
                "answer": "List of all Jay Chou albums",
                "type": "TEXT_MARKDOWN",
                "reference": [],
                "rich_text_ref": [],
                "event": "ACTION",
                "event_status": "FINISHED"
            },
            {
                "answer": "Here is a list of Jay Chou's albums, sorted by release year:  \n\n1. **JAY** (2000)  \n2. **Fantasy** (2001)  \n3. **The Eight Dimensions** (2002)  \n4. **Ye Hui Mei** (2003)  \n5. **Common Jasmine Orange** (2004)  \n6. **November's Chopin** (2005)  \n7. **Still Fantasy** (2006)  \n8. **On the Run** (2007)  \n9. **Capricorn** (2008)  \n10. **The Era** (2010)  \n11. **Exclamation Mark** (2011)  \n12. **Opus 12** (2012)  \n13. **Aiyo, Not Bad** (2014)  \n14. **Jay Chou's Bedtime Stories** (2016)  \n15. **Greatest Works of Art** (2022)  \n\nNote: Some songs mentioned in the search results are actually tracks on albums. They have been organized into a complete album list.",
                "type": "TEXT_MARKDOWN",
                "reference": [],
                "rich_text_ref": [],
                "event": "ANSWER",
                "event_status": "FINISHED"
            },
            {
                "answer": "\nFirst, the user's question is: 'Recommend 3 Jay Chou albums.' I need to answer this based on the available information, which includes several documents describing Jay Chou's albums.\n\nReviewing the information:\n- [Doc 01] lists Jay Chou's albums and songs, but it seems to only mention the 'JAY' album and lists some songs. The document starts by saying 'Jay Chou's musical works include six official solo albums and four EP albums,' but the specific album names are not fully listed. It lists songs, but only 'JAY' is explicitly mentioned as an album name.\n- [Doc 02] mentions albums like 'The Eight Dimensions,' 'Jay Chou's Bedtime Stories,' 'Fantasy,' 'Jay,' etc., and provides the years.\n- [Doc 03] is similar to [Doc 02], mentioning albums like 'Greatest Works of Art,' 'Jay Chou's Bedtime Stories,' 'Aiyo, Not Bad,' 'Opus 12,' and 'Exclamation Mark.'\n- [Doc 04] mentions 'JAY' and 'Fantasy' and describes them.\n- [Doc 05] is similar to [Doc 02] and [Doc 03], mentioning the same albums.\n\nFrom these documents, I can extract a list of Jay Chou's albums:\n- [Doc 02] and [Doc 03] clearly list album names and years:\n  - 'Greatest Works of Art' 2022\n  - 'Jay Chou's Bedtime Stories' 2016\n  - 'Aiyo, Not Bad' 2014\n  - 'Opus 12' 2012\n  - 'Exclamation Mark' 2011\n- Additionally, [Doc 01] mentions 'JAY' 2000, and [Doc 04] also mentions 'JAY' and 'Fantasy.'\n- [Doc 02] also mentions 'The Eight Dimensions' 2002, 'Fantasy' 2001, and 'Jay' 2000 (which likely refers to 'JAY').\n\nCombining all documents, Jay Chou's albums include:\n- 'JAY' 2000 [Doc 01][Doc 04]\n- 'Fantasy' 2001 [Doc 02][Doc 04]\n- 'The Eight Dimensions' 2002 [Doc 02]\n- 'Exclamation Mark' 2011 [Doc 02][Doc 03]\n- 'Opus 12' 2012 [Doc 02][Doc 03]\n- 'Aiyo, Not Bad' 2014 [Doc 02][Doc 03]\n- 'Jay Chou's Bedtime Stories' 2016 [Doc 02][Doc 03]\n- 'Greatest Works of Art' 2022 [Doc 02][Doc 03]\n\nThe user wants a recommendation of 3 albums. I need to make recommendations based on the available information and ensure each point is supported by a source.\n\nRecommendation criteria: I should choose some classic or representative albums. From the documents:\n- [Doc 02] and [Doc 03] highly praise 'Fantasy,' calling it 'the peak of Jay Chou's musical career and a benchmark of an era that countless musicians have tried to imitate but found difficult to surpass.' [Doc 02][Doc 03]\n- [Doc 01] mentions 'JAY' as his debut album.\n- [Doc 02] mentions that 'The Eight Dimensions' continued the style of the first two albums and won multiple awards. [Doc 02]\n- Other albums like 'Jay Chou's Bedtime Stories' and 'Greatest Works of Art' are also mentioned.\n\nSo, I can recommend:\n1. 'Fantasy' - because it is described as a peak and a benchmark.\n2. 'JAY' - as the debut album, it has historical significance.\n3. 'The Eight Dimensions' - because it continued his success and won awards.\n\nAlternatively, I could choose more recent ones, but the documents emphasize the importance of his early albums.\n\nEnsure source citations: Every fact must be cited in the format [Doc xx].\n\nAnswer requirements:\n- Use English.\n- If the information can answer the question, it must be used, and sources must be cited.\n- Use rich markdown formats: lists, tables, etc.\n- Natural, not stiff, tone.\n- Accuracy, no fabricated information.\n\nStructuring the answer:\n- Start by directly recommending 3 albums.\n- Provide reasons for each album, based on the documents.\n- Use a list or table to organize.\n- Cite sources.\n\nFinal recommendation:\n1. 'Fantasy' (2001) - Reason: Described as the peak of Jay Chou's musical career and a benchmark of an era. [Doc 02][Doc 03]\n2. 'JAY' (2000) - Reason: Debut album that established his musical style. [Doc 01][Doc 04]\n3. 'The Eight Dimensions' (2002) - Reason: Continued the style of his previous works, won multiple awards, and brought hope to the recording industry. [Doc 02]\n\nI could also consider 'Jay Chou's Bedtime Stories' or 'Greatest Works of Art,' but there is less description of them in the documents, while the early albums have more commentary.\n\nIn [Doc 02][Doc 03], there is a detailed description of 'Fantasy,' while other albums are just listed.\n\nSo, choosing these three is reasonable.\n\nUse markdown: I can use ordered lists or tables.\n\nFor example:\n- Use ### for headings\n- Use a list for descriptions\n- Bold the album names\n\nEnsure no extra information is added: only based on the documents.\n",
                "type": "TEXT_MARKDOWN",
                "reference": [],
                "rich_text_ref": [],
                "event": "THINK",
                "event_status": "FINISHED"
            },
            {
                "answer": "\nBased on his representative albums, here are three classic works by Jay Chou that I recommend. These albums not only showcase his unique musical style (blending pop, R&B, rock, and other elements) but are also widely acclaimed for their artistic achievement and influence. These recommendations are based on the cited sources, and the reasoning for each strictly adheres to the information within those documents.\n\n### Three Recommended Jay Chou Albums\n\n1. **Fantasy (2001)**  \n   - **Reason for Recommendation**: This album is widely regarded as the pinnacle of Jay Chou's musical career. It established his creative paradigm and became a benchmark of an era that countless musicians have tried to imitate but found difficult to surpass. Each song on the album is like a lens, creating a visual through sound, taking listeners across time and space. For example, 'Love in B.C.' blends R&B and hip-hop to create a sense of a time vortex; 'Ninja' uses a single chord and Japanese imagery to enhance the feeling of being there; and 'William's Castle' uses an organ to create a mysterious medieval atmosphere. Overall, it established Jay Chou's mature style and is beloved by fans worldwide[^2^][^3^].  \n   - **Representative Songs**: 'Love in B.C.', 'Ninja', 'William's Castle' (Source: [^2^][^3^]).\n\n2. **JAY (2000)**  \n   - **Reason for Recommendation**: As Jay Chou's debut solo album, it marks the beginning of his musical career and includes several classic songs such as 'Cute Woman,' 'Perfectionism,' and 'Starry Mood.' This album showcases his unique musical talent, blending multiple elements, laying the foundation for his subsequent works, and quickly gaining widespread recognition from fans[^1^][^4^].  \n   - **Representative Songs**: 'Cute Woman,' 'Perfectionism,' 'Starry Mood' (Source: [^1^][^4^]).\n\n3. **The Eight Dimensions (2002)**  \n   - **Reason for Recommendation**: This album continues the arrangement style of his first two works with a more mature personal style, which helped Jay Chou win numerous awards and set new records in the Mandopop scene. At the same time, its high sales brought hope to a recording industry plagued by piracy. The Minnan dialect song 'Where is the Train Going' reflects Jay Chou's connection to his roots, a feature less common in his later works, highlighting his artistic depth[^2^].  \n   - **Representative Songs**: 'Where is the Train Going,' 'Secret Signal' (Source: [^2^]).\n\nThese three albums represent the breakthrough, innovation, and mature stages of Jay Chou's early career, making them an excellent starting point for understanding the essence of his music. Each one carries a unique creative story and is worth savoring!",
                "type": "TEXT_MARKDOWN",
                "reference": [
                    {
                        "title": "Who knows the names of all of Jay Chou's albums",
                        "category": "webSearch",
                        "url": "https://zhidao.baidu.com/question/317142607014917724.html"
                    },
                    {
                        "title": "Jay Chou",
                        "category": "webSearch",
                        "url": "https://music.apple.com/cn/artist/300117743"
                    },
                    {
                        "title": "Jay Chou - Apple Music",
                        "category": "webSearch",
                        "url": "https://music.apple.com/cn/artist/a/300117743"
                    },
                    {
                        "title": "Summary of All Jay Chou Album Names",
                        "category": "webSearch",
                        "url": "https://m.xueba5.com/xw/25426.html"
                    },
                    {
                        "title": "Jay Chou",
                        "category": "webSearch",
                        "url": "https://music.apple.com/cn/artist/%E5%91%A8%E6%9D%B0%E4%BC%A6/300117743"
                    }
                ],
                "rich_text_ref": [],
                "event": "SUMMARY",
                "event_status": "FINISHED"
            }
        ]
    }
}

SDK

Konfigurasi variabel lingkungan

Konfigurasikan variabel lingkungan ALIBABA_CLOUD_ACCESS_KEY_ID dan ALIBABA_CLOUD_ACCESS_KEY_SECRET.

Penting
  • Pasangan AccessKey untuk Akun Alibaba Cloud memiliki izin untuk semua operasi API. Untuk keamanan yang lebih baik, kami menyarankan menggunakan Pengguna RAM untuk panggilan API dan operasi O&M rutin. Untuk informasi selengkapnya, lihat Buat Pengguna RAM.

  • Untuk membuat ID AccessKey dan Rahasia AccessKey, lihat Buat AccessKey.

  • Jika Anda menggunakan pasangan AccessKey dari Pengguna RAM, pastikan Pengguna RAM tersebut memiliki izin AliyunOpenSearchFullAccess.

  • Jangan menyematkan ID AccessKey dan Rahasia AccessKey secara langsung dalam kode proyek Anda karena dapat membocorkan kredensial dan membahayakan keamanan seluruh sumber daya dalam akun Anda.

  • Sistem Linux dan macOS

    Jalankan perintah berikut, ganti <access_key_id> dan <access_key_secret> dengan ID dan rahasia AccessKey Pengguna RAM Anda.

    export ALIBABA_CLOUD_ACCESS_KEY_ID=<access_key_id> 
    export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<access_key_secret>
  • Sistem Windows

    1. Buat file untuk variabel lingkungan. Di dalam file tersebut, tambahkan variabel ALIBABA_CLOUD_ACCESS_KEY_ID dan ALIBABA_CLOUD_ACCESS_KEY_SECRET, lalu atur nilainya sesuai dengan ID dan rahasia AccessKey Anda.

    2. Mulai ulang Windows agar perubahan diterapkan.

Dependensi

<dependency>
        <groupId>com.aliyun.opensearch</groupId>
        <artifactId>aliyun-sdk-opensearch</artifactId>
        <version>6.0.0</version>
</dependency>

Kode contoh

Kode contoh berikut menunjukkan cara melakukan pemanggilan.

package com.aliyun.opensearch;
import com.aliyun.opensearch.OpenSearchClient;
import com.aliyun.opensearch.sdk.generated.OpenSearch;
import com.aliyun.opensearch.sdk.generated.commons.OpenSearchClientException;
import com.aliyun.opensearch.sdk.generated.commons.OpenSearchException;
import com.aliyun.opensearch.sdk.generated.commons.OpenSearchResult;
import java.util.HashMap;
import java.util.Map;
public class LLMSearch {
    private static String accesskey = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID");
    private static String secret = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET");
    private static String appName = "Replace with your application name";
    private static String host = "Replace with the API endpoint of your application";
    private static String path = "/apps/%s/actions/multi-search";
    public static void main(String[] args) {
        String appPath = String.format(path, appName);
        // Set the API read timeout.
        OpenSearch openSearch = new OpenSearch(accesskey, secret, host);
        openSearch.setTimeout(90000);
        OpenSearchClient openSearchClient = new OpenSearchClient(openSearch);
        Map<String, String> params = new HashMap<String, String>() {{
            put("format", "full_json");
            put("_POST_BODY", "{\"question\":{\"text\":\"Recommend 3 Jay Chou albums\",\"type\":\"TEXT\",\"session\":\"\"},\"options\":{\"chat\":{\"stream\":true,\"enable_deep_search\":true,\"model\":\"opensearch-qwen\"}}}");
        }};
        try {
            OpenSearchResult openSearchResult = openSearchClient
                    .callAndDecodeResult(appPath, params, "POST");
            System.out.println("RequestID=" + openSearchResult.getTraceInfo().getRequestId());
            System.out.println(openSearchResult.getResult());
        } catch (
                OpenSearchException e) {
            System.out.println("RequestID=" + e.getRequestId());
            System.out.println("ErrorCode=" + e.getCode());
            System.out.println("ErrorMessage=" + e.getMessage());
        } catch (
                OpenSearchClientException e) {
            System.out.println("ErrorMessage=" + e.getMessage());
        }
    }
}