OmniThink

zjunlpMIT长期未更新

让大模型在机器写作时通过「思考」主动扩展知识边界,缓解长文生成中内容浅薄、信息重复的问题,适合新闻等长文本创作场景。

[EMNLP 2025] OmniThink: Expanding Knowledge Boundaries in Machine Writing through Thinking

暂无版本483star63fork同步于 2026-11-07 07:29 UTC

怎么上手

由 README 提炼,执行前请确认
conda create -n OmniThink python=3.11
pip install -r requirements.txt
export LM_KEY=YOUR_API_KEY
export SEARCHKEY=YOUR_SEARCHKEY
sh run.sh
硬件要求按 README 说明

README 未说明显存或 GPU 要求;本地检索依赖 faiss-cpu 与 sentence-transformers,可 CPU 运行。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

模拟人类迭代扩展与反思的机器写作框架,生成高知识密度长文

让大模型在机器写作时通过「思考」主动扩展知识边界,缓解长文生成中内容浅薄、信息重复的问题,适合新闻等长文本创作场景。

核心能力

  • 用迭代扩展与反思机制深化对复杂主题的理解
  • 构建大纲并生成连贯的长篇文章
  • 支持基于 RAGFlow 的离线本地文档检索
  • 提供 Rubric_Grading、Knowledge_Density、Information_Diversity 三类评测脚本
  • 支持 deepseek-reasoner 模型运行

容易踩的坑

运行前必须导出 LM_KEY 和 SEARCHKEY 环境变量;LM 的输出必须是 LIST;评测需先进入 eval 目录克隆 FActScore 仓库,本地检索还需额外安装 sentence-transformers、faiss-cpu、numpy。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    👏 Welcome to try OmniThink in our Modelscope online demo and 🤗HuggingFace online demo!

    Table of Contents

    🔔News

    • 2025-08-24, We have added offline local search support using RAGFlow technology! Now you can search local documents without internet connection.
    • 2025-03-12, We have optimized the Docker usage for OmniThink.
    • 2025-02-20, We have added the evaluation methods from the paper to OmniThink, and in the future, we will integrate more evaluation methods.
    • 2025-01-28, We have provided support for the deepseek-reasoner model. You can try running ./examples/deepseekr1.py to test OmniThink's performance within deepseek-reasoner.
    • 2025-01-18, we open-sourced OmniThink, a machine writing framework.

    🌻Acknowledgement

    📖 Quick Start

    • 🌏 The Online Demo is avaiable at ModelScope now!

    📌 Introduction

    Welcome to OmniThink, an innovative machine writing framework designed to replicate the human cognitive process of iterative expansion and reflection in generating insightful long-form articles.

    • Iterative Expansion and Reflection: OmniThink uses a unique mechanism that simulates human cognitive behaviors to deepen the understanding of complex topics.
    • Enhanced Knowledge Density: OmniThink focuses on expanding knowledge boundaries, resulting in articles that are rich in information and insights.
    • Comprehensive Article Generation: OmniThink constructs outlines and generates articles, delivering high-quality content that is both coherent and contextually robust.

    🛠 Dependencies

    📦 Conda

    conda create -n OmniThink python=3.11
    git clone https://github.com/zjunlp/OmniThink.git
    cd OmniThink
    # Install requirements
    pip install -r requirements.txt
    

    🔍 Local Search Support

    OmniThink now supports offline local search using RAGFlow technology! This feature allows you to:

    • Search local documents without internet connection
    • Use vector embeddings for semantic search
    • Index and retrieve your own document collections
    • Maintain data privacy with local-only processing

    Local Search Features

    • OfflineRAGFlow: Core RAG engine with FAISS vector database
    • LocalSearch: DSPy-compatible search interface
    • Sentence Transformers: High-quality text embeddings
    • Smart Chunking: Intelligent document segmentation
    • Semantic Retrieval: Context-aware search results

    Quick Local Search Setup

    from src.tools.rm import OfflineRAGFlow, LocalSearch
    
    # Initialize the local RAG engine
    rag_engine = OfflineRAGFlow(
        model_name="sentence-transformers/all-MiniLM-L6-v2",
        chunk_size=800,
        overlap=120,
        k=5
    )
    
    # Add documents to your local index
    rag_engine.ingest(
        text="Your document content here...",
        meta={"title": "Document Title", "doc_id": "doc1"}
    )
    
    # Create DSPy-compatible search interface
    local_search = LocalSearch(search=rag_engine, k=3)
    
    # Use in your DSPy pipeline
    results = local_search.forward("your search query")
    

    🐳 Docker

    git clone https://github.com/zjunlp/OmniThink.git
    docker pull zjunlp/omnithink:latest
    docker run -it zjunlp/omnithink:latest
    

    🔑 Before running, please export the LM API key and SEARCH key as an environment variable:

    export LM_KEY=YOUR_API_KEY
    export SEARCHKEY=YOUR_SEARCHKEY
    

    Local Search Dependencies

    For local search functionality, additional packages are required:

    # Install local search dependencies
    pip install sentence-transformers faiss-cpu numpy
    
    # Or use the updated requirements.txt
    pip install -r requirements.txt
    

    You can define your own LM API and SEARCH API

    Note that the output of the LM should be a LIST.

    Results in OmniThink

    The preformance of OmniThink is shown below:

    Generate Article in OmniThink

    Just one command required

    sh run.sh
    

    You can find your Article, Outline and mindmap in ./results/

    🔍 Evaluation

    We provide convenient scripts for evaluating your method. The evaluation is divided into three categories: Rubric_Grading, Knowledge_Density, and Information_Diversity.

    We use the factscore library. Please run the following code before starting the evaluation.

    cd eval
    git clone https://github.com/shmsw25/FActScore.git
    

    For Rubric Grading

    python Rubric_Grading.py \
     --articlepath articlepath \
     --modelpath modelpath
    

    For Information Diversity

    python Information_Diversity.py \
     --mappath mappath \
     --model_path model_path
    

    For Knowledge_Density

    python Knowledge_Density.py \
     --articlepath articlepath \
     --api_path api_path \
     --threads threads
    

    Citation

    If you find our repo useful in your research, please kindly consider cite:

    @misc{xi2025omnithinkexpandingknowledgeboundaries,
          title={OmniThink: Expanding Knowledge Boundaries in Machine Writing through Thinking}, 
          author={Zekun Xi and Wenbiao Yin and Jizhan Fang and Jialong Wu and Runnan Fang and Ningyu Zhang and Jiang Yong and Pengjun Xie and Fei Huang and Huajun Chen},
          year={2025},
          eprint={2501.09751},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2501.09751}, 
    }