Skip to content

[RFC] Support MFCTool in skills plugin #539

Closed
@zane-neo

Description

@zane-neo

Problem Statement

With the recent surge in Large Language Models (LLMs) and AI agents, there's an increasing demand for AI systems to access the latest data from various sources, including databases and public APIs. The Model Context Protocol (MCP) has emerged as a universal, open standard for facilitating these connections. Skills is a centralized repo to accommodate various tools and it's a good opportunity to support MCP client in the repo to give user the capability to connect to their own MCP servers to perform different automated tasks. The proposal to convert OpenSearch APIs to tools are covered in this RFC: opensearch-project/OpenSearch#17577

Proposed Solutions

  1. Configure an agent that to perform a specific/general task:
POST /_plugins/_ml/agents/_register
{
  "name": "my MFC demo agent",
  "type": "flow",
  "description": "this is a simple demo agent that uses MFC client",
  "llm": {
    "model_id": "{your_model_id}",
    "parameters": {
      "max_iteration": 5,
      "stop_when_no_tool_found": true,
      "response_filter": "$.completion"
    }
  },
  "tools": [
    {
      "type": "MFCTool",
      "name": "MFCTool",
      "parameters": {
        "method": "index/_mapping",
        "request_body": ${parameters.params}
      }
    }
  ],
  "app_type": "my_app"
}

  1. Execute the agent to solve a complex task:
POST /_plugins/_ml/agents/{agent_id}
{
    "parameters": {
        "question": "Please help me create a new index in my cluster",
        "params": "{ \"mappings\": { \"properties\": { \"text\": { \"type\": \"text\" } } }, \"settings\": { \"index\": { \"number_of_replicas\": \"1\", \"number_of_shards\": \"2\" } }}"
    }
}
  1. During the agent running, the MFCTool get invoked and the params in the parameters get passed to corresponding MFC server and the task complete.

This tool is generic enough to support different MFC server interaction with different request body, and all the MFC protocol details will be handled by OpenSearch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions