본문 바로가기
WIKI 기술 지식 베이스

Conversational flow agents

원문 보기 위키 갱신

출처: 문서

본문

대화형 흐름 에이전트

Introduced 2.13 {: .label .label-purple }

흐름 에이전트와 유사하게, 대화형 흐름 에이전트는 순서대로 실행되는 도구 집합으로 구성돼요. 차이점은 대화형 흐름 에이전트가 대화를 인덱스에 저장한다는 거예요. 다음 예에서는 conversation_index에 저장해요. 다음 에이전트는 VectorDBTool을 실행한 다음 MLModelTool을 실행해요:

POST /_plugins/_ml/agents/_register
{
  "name": "population data analysis agent",
  "type": "conversational_flow",
  "description": "This is a demo agent for population data analysis",
  "app_type": "rag",
  "memory": {
    "type": "conversation_index"
  },
  "tools": [
    {
      "type": "VectorDBTool",
      "name": "population_knowledge_base",
      "parameters": {
        "model_id": "YOUR_TEXT_EMBEDDING_MODEL_ID",
        "index": "test_population_data",
        "embedding_field": "population_description_embedding",
        "source_field": [
          "population_description"
        ],
        "input": "${parameters.question}"
      }
    },
    {
      "type": "MLModelTool",
      "name": "bedrock_claude_model",
      "description": "A general tool to answer any question",
      "parameters": {
        "model_id": "YOUR_LLM_MODEL_ID",
        "prompt": """

Human:You are a professional data analyst. You will always answer question based on the given context first. If the answer is not directly shown in the context, you will analyze the data and find the answer. If you don't know the answer, just say don't know. 

Context:
${parameters.population_knowledge_base.output:-}

${parameters.chat_history:-}

Human:${parameters.question}

Assistant:"""
      }
    }
  ]
}

{% include copy-curl.html %}

에이전트 등록 API 요청 필드에 대한 자세한 내용은 요청 본문 필드를 참조하세요.

단계별 튜토리얼은 에이전트 및 도구 튜토리얼을 참조하세요.

외부 MCP 도구 사용

Introduced 3.8 {: .label .label-purple }

대화형 흐름 에이전트는 MLModelTool과 같은 OpenSearch 도구와 함께 고정 파이프라인에서 외부 MCP 서버 도구를 호출할 수 있어요. parameters.mcp_connectors를 구성하고 McpStreamableHttpTool 또는 McpSseTool을 사용하여 tools 배열에 각 MCP 도구를 명시적으로 선언하세요. 설정 단계와 예제는 흐름 에이전트 및 대화형 흐름 에이전트와 MCP 도구 사용을 참조하세요.

다음 단계

더 알아보기 (Learn more)