SkillAgentSearch skills...

RMSearch

Reward-Model Search (RMSearch) toolkit that scores 'keys' (documents, agents, tools, steps) from 'queries' (questions, context) with graph acceleration.

Install / Use

/learn @kyotoai/RMSearch
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->

<a id="readme-top"></a>

<!-- *** https://github.com/othneildrew/Best-README-Template/blob/main/BLANK_README.md *** Thanks for checking out the Best-README-Template. If you have a suggestion *** that would make this better, please fork the repo and create a pull request *** or simply open an issue with the tag "enhancement". *** Don't forget to give the project a star! *** Thanks again! Now go create something AMAZING! :D --> <!-- PROJECT SHIELDS --> <!-- *** I'm using markdown "reference style" links for readability. *** Reference links are enclosed in brackets [ ] instead of parentheses ( ). *** See the bottom of this document for the declaration of the reference variables *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use. *** https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url] [![LinkedIn][linkedin-shield]][linkedin-url]

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://kyotoai.org"> <img src="images/RMSearch_fig.png" alt="Logo" width="640" height="360"> </a> <h3 align="center">RMSearch</h3> <p align="center"> RMSearch is a high intellectual search tool using reward model instead of semantic embedding model. Agentic search is a good application and RMSearch enables step by step CoT reasoning and optimize the reasoning path! <br /> <a href="https://github.com/kyotoai/RMSearch/tree/main/demo"><strong>Explore the docs »</strong></a> <br /> <br /> <a href="https://github.com/kyotoai/RMSearch/tree/main/demo">View Demo</a> · <a href="https://github.com/kyotoai/RMSearch/issues/new?labels=bug&template=bug-report---.md">Report Bug</a> · <a href="https://github.com/kyotoai/RMSearch/issues/new?labels=enhancement&template=feature-request---.md">Request Feature</a> </p> </div> <!-- TABLE OF CONTENTS --> <details> <summary>Table of Contents</summary> <ol> <li> <a href="#about-the-project">About The Project</a> <ul> <li><a href="#built-with">Built With</a></li> </ul> </li> <li> <a href="#getting-started">Getting Started</a> <ul> <li><a href="#prerequisites">Prerequisites</a></li> <li><a href="#installation">Installation</a></li> </ul> </li> <li><a href="#usage">Usage</a></li> <li><a href="#roadmap">Roadmap</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#acknowledgments">Acknowledgments</a></li> </ol> </details> <!-- ABOUT THE PROJECT -->

About The Project

Search The Best Agent To Make Deep Reasoning

