MCPcopy Index your code
hub / github.com/LightInn/deepsearch

github.com/LightInn/deepsearch @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
37 symbols 66 edges 7 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Deep Search CLI

Demo

/!\ this question is usefull because AI tend to haluncinate a lot about 9/11 event when talking about septemeber 2001

Flowchart

License: MIT Crates.io Rust

An AI-powered research assistant for your terminal.

Deep Search is a command-line tool that uses local large language models (LLMs) to provide in-depth answers to complex questions. It breaks down your query, scours the web for relevant information, and synthesizes a comprehensive response, all within your terminal.

Features

  • AI-Powered Research: Leverages local LLMs (via Ollama) to understand and research your questions.
  • Step-by-Step Process: Decomposes questions, searches multiple sources (Wikipedia, DuckDuckGo), filters for relevance, and summarizes findings.
  • Local First: Works with your own Ollama-hosted models, keeping your data private.
  • Minimalist CLI: A clean, focused interface for your research tasks.

How It Works

The tool follows a structured research workflow:

  1. Decompose: The initial question is broken down into smaller, specific sub-questions.
  2. Search: Each sub-question is researched using Wikipedia or DuckDuckGo.
  3. Filter: The search results are filtered to identify the most relevant sources.
  4. Summarize: The content of each relevant page is summarized.
  5. Evaluate: The summaries are used to construct a final answer. If the answer is incomplete, the process can be iterated with new sub-questions.
  6. Answer: A final, synthesized answer is presented to the user.

Installation

From Crates.io

Once the package is published to crates.io, you can install it directly using cargo:

cargo install deepsearch

This will install the deepsearch binary in your cargo bin directory, allowing you to run it from anywhere in your terminal.

From Source

  1. Install Rust: If you don't have Rust, install it from rust-lang.org.
  2. Install Ollama: You need a running Ollama instance. See the Ollama website for installation instructions.
  3. Clone the repository: bash git clone https://github.com/LightInn/deepsearch.git cd deepsearch
  4. Build the project:

    For a development build, run: bash cargo build The executable will be at ./target/debug/deepsearch.

    For a release (production) build, run: bash cargo build --release The executable will be at ./target/release/deepsearch.

Usage

Once built, you can run the tool from the command line.

From Release Build

./target/release/deepsearch "Your research question"

With Cargo

For development, you can run the tool directly with cargo:

cargo run -- "Your research question"

Parameters

You can customize the behavior of the tool with the following parameters:

  • --max-iterations or -i: Set the maximum number of research iterations.
  • --model or -m: Specify the Ollama model to use.
  • --verbose or -v: Enable verbose output for debugging purposes.

Example:

./target/release/deepsearch "How does photosynthesis work?" -i 5 -m "llama3"

This will start a research task on "How does photosynthesis work?", with a maximum of 5 iterations, using the llama3 model.

Contributing

Contributions are welcome! If you'd like to contribute, please feel free to submit a pull request or open an issue.

Prompt Engineering

A core part of this tool is the quality of the prompts used to interact with the LLM. If you have ideas for improving the prompts, you are encouraged to modify the src/prompts.rs file and submit a pull request. Better prompts lead to better research outcomes!

License

This project is licensed under the MIT License. See the LICENSE file for details.

Core symbols most depended-on inside this repo

query_ollama
called by 8
src/ollama.rs
decompose_question_prompt_initial
called by 2
src/prompts.rs
check_if_answer_is_complete_prompt
called by 2
src/prompts.rs
fetch_and_parse_html
called by 1
src/parser.rs
filter_search_results_prompt
called by 1
src/prompts.rs
summarize_text_prompt
called by 1
src/prompts.rs
evaluate_completeness_and_answer_prompt
called by 1
src/prompts.rs
decide_search_tool_prompt
called by 1
src/prompts.rs

Shape

Function 23
Class 13
Enum 1

Languages

Rust100%

Modules by API surface

src/ollama.rs15 symbols
src/prompts.rs7 symbols
src/search.rs6 symbols
src/orchestrator.rs6 symbols
src/parser.rs1 symbols
src/main.rs1 symbols
src/cli.rs1 symbols

For agents

$ claude mcp add deepsearch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact