### Docker setup for OmniThink Source: https://github.com/zjunlp/omnithink/blob/main/README.md Clone the repository, pull the Docker image, and run the container. ```bash git clone https://github.com/zjunlp/OmniThink.git docker pull zjunlp/omnithink:latest docker run -it zjunlp/omnithink:latest ``` -------------------------------- ### Install local search dependencies Source: https://github.com/zjunlp/omnithink/blob/main/README.md Install additional packages required for local search functionality. ```bash # Install local search dependencies pip install sentence-transformers faiss-cpu numpy # Or use the updated requirements.txt pip install -r requirements.txt ``` -------------------------------- ### Conda environment setup for OmniThink Source: https://github.com/zjunlp/omnithink/blob/main/README.md Create a Conda environment with Python 3.11, clone the repository, and install requirements. ```bash 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 setup with OfflineRAGFlow and LocalSearch Source: https://github.com/zjunlp/omnithink/blob/main/README.md Initialize the local RAG engine, ingest documents, create a DSPy-compatible search interface, and use it in a pipeline. ```python 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") ``` -------------------------------- ### Clone FActScore repository for evaluation Source: https://github.com/zjunlp/omnithink/blob/main/README.md Required setup before running any evaluation scripts. Clones the FActScore library into the eval directory. ```bash cd eval git clone https://github.com/shmsw25/FActScore.git ``` -------------------------------- ### Export LM and search API keys Source: https://github.com/zjunlp/omnithink/blob/main/README.md Set environment variables for the LM API key and search key before running. ```bash export LM_KEY=YOUR_API_KEY export SEARCHKEY=YOUR_SEARCHKEY ``` -------------------------------- ### Run OmniThink article generation with sh run.sh Source: https://github.com/zjunlp/omnithink/blob/main/README.md Executes the main OmniThink pipeline with a single command. Outputs the generated article, outline, and mindmap to the ./results/ directory. ```bash sh run.sh ``` -------------------------------- ### Run Knowledge Density evaluation Source: https://github.com/zjunlp/omnithink/blob/main/README.md Assesses knowledge density. Requires article path, API path, and number of threads. ```bash python Knowledge_Density.py \ --articlepath articlepath \ --api_path api_path \ --threads threads ``` -------------------------------- ### Run Information Diversity evaluation Source: https://github.com/zjunlp/omnithink/blob/main/README.md Measures information diversity using a mapping file and a model path. ```bash python Information_Diversity.py \ --mappath mappath \ --model_path model_path ``` -------------------------------- ### Run Rubric Grading evaluation Source: https://github.com/zjunlp/omnithink/blob/main/README.md Evaluates article quality using rubric grading. Requires paths to the article and the model. ```bash python Rubric_Grading.py \ --articlepath articlepath \ --modelpath modelpath ``` -------------------------------- ### Cite OmniThink with BibTeX entry Source: https://github.com/zjunlp/omnithink/blob/main/README.md BibTeX citation for OmniThink paper, useful for academic referencing. ```angular2 @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}, } ```