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

Flow agents

원문 보기 위키 갱신

출처: 문서

본문

플로우 에이전트

2.13에 도입됨 {: .label .label-purple }

플로우 에이전트는 정해진 순서대로 실행하는 도구 집합으로 구성됩니다. 예를 들어 다음 에이전트는 VectorDBTool을 실행한 뒤 MLModelTool을 실행합니다. 에이전트는 도구들을 조율해서 한 도구의 출력이 다른 도구의 입력이 되도록 합니다. 이 예제에서 VectorDBTool은 k-NN 인덱스를 쿼리하고, 에이전트는 그 출력인 ${parameters.VectorDBTool.output}을 ${parameters.question}과 함께 컨텍스트로 MLModelTool에 전달합니다(prompt 파라미터 참조):

POST /_plugins/_ml/agents/_register
{
  "name": "Test_Agent_For_RAG",
  "type": "flow",
  "description": "this is a test agent",
  "tools": [
    {
      "type": "VectorDBTool",
      "parameters": {
        "model_id": "YOUR_TEXT_EMBEDDING_MODEL_ID",
        "index": "my_test_data",
        "embedding_field": "embedding",
        "source_field": ["text"],
        "input": "${parameters.question}"
      }
    },
    {
      "type": "MLModelTool",
      "description": "A general tool to answer any question",
      "parameters": {
        "model_id": "YOUR_LLM_MODEL_ID",
        "prompt": "\n\nHuman:You are a professional data analyst. You will always answer a 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 you don't know. \n\n Context:\n${parameters.VectorDBTool.output}\n\nHuman:${parameters.question}\n\nAssistant:"
      }
    }
  ]
}

{% include copy-curl.html %}

Register Agent API 요청 필드에 대한 자세한 내용은 요청 본문 필드를 참조하세요.

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

외부 MCP 도구 사용하기

3.8에 도입됨 {: .label .label-purple }

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

다음 단계

더 알아보기 (Learn more)