{"id":27123598,"url":"https://github.com/Intelligent-Internet/ii-researcher","last_synced_at":"2025-04-07T13:01:44.009Z","repository":{"id":284961127,"uuid":"956421280","full_name":"Intelligent-Internet/ii-researcher","owner":"Intelligent-Internet","description":"II-Researcher: a new open-source framework designed to aid building search / research agents","archived":false,"fork":false,"pushed_at":"2025-04-05T20:00:11.000Z","size":568,"stargazers_count":217,"open_issues_count":0,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-05T21:18:08.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Intelligent-Internet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-28T08:22:26.000Z","updated_at":"2025-04-05T20:00:15.000Z","dependencies_parsed_at":"2025-03-28T16:44:55.861Z","dependency_job_id":null,"html_url":"https://github.com/Intelligent-Internet/ii-researcher","commit_stats":null,"previous_names":["intelligent-internet/ii-researcher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intelligent-Internet%2Fii-researcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intelligent-Internet%2Fii-researcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intelligent-Internet%2Fii-researcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intelligent-Internet%2Fii-researcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Intelligent-Internet","download_url":"https://codeload.github.com/Intelligent-Internet/ii-researcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657273,"owners_count":20974344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-07T13:01:42.882Z","updated_at":"2025-04-07T13:01:43.994Z","avatar_url":"https://github.com/Intelligent-Internet.png","language":"Python","funding_links":[],"categories":["🔬 Research Agents","Python"],"sub_categories":["🟩 Development Tools 🛠️"],"readme":"# II-Researcher\n\n![ii_researcher](https://github.com/user-attachments/assets/966dd403-fd73-4829-9d87-3878ecf025b1)\n\nA powerful deep search agent that uses BAML functions to perform intelligent web searches and generate comprehensive answers to questions.\n\nFor more details about our project, please visit our [blog post](https://www.ii.inc/web/blog/post/ii-researcher).\n\n## Features\n\n- 🔍 Intelligent web search using Tavily and SerpAPI search providers\n- 🕸️ Web scraping and content extraction with multiple providers (Firecrawl, Browser, BS4, Tavily)\n- 🧠 Multi-step reasoning and reflection\n- ⚙️ Configurable LLM models for different tasks\n- ⚡ Asynchronous operation for better performance\n- 📝 Comprehensive answer generation with references\n- 🛠️ Support for customizable pipelines and reasoning methods for deep search\n\n## 🎬 Demo\n\nhttps://github.com/user-attachments/assets/d862b900-a06b-46c6-9694-cccd1edac6f6\n\n## 🎬 MCP\n\nhttps://github.com/user-attachments/assets/2c1542f0-0e1b-44d5-8fc5-0446a07b3821\n\n## 🔧 Required Software\n\n- Python 3.7+ (required for local development)\n- Docker and Docker Compose (required for containerized deployment)\n- Node.js and npm (required for local frontend development)\n\n## 🛠️ Installation and Setup\n\n### 1. Clone the repository:\n\n```bash\ngit clone https://github.com/Intelligent-Internet/ii-researcher.git\ncd ii-researcher\n```\n\n### 2. Install the package in development mode:\n\n```bash\npip install -e .\n```\n\n### 3. Set up your environment variables:\n\n```bash\n# API Keys\nexport OPENAI_API_KEY=\"your-openai-api-key\"\nexport TAVILY_API_KEY=\"your-tavily-api-key\" # set this api key when you select SEARCH_PROVIDER is tavily\nexport SERPAPI_API_KEY=\"your-serpapi-api-key\"  # set this api key when you select SEARCH_PROVIDER is serpapi\nexport FIRECRAWL_API_KEY=\"your-firecrawl-api-key\"  # set this api key when you select SCRAPER_PROVIDER is firecrawl\n\n# API Endpoints\nexport OPENAI_BASE_URL=\"http://localhost:4000\"\n\n# Compress Configuration\nexport COMPRESS_EMBEDDING_MODEL=\"text-embedding-3-large\"\nexport COMPRESS_SIMILARITY_THRESHOLD=\"0.3\"\nexport COMPRESS_MAX_OUTPUT_WORDS=\"4096\"\nexport COMPRESS_MAX_INPUT_WORDS=\"32000\"\n\n# Search and Scraping Configuration\nexport SEARCH_PROVIDER=\"serpapi\"  # Options: 'serpapi' | 'tavily'\nexport SCRAPER_PROVIDER=\"firecrawl\"  # Options: 'firecrawl' | 'bs' | 'browser' | 'tavily_extract'\n\n# Timeouts and Performance Settings\nexport SEARCH_PROCESS_TIMEOUT=\"300\"  # in seconds\nexport SEARCH_QUERY_TIMEOUT=\"20\"     # in seconds\nexport SCRAPE_URL_TIMEOUT=\"30\"       # in seconds\nexport STEP_SLEEP=\"100\"              # in milliseconds\n```\n\nConfig env when using compress by LLM (Optional: For better compression performance)\n\n```bash\nexport USE_LLM_COMPRESSOR=\"TRUE\"\nexport FAST_LLM=\"gemini-lite\" # The model use for context compression\n```\n\nConfig env when run with **Pipeline**:\n\n```bash\n# Model Configuration\nexport STRATEGIC_LLM=\"gpt-4o\" # The model use for choose next action\nexport SMART_LLM=\"gpt-4o\" # The model use for others tasks in pipeline\n```\n\nConfig env when run with **Reasoning**:\n\n```bash\nexport R_MODEL=r1 # The model use for reasoning\nexport R_TEMPERATURE=0.2 # Config temperature for reasoning model\nexport R_REPORT_MODEL=gpt-4o # The model use for writing report\nexport R_PRESENCE_PENALTY=0 # Config presence_penalty for reasoning model\n```\n\n### 4. Configure and Run LiteLLM (Local LLM Server):\n\n```bash\n# Install LiteLLM\npip install litellm\n\n# Create litellm_config.yaml file\ncat \u003e litellm_config.yaml \u003c\u003c EOL\nmodel_list:\n  - model_name: text-embedding-3-large\n    litellm_params:\n      model: text-embedding-3-large\n      api_key: ${OPENAI_API_KEY}\n  - model_name: gpt-4o\n    litellm_params:\n      model: gpt-4o\n      api_key: ${OPENAI_API_KEY}\n  - model_name: o1-mini\n    litellm_params:\n      model: o1-mini\n      api_key: ${OPENAI_API_KEY}\n  - model_name: r1\n    litellm_params:\n      model: deepseek-reasoner\n      api_base: https://api.deepseek.com/beta\n      api_key: ${DEEPSEEK_API_KEY}\n\nlitellm_settings:\n  drop_params: true\nEOL\n\n# Start LiteLLM server\nlitellm --config litellm_config.yaml\n```\n\nThe LiteLLM server will run on http://localhost:4000 by default.\n\n### 5. (Optional) Configure and Run LiteLLM with **OpenRouter**:\n\n```bash\ncat \u003e litellm_config.yaml \u003c\u003c EOL\nmodel_list:\n  - model_name: text-embedding-3-large\n    litellm_params:\n      model: text-embedding-3-large\n      api_key: ${OPENAI_API_KEY}\n  - model_name: \"gpt-4o\"\n    litellm_params:\n      model: \"openai/chatgpt-4o-latest\"\n      api_base: \"https://openrouter.ai/api/v1\"\n      api_key: \"your_openrouter_api_key_here\"\n\n  - model_name: \"r1\"\n    litellm_params:\n      model: \"deepseek/deepseek-r1\"\n      api_base: \"https://openrouter.ai/api/v1\"\n      api_key: \"your_openrouter_api_key_here\"\n\n  - model_name: \"gemini-lite\"\n    litellm_params:\n      model: \"google/gemini-2.0-flash-lite-001\"\n      api_base: \"https://openrouter.ai/api/v1\"\n      api_key: \"your_openrouter_api_key_here\"\n\nlitellm_settings:\n  drop_params: true\nEOL\n```\n\n## 🖥️ Usage\n\n### Using the CLI\n\nRun the deep search agent with your question:\n\nThere are two modes:\n\n- **Pipeline Mode**: This mode is suitable for general questions and tasks.\n\n```bash\npython ii_researcher/cli.py --question \"your question here\"\n```\n\n- **Reasoning Mode**: This mode is suitable for complex questions and tasks.\n\n```bash\npython ii_researcher/cli.py --question \"your question here\" --use-reasoning --stream\n```\n\n### Using MCP\n\n1. Set up your environment variables\n\n- Copy the .env.example file to create a new file named .env\n  ```bash\n  cp .env.example .env\n  ```\n- Edit the .env file and add your API keys and configure other settings:\n\n2. Integrating with Claude\n   You can integrate your MCP server with Claude using: [Claude Desktop Integration](https://docs.gptr.dev/docs/gpt-researcher/mcp-server/claude-integration)\n3. Install mcp to Claude\n\n```bash\nmcp install mcp/server.py -f .env\n```\n\n4. Restart your Claude App\n\n### Using the Web Interface\n\n1. Install and Run Backend API (In case for frontend serving):\n\n```bash\n# Start the API server\npython api.py\n```\n\nThe API server will run on http://localhost:8000\n\n2. Setup env for Frontend\n\nCreate a `.env` file in the frontend directory with the following content:\n\n```\nNEXT_PUBLIC_API_URL=http://localhost:8000\n```\n\n3. Install and Run Frontend:\n\n```bash\n# Navigate to frontend directory\ncd frontend\n\n# Install dependencies\nnpm install\n\n# Start the development server\nnpm run dev\n```\n\nThe frontend will be available at http://localhost:3000\n\n## 🐳 Run with Docker\n\n1. **Important**: Make sure you have set up all environment variables from step 3 before proceeding.\n\n2. Start the services using Docker Compose:\n\n```bash\n# Build and start all services\ndocker compose up --build -d\n```\n\nThe following services will be started:\n\n- frontend: Next.js frontend application\n- api: FastAPI backend service\n- litellm: LiteLLM proxy server\n\nThe services will be available at:\n\n- Frontend: http://localhost:3000\n- Backend API: http://localhost:8000\n- LiteLLM Server: http://localhost:4000\n\n3. View logs:\n\n```bash\n# View all logs\ndocker compose logs -f\n\n# View specific service logs\ndocker compose logs -f frontend\ndocker compose logs -f api\ndocker compose logs -f litellm\n```\n\n4. Stop the services:\n\n```bash\ndocker compose down\n```\n\n## 🛠️ Running QwQ Model with SGLang\n\nTo run the Qwen/QwQ-32B model using SGLang, use the following command:\n\n```bash\npython3 -m sglang.launch_server --model-path Qwen/QwQ-32B --host 0.0.0.0 --port 30000 --tp 8 --context-length 131072\n```\n\n## 💡 Acknowledgments\n\nII-Researcher is inspired by and built with the support of the open-source community:\n\n- **[LiteLLM](https://www.litellm.ai/)** – Used for efficient AI model integration.\n- **[node-DeepResearch](https://github.com/jina-ai/node-DeepResearch)** – Prompt inspiration\n- **[gpt-researcher](https://github.com/assafelovic/gpt-researcher)** - Prompt inspiration, web scraper tool\n- **[baml](https://github.com/BoundaryML/baml)** - Structured outputs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIntelligent-Internet%2Fii-researcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIntelligent-Internet%2Fii-researcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIntelligent-Internet%2Fii-researcher/lists"}