<!-- [![Product Name Screen Shot][product-screenshot]](https://example.com) --> <br /> <div align="center"> <img src="images/SEIMEI_example.png" alt="seimei" width="640" height="360"> </div> <br /> Here's the example of how SEIMEI works. Each agent interacts with LLM and document and makes inference. These inferences are automatically integrated by search engine and gives an answer of question. <br /> <div align="center"> <img src="images/SEIMEI_train_example.png" alt="seimei" width="640" height="360"> </div> <br /> By training search engine, we can optimize the thinking steps like o1 or deepseek-r1!! <p align="right">(<a href="#readme-top">back to top</a>)</p>

The Most Intelligent Search Engine

<div align="center"> <img src="images/Comparison.png" alt="seimei" width="400" height="360"> </div>

Our proprietary search model performs better than semantic embedding model(so called vector search). The graph above shows the result of training our model (3b) and e5-mistral-7b model to search best agents. While the vector search model cannot really retrieve best agents(because problems and agents do not have similar sentences), our proprietary search model can learn what agents are needed to solve a question and retrive the best ones!!

<a href="https://github.com/kyotoai/SEIMEI/tree/main/demo"><strong>See more details »</strong></a>

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Achives State Of The Art Result

<div align="center"> <img src="images/Improvement.png" alt="seimei" width="500" height="360"> </div>

We acheved an improvement of bigcodebench/deepseek-r1 by our search engine!!

<a href="https://github.com/kyotoai/SEIMEI/tree/main/demo"><strong>See more details »</strong></a>

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Applications of SEIMEI

<div align="center"> <img src="images/Application1.png" alt="seimei" width="640" height="360"> </div> <div align="center"> <img src="images/Application2.png" alt="seimei" width="640" height="360"> </div> <div align="center"> <img src="images/Application3.png" alt="seimei" width="640" height="360"> </div>

SEIMEI can be applied to make these useful functions!!

<a href="https://github.com/kyotoai/SEIMEI/tree/main/demo"><strong>See more details »</strong></a>

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Built With

  • [![vLLM][vllm.ai]][vllm-url]
  • [![Hugging Face][huggingface.co]][huggingface-url]
<!-- * [![Next][Next.js]][Next-url] * [![React][React.js]][React-url] * [![Vue][Vue.js]][Vue-url] * [![Angular][Angular.io]][Angular-url] * [![Svelte][Svelte.dev]][Svelte-url] * [![Laravel][Laravel.com]][Laravel-url] * [![Bootstrap][Bootstrap.com]][Bootstrap-url] * [![JQuery][JQuery.com]][JQuery-url] --> <p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- GETTING STARTED -->

Getting Started

This is an example of how you build RMSearch on local gpu or cloud server gpu. You can use it by downloading this directory into your local folder.

Prerequisites

This library requires cuda+torch environment with GPU. The memory of GPU should be higher than 12GB to run the sample.

Installation

  • by pip install
  1. Install seimei (not prepared yet)
    pip install rmsearch
    
  • by downloading SEIMEI repository
  1. Download the repo
    git clone https://github.com/kyotoai/RMSearch.git
    cd RMSearch
    pip install .
    
<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- USAGE EXAMPLES -->

Usage

We are still developing this library. Please wait for it completing soon!

Quick Start

  1. Define search instance

    from rmsearch import Search
    search = Search(model_name = "/workspace/llama3b-rm",
            tensor_parallel_size = 1,
            pipeline_parallel_size = 1,)
    
  2. Search the most relevant keys

    queries = ["How to make LLM?", "What's the capital of Japan?"] * 5
    keys = ["LLM is Large Language Model which can be made ..."*7, "Japanese capital is ..."*7] * 5
    output = await search(queries, keys)
    print(output)
    
<p align="right">(<a href="#readme-top">back to top</a>)</p>

Train Reward Model For Your Own Tasks (For Developpers)

See the full code in /examples/example_train2.ipynb

  1. Generate Tree Structural LLM Output

    # This is an example of making agentic tree to optimize brainstorming
    num_depth = 2
    num_branch = 2
    total_num_node = num_branch**(num_depth+1) - 2
    
    bs_agent_tree = {}  
    
    # Recursive function to make agentic tree
    def build_bs_agent_tree(**kwargs):
    
        # make kwargs_ from kwargs
    
        def _grow(node, depth, **kwargs_):
            if depth == num_depth:
                return
    
            for b in range(num_branch):
                child = {
                    "agent"   : "something",
                    "node_ids" : node["node_ids"] + [b],
                }
                node["children"].append(child)
    
                _grow(child, depth + 1, **kwargs_)
    
        root = {"agent": "root", "node_ids": [], "children": []}
        _grow(root, 0, **kwargs_)
    
        return root
    
    # Get output from LLM
    def get_assistant_msg(node, **llm_kwargs):
        output = get_output(node["agent"], **llm_kwargs)  # LLM function
        return output
    
    # Walk tree to add output
    def populate_tree(node, **llm_kwargs):
        if node["agent"] is not "root":         # skip dummy root
            node["output"] = get_assistant_msg(
                node,
                **llm_kwargs,
            )
    
        for child in node["children"]:
            populate_tree(child, **llm_kwargs)
    
    def check(output):
        # some function to check its novelty
        return evaluation
    
    # Walk tree to add evaluation towards each node's output
    def add_eval_to_tree(node, depth):
    
        if not node["output"] != None:
            if node["eval"] == []:
                node["eval"] = check(node["output"])
    
        for child in node["children"]:
            add_eval_to_tree(child, depth + 1)
            
    
    # Asign agents to each node in bs_agent_tree
    bs_agent_tree = build_bs_agent_tree(agents, num_depth=num_depth, num_branch=num_branch)  # bs_agent_tree : [{"agent":"root", "node_id":[0], "children":[{"agent":"agent1", "node_id":[0, 0], "children":[...]}, ...]
    
    # Get llm output in each node
    populate_tree(bs_agent_tree, **kwargs)  # bs_agent_tree = [{"agent":"root", "node_id":[0], "children":[{"agent":"agent1", "output":"...", "node_id":[0, 0], "children":[...]}, ...]
    
    # Get evaluation of output in each node
    add_eval_to_tree(bs_agent_tree, 0)  # bs_agent_tree = [{"agent":"root", "node_id":[0], "children":[{"agent":"agent1", "output":"...", "eval":"...", "node_id":[0, 0], "children":[...]}, ...]
    
  2. Make dataset_list

    # dataset_list should be 
    # [{"query":str, "chosen_key":str, "rejecte
    

Related Skills

View on GitHub
GitHub Stars7
CategoryDevelopment
Updated3mo ago
Forks1

Languages

Python

Security Score

87/100

Audited on Dec 22, 2025

No findings