Deep search es un sistema profesional de preguntas y respuestas (Q&A) basado en una arquitectura multiagente que ofrece respuestas precisas, enfocadas y detalladas. Este sistema recupera datos de forma eficiente, comprende la intención del usuario, integra información de múltiples fuentes y genera respuestas estructuradas y completas. A diferencia de los motores de búsqueda tradicionales, deep search destaca por descomponer preguntas complejas, integrar datos de diversas fuentes y conectar conocimientos entre distintos dominios.
Comparación de capacidades
La siguiente tabla compara deep search con la búsqueda tradicional basada en IA.
|
Dimensión |
Deep search |
Búsqueda tradicional con IA |
|
Comprensión |
Inferencia contextual y reconocimiento de intenciones. |
Recuperación semántica y por palabras clave. |
|
Modo de respuesta |
Solicita proactivamente detalles aclaratorios, como un rango de tiempo o un alcance regional. |
Acepta pasivamente la consulta original. |
|
Fuentes de datos |
Admite agregación multiplataforma desde fuentes como datos privados, web y bases de datos. |
Depende de una única fuente de datos. |
|
Densidad de conocimiento |
Devuelve múltiples referencias citadas en una sola respuesta para contestar con precisión. |
Devuelve solo un conjunto fijo de 3 a 5 pasajes de datos relevantes. |
|
Profundidad de interacción |
Admite conversaciones profesionales continuas y de múltiples turnos. |
El número de turnos de conversación afecta significativamente los resultados. |
|
Preguntas aplicables |
Preguntas complejas y abiertas para tareas como análisis o comparaciones. |
Preguntas simples basadas en hechos. |
Arquitectura
Deep search se basa en una arquitectura multiagente y consta de los siguientes agentes:
Agente de comprensión de consultas: Comprende y reescribe la consulta original del usuario.
Agente de planificación autónoma: Identifica la intención del usuario, planifica y ajusta la ruta de ejecución, además de validar y corregir las respuestas.
Agente de búsqueda: Recupera y resume el conocimiento para el turno actual de la conversación.
Agente de chat casual: Responde a entradas conversacionales, como "Hola".
Agente de aclaración: Genera preguntas de seguimiento para aclarar consultas ambiguas del usuario.
Agente de resumen: Genera la respuesta final a la pregunta del usuario.
Uso
Consola
Inicie sesión en la consola de OpenSearch y seleccione OpenSearch LLM-Based Conversational Search Edition. En el panel de navegación izquierdo, haga clic en Instance Management. Localice la instancia que desea gestionar y haga clic en Manage en la columna Actions.
En la página de detalles de la instancia, haga clic en Q&A Test. Habilite Deep Search, introduzca su consulta en el cuadro de diálogo y luego haga clic en Send.
-
Consulte los resultados de la prueba de Q&A.
API
Parámetros de solicitud
Parámetro
Tipo
Obligatorio
Predeterminado
Descripción
options.chat.enable_deep_searchBoolean
No
trueEspecifica si se debe habilitar deep search.
-
true: Habilita deep search. El servicio realiza múltiples rondas de razonamiento y sintetiza datos para generar el resultado. Una sola conversación consume más tiempo y recursos de cómputo. -
false: Deshabilita deep search.
options.chat.agent.think_processBoolean
No
trueEspecifica si se debe devolver el proceso de pensamiento.
options.chat.agent.max_think_roundInteger
No
10
El número de rondas de pensamiento (máximo: 20).
options.chat.agent.languageString
No
AUTOEl idioma para el proceso de pensamiento y la respuesta.
AUTO: Determina automáticamente si se usa chino o inglés según la consulta del usuario.CN: Chino.EN: Inglés.NotaPara obtener una lista completa de los parámetros de prueba de Q&A, consulte Q&A parameters.
Ejemplo de cuerpo de solicitud
{ "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" } } }Parámetros de respuesta
Parámetro
Tipo
Descripción
request_idString
El ID de la solicitud.
statusString
El estado de procesamiento de la solicitud.
-
OK: La solicitud fue exitosa. -
FAIL: La solicitud falló.
latencyFloat
El tiempo requerido para que el servidor procese una solicitud exitosa, en milisegundos.
idInteger
El ID de clave primaria.
titleString
El título del documento.
categoryString
El nombre de la categoría.
urlString
La URL del documento.
answerString
El resultado de Q&A.
typeString
El tipo de resultado devuelto.
scoresArray
La puntuación del contenido del documento.
eventString
El evento de pensamiento.
Una ronda de pensamiento consiste en eventos
THINK,ACTIONyANSWER, aunqueTHINKno siempre se devuelve.THINKindica que el agente está razonando,ACTIONmuestra la acción que se está ejecutando yANSWERproporciona la conclusión de esa ronda. El eventoSUMMARYcontiene la respuesta final, y solo se devuelve un eventoSUMMARYpor solicitud.event_statusString
Indica si el resultado está completo.
PROCESSING: La respuesta se está generando.FINISHED: La respuesta está completa.codeString
El código de error que se devuelve si ocurre un error.
messageString
El mensaje de error que se devuelve si ocurre un error.
Ejemplo de cuerpo de respuesta
{ "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
Configurar variables de entorno
Configure las variables de entorno ALIBABA_CLOUD_ACCESS_KEY_ID y ALIBABA_CLOUD_ACCESS_KEY_SECRET.
ImportanteUn par de AccessKey para una cuenta de Alibaba Cloud tiene permisos para todas las operaciones de API. Para mayor seguridad, se recomienda usar un usuario RAM para las llamadas a la API y las tareas rutinarias de operación y mantenimiento. Para más información, consulte Create a RAM user.
Para crear un AccessKey ID y un AccessKey secret, consulte Create an AccessKey.
Si utiliza el par de AccessKey de un usuario RAM, asegúrese de que el usuario RAM tenga el permiso AliyunOpenSearchFullAccess.
No codifique su AccessKey ID y AccessKey secret directamente en el código de su proyecto. Esto puede exponer sus credenciales y comprometer la seguridad de todos los recursos de su cuenta.
-
Sistemas Linux y macOS
Ejecute los siguientes comandos y reemplace
<access_key_id>y<access_key_secret>con el AccessKey ID y el secret de su usuario RAM.export ALIBABA_CLOUD_ACCESS_KEY_ID=<access_key_id> export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<access_key_secret> -
Sistemas Windows
Cree un archivo para las variables de entorno. En el archivo, agregue las variables ALIBABA_CLOUD_ACCESS_KEY_ID y ALIBABA_CLOUD_ACCESS_KEY_SECRET y establézcalas con su AccessKey ID y secret.
Reinicie Windows para aplicar los cambios.
Dependencia
<dependency> <groupId>com.aliyun.opensearch</groupId> <artifactId>aliyun-sdk-opensearch</artifactId> <version>6.0.0</version> </dependency>Código de ejemplo
El siguiente código de ejemplo demuestra cómo realizar la llamada.
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()); } } } -