Merge branch 'main' into improve-readme-onboarding

This commit is contained in:
Rocko Lo
2025-06-10 17:20:56 -04:00
committed by GitHub
36 changed files with 6249 additions and 4606 deletions
+18
View File
@@ -0,0 +1,18 @@
# Python cache files
__pycache__/
*.py[cod]
# Virtual environments
agentic_seek_env/
.agentic_seek_env/
.env
# Git metadata
.git/
# macOS Finder files
.DS_Store
# Log files
*.log
+8
View File
@@ -1,4 +1,12 @@
SEARXNG_BASE_URL="http://127.0.0.1:8080"
REDIS_BASE_URL="redis://redis:6379/0"
WORK_DIR="/Users/username/Documents/workspace_with_my_files"
OLLAMA_PORT="11434"
LM_STUDIO_PORT="1234"
CUSTOM_ADDITIONAL_LLM_PORT="11435"
OPENAI_API_KEY='xxxxx'
DEEPSEEK_API_KEY='xxxxx'
OPENROUTER_API_KEY='xxxxx'
TOGETHER_API_KEY='xxxxx'
GOOGLE_API_KEY='xxxxx'
ANTHROPIC_API_KEY='xxxxx'
+3 -6
View File
@@ -23,16 +23,13 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**LLM Model used**
The model you used, for example deepseek-r1:14b
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
+4
View File
@@ -6,9 +6,12 @@
*.egg-info
cookies.json
test_agent.py
searxng/uwsgi.ini.new
searxng/settings.yml.new
config.ini
.voices/
experimental/
chrome_bundle/
.logs/
.screenshots/*.png
.screenshots/*.jpg
@@ -18,6 +21,7 @@ agentic_seek_env/*
.env
*/.env
dsk/
chrome136/
### react ###
.DS_*
+1
View File
@@ -0,0 +1 @@
3.10
+83 -27
View File
@@ -1,46 +1,102 @@
FROM ubuntu:22.04
# Warning: doesn't work yet, backend is run on host machine for now
FROM --platform=linux/amd64 python:3.11-slim
ENV DEBIAN_FRONTEND=noninteractive
# Install essential packages and Chrome dependencies
RUN apt-get update -y && apt-get install -y \
wget \
gnupg2 \
ca-certificates \
unzip \
xvfb \
libxss1 \
libappindicator1 \
fonts-liberation \
libnss3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
xdg-utils \
dbus \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update -y && \
apt-get install -y \
gcc \
g++ \
gfortran \
libportaudio2 \
portaudio19-dev \
ffmpeg \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
gnupg2 \
wget \
unzip \
python3 \
python3-pip \
libasound2 \
libatk-bridge2.0-0 \
libgtk-4-1 \
libnss3 \
xdg-utils \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update -y && \
apt-get install -y \
alsa-utils \
&& rm -rf /var/lib/apt/lists/*
ENV CHROME_TESTING_VERSION=134.0.6998.88
ENV DISPLAY=:99
WORKDIR /app
RUN apt-get update -qq -y && \
apt-get install -y \
gcc \
g++ \
gfortran \
libportaudio2 \
portaudio19-dev \
ffmpeg \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
gnupg2 \
wget \
unzip \
python3 \
python3-pip \
libasound2 \
libatk-bridge2.0-0 \
libgtk-4-1 \
libnss3 \
xdg-utils \
wget && \
RUN set -eux; \
wget -qO /tmp/chrome.zip \
"https://storage.googleapis.com/chrome-for-testing-public/${CHROME_TESTING_VERSION}/linux64/chrome-linux64.zip"; \
unzip -q /tmp/chrome.zip -d /opt; \
rm /tmp/chrome.zip; \
ln -s /opt/chrome-linux64/chrome /usr/local/bin/google-chrome; \
ln -s /opt/chrome-linux64/chrome /usr/local/bin/chrome; \
mkdir -p /opt/chrome; \
ln -s /opt/chrome-linux64/chrome /opt/chrome/chrome; \
google-chrome --version
RUN set -eux; \
wget -qO /tmp/chromedriver.zip \
"https://storage.googleapis.com/chrome-for-testing-public/${CHROME_TESTING_VERSION}/linux64/chromedriver-linux64.zip"; \
unzip -q /tmp/chromedriver.zip -d /tmp; \
mv /tmp/chromedriver-linux64/chromedriver /usr/local/bin; \
rm /tmp/chromedriver.zip; \
chmod +x /usr/local/bin/chromedriver; \
chromedriver --version
RUN chmod +x /opt/chrome/chrome
# Install dependencies
RUN pip3 install --upgrade pip setuptools wheel
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN mkdir -p /opt/workspace
RUN mkdir -p /tmp && chmod 1777 /tmp
# Copy application code
COPY api.py .
COPY sources/ ./sources/
COPY prompts/ ./prompts/
COPY crx/ crx/
COPY llm_router/ llm_router/
COPY .env .
COPY config.ini .
# Expose port
EXPOSE 8000
# Run the application
+40 -380
View File
@@ -4,7 +4,7 @@
<img align="center" src="./media/agentic_seek_logo.png" width="300" height="300" alt="Agentic Seek Logo">
<p>
English | [中文](./README_CHS.md) | [繁體中文](./README_CHT.md) | [Français](./README_FR.md) | [日本語](./README_JP.md)
English | [中文](./README_CHS.md) | [繁體中文](./README_CHT.md) | [Français](./README_FR.md) | [日本語](./README_JP.md) | [Português (Brasil)](./README_PTBR.md)
*A **100% local alternative to Manus AI**, this voice-enabled AI assistant autonomously browses the web, writes code, and plans tasks while keeping all data on your device. Tailored for local reasoning models, it runs entirely on your hardware, ensuring complete privacy and zero cloud dependency.*
@@ -22,7 +22,7 @@
* 📋 Plans & Executes Complex Tasks - From trip planning to complex projects — it can split big tasks into steps and get things done using multiple AI agents.
* 🎙️ Voice-Enabled - Clean, fast, futuristic voice and speech to text allowing you to talk to it like it's your personal AI from a sci-fi movie
* 🎙️ Voice-Enabled - Clean, fast, futuristic voice and speech to text allowing you to talk to it like it's your personal AI from a sci-fi movie. (In progress)
### **Demo**
@@ -32,13 +32,10 @@ https://github.com/user-attachments/assets/b8ca60e9-7b3b-4533-840e-08f9ac426316
Disclaimer: This demo, including all the files that appear (e.g: CV_candidates.zip), are entirely fictional. We are not a corporation, we seek open-source contributors not candidates.
> 🛠️ **Work in Progress** Looking for contributors!
> 🛠⚠️ **Active Work in Progress**
## Installation
> 🙏 This project started as a side-project and has zero roadmap and zero funding. It's grown way beyond what I expected by ending in GitHub Trending. Contributions, feedback, and patience are deeply appreciated.
This section guides you through installing AgenticSeek. Please follow the steps carefully.
### **Prerequisites**
Before you begin, ensure you have the following software installed:
@@ -53,7 +50,7 @@ Before you begin, ensure you have the following software installed:
For issues related to ChromeDriver after attempting installation, see the [Known Issues](#chromedriver-issues) section.
### 1️⃣ **Clone the repository and setup**
### 1. **Clone the repository and setup**
```sh
git clone https://github.com/Fosowl/agenticSeek.git
@@ -61,146 +58,6 @@ cd agenticSeek
mv .env.example .env
```
### 2 **Create a Python Virtual Environment**
It's highly recommended to use a virtual environment to manage project dependencies.
```sh
# Ensure you are using Python 3.10 for creating the environment
python3.10 -m venv agentic_seek_env
# Or if 'python3.10' is not found, try 'python3 -m venv agentic_seek_env'
# but verify version with 'python --version' inside the activated environment.
# Activate the virtual environment
source agentic_seek_env/bin/activate
# On Windows PowerShell: .\agentic_seek_env\Scripts\Activate.ps1
# On Windows CMD: agentic_seek_env\Scripts\activate.bat
```
### 3️⃣ **Install Dependencies**
This step includes installing Python packages and setting up ChromeDriver.
#### **ChromeDriver Installation**
1. **Check your Chrome Version:** Open Google Chrome, go to `Settings -> About Chrome` to find your version (e.g., 120.0.6099.110).
2. **Download ChromeDriver:**
* For Chrome version 115 or newer, download from [Chrome for Testing (CfT) JSON Endpoints](https://googlechromelabs.github.io/chrome-for-testing/). Find the stable version matching your Chrome's major version.
* For older versions (not recommended), you might find them on the [ChromeDriver downloads page](https://chromedriver.chromium.org/downloads).
3. **Install ChromeDriver:**
* **Linux/macOS:** Download the appropriate zip file, extract `chromedriver`, and move it to a directory in your system's PATH (e.g., `/usr/local/bin`). Ensure it's executable (`chmod +x /usr/local/bin/chromedriver`).
* **Windows:** Download the zip file, extract `chromedriver.exe`, and place it in a directory included in your system's PATH (e.g., `C:\Windows\System32` or a dedicated scripts folder that you've added to PATH).
* Alternatively, you can place `chromedriver` (or `chromedriver.exe`) directly in the root of the `agenticSeek` project directory. The application will try to find it there.
#### **Python Packages & System Dependencies**
**Automatic Installation (Recommended):**
The following scripts attempt to install system dependencies (like `portaudio`) and Python packages from `requirements.txt`.
* **Linux/macOS:**
```sh
./install.sh
```
* **Windows:**
```sh
./install.bat
```
*Note for Windows:* The batch script will attempt to install `pyaudio`. This may require "Microsoft Visual C++ 14.0 or greater". If `pyaudio` installation fails, you might need to install it manually via a wheel file or install PortAudio first. See manual Windows instructions below.
**Manual Installation:**
If automatic installation fails or you prefer manual setup:
* **All Operating Systems:**
1. Ensure your virtual environment is active.
2. Install Python packages:
```sh
pip3 install -r requirements.txt
```
* **Linux Specific System Dependencies:**
```sh
sudo apt update
sudo apt install -y alsa-utils portaudio19-dev python3-pyaudio libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1
```
*(Note: `python3-pyaudio` might be handled by `pip install` if `portaudio19-dev` is present).*
* **macOS Specific System Dependencies:**
```sh
brew update
brew install portaudio # For pyaudio
# ChromeDriver should be handled by the dedicated ChromeDriver Installation step above.
# `brew install --cask chromedriver` can also work but ensure version compatibility.
```
* **Windows Specific System Dependencies:**
1. `pip install pyreadline3` (usually part of `requirements.txt`)
2. **PortAudio for PyAudio:**
* `pyaudio` (for voice functionality) requires PortAudio. If `pip install pyaudio` (from `requirements.txt`) fails:
* Try installing from a pre-compiled wheel: Find a `pyaudio` wheel compatible with your Python version (3.10) and system architecture from sites like [Christoph Gohlke's Python Libraries page](https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio). Download the `.whl` file and install with `pip install PyAudioXYZ.whl`.
* Alternatively, install PortAudio via a package manager like [vcpkg](https://vcpkg.io/en/index.html) or by [building from source](http://files.portaudio.com/docs/v19-doxydocs/compile_windows.html), then try `pip install pyaudio` again.
---
## Configuration (`config.ini`)
Before running AgenticSeek, you need to configure it by editing the `config.ini` file. This file is created when you run `mv .env.example .env` during the initial setup.
Key settings are explained in the [Config Section](#config) later in this README. For now, be aware that you'll need to update it based on whether you're running an LLM locally or via an API.
---
## Running AgenticSeek
Choose one of the following setups based on how you want to run the Large Language Model (LLM).
## Setup for running LLM locally on your machine
This setup allows you to run AgenticSeek with an LLM hosted entirely on your own hardware, ensuring privacy.
**Hardware Requirements:**
Running LLMs locally requires significant hardware resources. Refer to the [FAQ: What hardware do I need?](#faq) for detailed model performance and hardware recommendations (minimum 8GB VRAM GPU, 12GB+ recommended).
**1. Install a Local LLM Provider:**
You need software to serve the LLM locally. Popular choices:
* **Ollama:**
* **Installation:** Download and install Ollama from [ollama.ai](https://ollama.ai/).
* **Homepage:** [https://ollama.ai/](https://ollama.ai/)
* **LM-Studio:**
* **Installation:** Download and install LM-Studio from [lmstudio.ai](https://lmstudio.ai/).
* **Homepage:** [https://lmstudio.ai/](https://lmstudio.ai/)
* **OpenAI-Compatible Server (e.g., llama.cpp, vLLM):**
* These are more advanced setups. You'll need to follow their respective documentation to start a server that exposes an OpenAI-compatible API.
* Example: [llama.cpp server documentation](https://github.com/ggerganov/llama.cpp/tree/master/examples/server)
**2. Download/Select a Model:**
Once your provider is installed, download a model. We recommend reasoning models like *Qwen* or *Deepseek*.
* **For Ollama:**
```sh
ollama pull deepseekcoder:6.7b # Example: deepseek-coder 6.7B
ollama pull qwen:14b # Example: Qwen 14B
# List available models with `ollama list`
```
* **For LM-Studio:** Use the UI to search for and download models.
* **For OpenAI-Compatible Servers:** Configure the server to use your desired model.
**3. Start Your Local LLM Provider:**
* **Ollama:**
```sh
ollama serve
```
(This often runs automatically after installation on some systems).
* **LM-Studio:** Start the application and use its UI to load a model and start the server.
* **OpenAI-Compatible Server:** Follow its specific instructions to start the server.
**4. Update `config.ini`:**
Modify your `config.ini` file:
```ini
[MAIN]
@@ -234,7 +91,7 @@ See below for a list of local supported provider.
**Update the config.ini**
Change the config.ini file to set the provider_name to a supported provider and provider_model to a LLM supported by your provider. We recommand reasoning model such as *Qwen* or *Deepseek*.
Change the config.ini file to set the provider_name to a supported provider and provider_model to a LLM supported by your provider. We recommend reasoning model such as *Qwen* or *Deepseek*.
See the **FAQ** at the end of the README for required hardware.
@@ -247,24 +104,15 @@ provider_server_address = http://127.0.0.1:11434 # Default for Ollama. Use http:
agent_name = Jarvis # name of your AI
recover_last_session = True # whenever to recover the previous session
save_session = True # whenever to remember the current session
speak = True # text to speech
listen = False # Speech to text, only for CLI
work_dir = /Users/mlg/Documents/workspace # The workspace for AgenticSeek.
speak = False # text to speech
listen = False # Speech to text, only for CLI, experimental
jarvis_personality = False # Whenever to use a more "Jarvis" like personality (experimental)
languages = en zh # The list of languages, Text to speech will default to the first language on the list
[BROWSER]
headless_browser = True # Whenever to use headless browser, recommanded only if you use web interface.
headless_browser = True # leave unchanged unless using CLI on host.
stealth_mode = True # Use undetected selenium to reduce browser detection
```
**List of local providers** (summary)
| Provider | Local? | `provider_name` in `config.ini` | Description |
|-----------|--------|---------------------------------|------------------------------------------------------------------|
| Ollama | Yes | `ollama` | Run LLMs locally with ease using Ollama. |
| LM-Studio | Yes | `lm-studio` | Run LLMs locally with LM-Studio's UI and server. |
| OpenAI Compatible API | Yes | `openai` | Use a local server (e.g., llama.cpp, vLLM) that mimics the OpenAI API. |
Next step: [Start services and run AgenticSeek](#start-services-and-run)
*See the [Troubleshooting](#troubleshooting) section if you are having issues.*
@@ -283,7 +131,6 @@ Refer to the [List of API Providers](#list-of-api-providers) below. Visit their
**2. Set Your API Key as an Environment Variable:**
AgenticSeek expects the API key to be available as an environment variable.
* **Linux/macOS:**
Open your terminal and use the `export` command. It's best to add this to your shell's profile file (e.g., `~/.bashrc`, `~/.zshrc`) for persistence.
@@ -335,15 +182,6 @@ provider_server_address = # Typically ignored or can be left blank when is_local
* Coding/bash tasks might encounter issues with Gemini, as it may not strictly follow formatting prompts optimized for Deepseek.
* The `provider_server_address` in `config.ini` is generally not used when `is_local = False` as the API endpoint is usually hardcoded in the respective provider's library.
Next step: [Start services and run AgenticSeek](#start-services-and-run)
*See the [Troubleshooting](#troubleshooting) section if you are having issues.*
*For detailed `config.ini` explanations, see [Config Section](#config).*
---
Please also note that coding/bash might fail with gemini, it seem to ignore our prompt for format to respect, which are optimized for deepseek r1.
Next step: [Start services and run AgenticSeek](#Start-services-and-Run)
*See the **Known issues** section if you are having issues*
@@ -354,60 +192,36 @@ Next step: [Start services and run AgenticSeek](#Start-services-and-Run)
## Start services and Run
Activate your Python virtual environment if it's not already active:
```sh
# Linux/macOS
source agentic_seek_env/bin/activate
# Windows PowerShell
.\agentic_seek_env\Scripts\Activate.ps1
# Windows CMD
agentic_seek_env\Scripts\activate.bat
```
Start required background services using Docker Compose. This will launch:
- SearxNG (local meta-search engine)
- Redis (database for SearxNG)
- Frontend (web interface, if you choose to use it)
```sh
# For Linux (if your user is not in the docker group, sudo might be required for docker commands)
./start_services.sh
# or if you need sudo for Docker: sudo ./start_services.sh
# For macOS (sudo is typically not required if Docker Desktop is correctly installed)
./start_services.sh
# For Windows
start ./start_services.cmd
# This will open a new command prompt window for the services.
```
*Troubleshooting service start:* If these scripts fail, ensure Docker Engine is running and Docker Compose (V2, `docker compose`) is correctly installed. Check the output in the terminal for error messages. See [FAQ: Help! I get an error when running AgenticSeek or its scripts.](#faq-troubleshooting)
**Options 1:** Run with the CLI interface.
```sh
python3 cli.py
```
We advice you set `headless_browser` to False in the config.ini for CLI mode.
**Options 2:** Run with the Web interface.
Start the backend.
```sh
python3 api.py
```
**Warning:** This step will download and load all Docker images, which may take up to 30 minutes. After starting the services, please wait until the backend service is fully running (you should see backend: <info> in the log) before sending any messages. The backend services may take longer to start than others.
Go to `http://localhost:3000/` and you should see the web interface.
**Optional:** Run with the CLI interface:
To run with CLI interface you would have to install package on host:
```sh
./install.sh
./install.bat # windows
```
Start services:
```sh
./start_services.sh # MacOS
start ./start_services.cmd # Window
```
Then run : `python3 cli.py`
---
## Usage
Make sure the services are up and running with `./start_services.sh` and run the AgenticSeek with `python3 cli.py` for CLI mode or `python3 api.py` then go to `localhost:3000` for web interface.
Make sure the services are up and running with `./start_services.sh full` and go to `localhost:3000` for web interface.
You can also use speech to text by setting `listen = True` in the config. Only for CLI mode.
@@ -503,6 +317,8 @@ Next step: [Start services and run AgenticSeek](#Start-services-and-Run)
## Speech to Text
Warning: speech to text only work in CLI mode at the moment.
Please note that currently speech to text only work in english.
The speech-to-text functionality is disabled by default. To enable it, set the listen option to True in the config.ini file:
@@ -542,7 +358,7 @@ recover_last_session = False
save_session = False
speak = False
listen = False
work_dir = /Users/mlg/Documents/ai_folder # IMPORTANT: Update this to a valid path on your system
jarvis_personality = False
languages = en zh # List of languages for TTS and potentially routing.
[BROWSER]
@@ -574,8 +390,6 @@ stealth_mode = False
* `headless_browser`: `True` to run the automated browser without a visible window (recommended for web interface or non-interactive use). `False` to show the browser window (useful for CLI mode or debugging).
* `stealth_mode`: `True` to enable measures to make browser automation harder to detect. May require manual installation of browser extensions like anticaptcha.
---
## Providers
This section summarizes the supported LLM provider types. Configure them in `config.ini`.
@@ -662,165 +476,6 @@ raise ValueError("SearxNG base URL must be provided either as an argument or via
ValueError: SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.`
```
* **Cause:** The `.env` file is missing or the `SEARXNG_BASE_URL` variable is not set within it.
* **Solution:**
1. Ensure you have copied `.env.example` to `.env` in the root of the project directory (`mv .env.example .env` on Linux/macOS or `copy .env.example .env` on Windows).
2. Verify that the `.env` file contains `SEARXNG_BASE_URL="http://127.0.0.1:8080"`.
3. Alternatively (not recommended for permanent setup), you can set the environment variable in your terminal:
* Linux/macOS: `export SEARXNG_BASE_URL="http://127.0.0.1:8080"`
* Windows (CMD): `set SEARXNG_BASE_URL="http://127.0.0.1:8080"`
* Windows (PowerShell): `$env:SEARXNG_BASE_URL="http://127.0.0.1:8080"`
## FAQ (Frequently Asked Questions)
<a name="faq-hardware"></a>
**Q: What hardware do I need to run LLMs locally?**
| Model Size | Minimum GPU VRAM | Performance & Capability Notes | Example GPU Tier |
|------------|------------------|------------------------------------------------------------------------------------------------|---------------------|
| ~7B | 8GB VRAM | ⚠️ **Not Recommended for Agentic Tasks:** Performance is generally poor for complex reasoning, web browsing, or planning. May work for very simple queries. Expect frequent errors or nonsensical outputs. | e.g., RTX 3050 Laptop |
| ~14B | 12GB VRAM | ✅ **Basic Usability:** Can handle simpler tasks. May struggle with extensive web browsing, complex planning, or generating very long code sequences. | e.g., RTX 3060 (12GB) |
| ~30-34B | 24GB VRAM | 🚀 **Good Performance:** Suitable for most tasks, including moderately complex web browsing and planning. Good balance of capability and resource requirements. | e.g., RTX 3090, RTX 4090 |
| 70B+ | 48GB VRAM | 💪 **Excellent Performance:** Recommended for advanced use cases, extensive research, and complex multi-step planning. Provides the most robust results. | e.g., 2x RTX 3090, A100 (40/80GB), Mac Studio M2/M3 Ultra |
*Notes:*
* These are general guidelines. Performance also depends on model quantization, software (e.g., Ollama, LM-Studio), and CPU/RAM speed.
* Always check the specific model card for memory recommendations.
* Using CPU for inference is possible with some setups (e.g., Ollama with smaller models) but will be significantly slower.
<a name="faq-deepseek"></a>
**Q: Why is Deepseek R1 often mentioned or recommended?**
Deepseek models (especially their coder series) have shown strong performance in reasoning, instruction following, and tool/function calling for their size. AgenticSeek's prompts and internal logic have been tested extensively with these models. While other models can work, Deepseek often provides a good baseline experience for agentic tasks.
<a name="faq-troubleshooting"></a>
**Q: Help! I get an error when running AgenticSeek or its scripts. What should I do?**
Here's a step-by-step troubleshooting guide:
1. **Read the Error Message Carefully:** The error message itself is the most important clue. Try to understand what it's saying.
2. **Check Prerequisites & Installation:**
* **Python Version:** Are you using Python 3.10.x? Verify with `python --version` (or `python3.10 --version`) in your activated virtual environment.
* **Virtual Environment:** Is your virtual environment (`agentic_seek_env`) activated? You should see its name in your terminal prompt. If not, activate it (see [Installation](#2-create-a-python-virtual-environment)).
* **Dependencies:** Did `pip3 install -r requirements.txt` complete without errors? If not, address those errors first. Check for missing system dependencies mentioned in the [Manual Installation](#manual-installation) section.
* **Core Software:** Are Git, Docker Engine, Docker Compose (V2, `docker compose`), and Google Chrome installed correctly?
* **ChromeDriver:** Is ChromeDriver installed, matching your Chrome version, and accessible (in PATH or project root)? See [ChromeDriver Installation](#chromedriver-installation) and [ChromeDriver Issues](#chromedriver-issues).
3. **Verify Service Status (`./start_services.sh` or `start_services.cmd`):**
* Did this script complete successfully? Review its output for any error messages (e.g., Docker not running, port conflicts).
* Are essential services like SearxNG running? Try accessing `http://localhost:8080` in your browser. If it doesn't load, the services didn't start correctly.
4. **Check `config.ini` (See [Config Section](#config) for details):**
* Is the file correctly named `config.ini` (not `config.ini.example`)?
* `provider_name`: Does it match your intended setup (e.g., `ollama`, `lm-studio`, `openai`, `google`)?
* `is_local`: `True` for local LLMs, `False` for cloud APIs.
* `provider_server_address`:
* For local LLMs: Is it correct (e.g., `http://127.0.0.1:11434` for Ollama, `http://127.0.0.1:1234` for LM-Studio)? Does it include `http://`?
* For API usage, this is usually less critical but ensure it's not misconfigured if present.
* `work_dir`: Is this set to a valid, existing directory path on your system where AgenticSeek can read/write files?
5. **Local LLM Provider Status (if `is_local = True`):**
* Is your chosen LLM provider software (Ollama, LM-Studio) running independently?
* Ollama: `ollama serve` should be active (often runs as a background service after installation). Check with `ollama list`.
* LM-Studio: The application should be open, the model loaded, and the local server started from its UI.
* Have you downloaded/pulled the specific model listed in `provider_model` in `config.ini`? (e.g., `ollama pull model-name`).
6. **API Key Setup (if `is_local = False`):**
* Is the API key correctly set as an environment variable for your current terminal session? (See [Setup to run with an API](#2-set-your-api-key-as-an-environment-variable) and [FAQ: How do I set API keys?](#how-do-i-set-api-keys)).
* Is the key itself correct and active?
7. **Consult Known Issues:** Review the [Known Issues](#known-issues) section above for solutions to common problems.
8. **Search GitHub Issues:** Check if other users have reported similar problems on the [AgenticSeek GitHub Issues page](https://github.com/Fosowl/agenticSeek/issues).
9. **Raise an Issue:** If you're still stuck, please [create a new issue](https://github.com/Fosowl/agenticSeek/issues/new/choose). Provide as much detail as possible:
* Your Operating System (e.g., Windows 11, macOS Sonoma, Ubuntu 22.04).
* Python version.
* Relevant parts of your `config.ini` (please redact API keys).
* The exact steps you took.
* The full error message and any relevant logs from the terminal.
<a name="faq-100-local"></a>
**Q: Can AgenticSeek really run 100% locally?**
Yes. When configured with a local LLM provider like Ollama or LM-Studio (and `is_local = True` in `config.ini`), all core components—LLM inference, web search (via local SearxNG), speech-to-text, and text-to-speech—can run on your machine without sending data to external cloud services. Using API providers is optional.
<a name="faq-install-local-llm"></a>
**Q: How do I install local LLM providers like Ollama or LM-Studio?**
* **Ollama:**
1. Go to [ollama.ai](https://ollama.ai/).
2. Download the installer for your operating system (Windows, macOS, Linux).
3. Run the installer. Ollama typically sets itself up as a background service.
4. Open your terminal and you can start pulling models (e.g., `ollama pull deepseekcoder:6.7b`).
5. Run `ollama serve` if it's not already running (though it usually starts automatically).
* **LM-Studio:**
1. Go to [lmstudio.ai](https://lmstudio.ai/).
2. Download the installer for your system.
3. Install and run the application.
4. Use the LM-Studio UI to search for and download models.
5. In the "Local Server" tab, select your model and click "Start Server".
<a name="faq-get-models-local"></a>
**Q: Where do I get models (e.g., Deepseek, Qwen) for my local provider?**
* **Ollama:** Use the `ollama pull` command followed by the model name and tag. Common models can be found on [Ollama's model library](https://ollama.ai/library).
```sh
ollama pull deepseekcoder:6.7b # Pulls a specific version of Deepseek Coder
ollama pull qwen:14b # Pulls a specific version of Qwen
ollama list # Shows models you have downloaded
```
* **LM-Studio:** Use the search bar within the LM-Studio application to find models from Hugging Face and other sources. You can then download them through the UI. Ensure you download GGUF format models compatible with llama.cpp-based engines, which LM-Studio uses.
<a name="faq-set-api-keys"></a>
**Q: How do I set API keys (e.g., for OpenAI, Google) correctly?**
API keys are usually set as environment variables. This means they are variables available to the processes running in your terminal session or system-wide.
* **Linux/macOS:**
* **For the current terminal session only:**
```sh
export OPENAI_API_KEY="your_openai_api_key_here"
export GOOGLE_API_KEY="your_google_api_key_here"
# etc. for other providers
```
* **For persistence (recommended):** Add the `export` line(s) to your shell's configuration file. This file is usually:
* `~/.bashrc` (for Bash shell, common on Linux)
* `~/.zshrc` (for Zsh shell, default on newer macOS)
* `~/.profile` or `~/.bash_profile` (other common locations)
After adding the line, either source the file (e.g., `source ~/.bashrc`) or open a new terminal window for the changes to take effect.
* **Windows:**
* **Command Prompt (CMD - for current session only):**
```cmd
set OPENAI_API_KEY=your_openai_api_key_here
```
* **PowerShell (for current session only):**
```powershell
$env:OPENAI_API_KEY="your_openai_api_key_here"
```
* **Permanently (Recommended):**
1. In the Windows search bar, type "environment variables" and select "Edit the system environment variables."
2. In the System Properties window, click the "Environment Variables..." button.
3. Under "User variables" (for your account only) or "System variables" (for all users, requires admin rights), click "New...".
4. Enter the variable name (e.g., `OPENAI_API_KEY`) and the variable value (your actual API key).
5. Click OK on all windows. You may need to close and reopen any active Command Prompt or PowerShell windows for the changes to take effect.
**Important:**
* Replace `OPENAI_API_KEY`, `GOOGLE_API_KEY`, etc., with the specific environment variable name expected by the application or library for that provider. These are often found in the provider's API documentation.
* Ensure there are no extra spaces or quotes around the actual key unless they are part of the key itself.
<a name="faq-install-script-fails"></a>
**Q: What if `install.sh` or `install.bat` fails?**
If the automatic installation scripts encounter errors:
1. **Examine the Output:** Look closely at the error messages printed in the terminal. This will often tell you which step failed and why.
2. **Try Manual Installation:** Follow the [Manual Installation](#manual-installation) steps for your operating system. This gives you more control over each step and can help pinpoint the problem.
3. **System Dependencies:** Failures are often due to missing system-level dependencies required by Python packages (e.g., `portaudio-dev` for `pyaudio`). Ensure these are installed.
4. **Permissions:** On Linux/macOS, some commands within the script might require `sudo` if your user doesn't have the necessary permissions (e.g., for installing system packages).
5. If you continue to have issues, refer to the general [troubleshooting FAQ](#faq-troubleshooting).
**Q: Why should I use AgenticSeek as an alternative to other tools?**
AgenticSeek was started as a side-project driven by interest in AI agents, with a strong emphasis on:
* **Local First & Privacy:** Prioritizing the ability to run entirely on your own hardware using local LLMs, ensuring your data stays private and avoiding API costs.
* **Open Source:** Allowing for transparency, community contributions, and customization.
* **Inspired by Sci-Fi, Built for Practicality:** Drawing inspiration from concepts like Jarvis and Friday for a "cool" user experience, while focusing on practical functionalities similar to tools like Manus AI, aiming to provide a robust local alternative.
* **Control & Independence:** Giving users more control over their AI assistant by reducing dependency on external, proprietary systems.
## Contribute
Were looking for developers to improve AgenticSeek! Check out open issues or discussion.
@@ -831,8 +486,13 @@ Were looking for developers to improve AgenticSeek! Check out open issues or
## Maintainers:
> [Fosowl](https://github.com/Fosowl) | Paris Time | (Sometime busy)
> [Fosowl](https://github.com/Fosowl) | Paris Time
> [https://github.com/antoineVIVIES](antoineVIVIES) | Taipei Time | (Often busy)
> [antoineVIVIES](https://github.com/antoineVIVIES) | Taipei Time
> [steveh8758](https://github.com/steveh8758) | Taipei Time
## Special Thanks:
> [tcsenpai](https://github.com/tcsenpai) and [plitc](https://github.com/plitc) For helping with backend dockerization
> [steveh8758](https://github.com/steveh8758) | Taipei Time | (Always busy)
+311 -336
View File
@@ -1,44 +1,48 @@
# AgenticSeek: Private, Local Manus Alternative.
# AgenticSeek:私有、本地的 Manus 替代方案
<p align="center">
<img align="center" src="./media/whale_readme.jpg">
<img align="center" src="./media/agentic_seek_logo.png" width="300" height="300" alt="Agentic Seek Logo">
<p>
[English](./README.md) | 中文 | [日本語](./README_JP.md)
[English](./README.md) | 中文 | [繁體中文](./README_CHT.md) | [Français](./README_FR.md) | [日本語](./README_JP.md) | [Português (Brasil)](./README_PTBR.md)
*一个 **100% 本地替代 Manus AI** 的方案,这款支持语音的 AI 助理能够自主浏览网页、编写代码规划任务,同时将所有数据保留在您的设备上。专为本地推理模型量身打造,完全在您自己的硬件上运行,确保完全的隐私保护和零云端依赖。*
*一个**100%本地运行的 Manus AI 替代品**支持语音的 AI 助手,可自主浏览网页、编写代码规划任务,所有数据仅保存在你的设备上。专为本地推理模型设计,完全在的硬件上运行,确保隐私无忧,无需云端依赖。*
[![Visit AgenticSeek](https://img.shields.io/static/v1?label=Website&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![License](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=Update%20%40Fosowl)](https://x.com/Martin993886460)
[![访问 AgenticSeek](https://img.shields.io/static/v1?label=Website&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![License](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=Update%20%40Fosowl)](https://x.com/Martin993886460) [![GitHub stars](https://img.shields.io/github/stars/Fosowl/agenticSeek?style=social)](https://github.com/Fosowl/agenticSeek/stargazers)
### 为什么选择 AgenticSeek
* 🔒 完全本地化与隐私保护 - 所有功能都在您的设备上运行 — 无云端服务,无数据共享。的文件、对话和搜索始终保持私密。
* 🔒 完全本地 & 私有 —— 所有内容都在你的电脑上运行,无云端、无数据共享。的文件、对话和搜索保持私密。
* 🌐 智能网页浏览 - AgenticSeek 能够自主浏览互联网搜索、阅读、提取信息、填写网页表单 — 全程无需人工操作
* 🌐 智能网页浏览 —— AgenticSeek 自主浏览互联网搜索、阅读、提取信息、填写网页表单,全程免手动
* 💻 自主编码助手 - 需要代码?它可以编写、调试并运行 Python、C、Go、Java 等多种语言的程序 — 全程无需监督。
* 💻 自动化编程助手 —— 需要代码?它编写、调试并运行 Python、C、Go、Java 等程序,无需监督。
* 🧠 智能代理选择 - 您提问,它自动选择最适合该任务的代理。就像有一个随时待命的专家团队
* 🧠 智能代理选择 —— 你提问,它自动判断最合适的代理来完成任务。就像有一支专家团队随时待命
* 📋 规划执行复杂任务 - 从旅行规划到复杂项目 — 它能将大任务分为步骤,并利用多个 AI 代理完成工作
* 📋 规划执行复杂任务 —— 从旅行规划到复杂项目,可将大任务分为步骤,用多个 AI 代理协作完成。
* 🎙️ 语音功能 - 清晰、快速、未来感十足的语音与语音转文本功能,让您能像科幻电影中一样与您的个人 AI 助手对话。
* 🎙️ 语音支持 —— 干净、快速、未来感的语音与语音转文本功能,让像科幻电影中的 AI 一样与它对话。(开发中)
https://github.com/user-attachments/assets/4bd5faf6-459f-4f94-bd1d-238c4b331469
### **演示**
> 🛠️ **目前还在开发阶段** – 欢迎任何贡献者加入我们!
> *你能搜索 agenticSeek 项目,了解需要哪些技能,然后打开 CV_candidates.zip 并告诉我哪些最匹配该项目吗?*
---
https://github.com/user-attachments/assets/b8ca60e9-7b3b-4533-840e-08f9ac426316
## **安装**
免责声明:本演示及出现的所有文件(如 CV_candidates.zip)均为虚构。我们不是公司,只寻求开源贡献者而非候选人。
确保已安装了 Chrome driverDocker 和 Python 3.10(或更新)。
> 🛠⚠️ **项目正在积极开发中**
我们强烈建议您使用 Python 3.10 进行设置,否则可能会发生依赖错误
> 🙏 本项目起初只是一个副业,没有路线图也没有资金支持。它意外地登上了 GitHub Trending。非常感谢大家的贡献、反馈与耐心
有关于 Chrome driver 的问题,请参见 **Chromedriver** 部分。
## 前置条件
### 1️⃣ **复制储存库与设置环境变数**
请确保已安装 chrome driver、docker 和 python3.10。
如遇 chrome driver 相关问题,请参见 **Chromedriver** 部分。
### 1. **克隆仓库并初始化**
```sh
git clone https://github.com/Fosowl/agenticSeek.git
@@ -46,365 +50,337 @@ cd agenticSeek
mv .env.example .env
```
### 2 **建立虚拟环境**
### 2. 修改 .env 文件内容
```sh
python3 -m venv agentic_seek_env
source agentic_seek_env/bin/activate
# On Windows: agentic_seek_env\Scripts\activate
SEARXNG_BASE_URL="http://127.0.0.1:8080"
REDIS_BASE_URL="redis://redis:6379/0"
WORK_DIR="/Users/mlg/Documents/workspace_for_ai"
OLLAMA_PORT="11434"
LM_STUDIO_PORT="1234"
CUSTOM_ADDITIONAL_LLM_PORT="11435"
OPENAI_API_KEY='optional'
DEEPSEEK_API_KEY='optional'
OPENROUTER_API_KEY='optional'
TOGETHER_API_KEY='optional'
GOOGLE_API_KEY='optional'
ANTHROPIC_API_KEY='optional'
```
### 3️⃣ **安装所需套件**
**API Key 完全可选,若你选择本地运行 LLM(本项目主要目的),可留空,只要硬件足够。**
**自动安装:**
以下环境变量用于配置应用的连接和 API 密钥。
根据需要更新 `.env` 文件:
- **SEARXNG_BASE_URL**:保持不变
- **REDIS_BASE_URL**:保持不变
- **WORK_DIR**:本地工作目录路径,AgenticSeek 可读取和操作这些文件
- **OLLAMA_PORT**Ollama 服务端口
- **LM_STUDIO_PORT**LM Studio 服务端口
- **CUSTOM_ADDITIONAL_LLM_PORT**:自定义 LLM 服务端口
下方所有 API 密钥环境变量均为**可选**,仅在你打算使用外部 API 而非本地 LLM 时填写。
### 3. **启动 Docker**
确保已安装并运行 Docker。可通过以下命令启动:
- **Linux/macOS**
打开终端运行:
```sh
sudo systemctl start docker
```
或在应用菜单启动 Docker Desktop。
- **Windows**
在开始菜单启动 Docker Desktop。
验证 Docker 是否运行:
```sh
./install.sh
docker info
```
如能看到 Docker 信息,则运行正常。
** 若要让文本转语音(TTS)功能支持中文,你需要安装 jieba(中文分词库)和 cn2an(中文数字转换库):**
---
```
pip3 install jieba cn2an
```
## 本地运行 LLM 的设置
**手动安装:**
**硬件要求:**
本地运行 LLM 需有足够硬件。至少需支持 Qwen/Deepseek 14B 的 GPU。详细模型/性能建议见 FAQ。
**注意:对于任何操作系统,请确保您安装的 ChromeDriver 与您已安装的 Chrome 版本匹配。运行 `google-chrome --version`。如果您的 Chrome 版本 > 135,请参阅已知问题**
**启动本地 provider**
- *Linux*:
更新软件包列表:`sudo apt update`
安装依赖项:`sudo apt install -y alsa-utils portaudio19-dev python3-pyaudio libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1`
安装与您的 Chrome 浏览器版本匹配的 ChromeDriver
`sudo apt install -y chromium-chromedriver`
安装 requirements`pip3 install -r requirements.txt`
- *Macos*:
更新 brew`brew update`
安装 chromedriver`brew install --cask chromedriver`
安装 portaudio`brew install portaudio`
升级 pip`python3 -m pip install --upgrade pip`
升级 wheel`pip3 install --upgrade setuptools wheel`
安装 requirements`pip3 install -r requirements.txt`
- *Windows*:
安装 pyreadline3`pip install pyreadline3`
手动安装 portaudio(例如,通过 vcpkg 或预编译的二进制文件),然后运行:`pip install pyaudio`
从以下网址手动下载并安装 chromedriverhttps://sites.google.com/chromium.org/driver/getting-started
将 chromedriver 放置在包含在您的 PATH 中的目录中。
安装 requirements`pip3 install -r requirements.txt`
## 在本地机器上运行 AgenticSeek
**建议至少使用 Deepseek 14B 以上参数的模型,较小的模型难以使用助理功能并且很快就会忘记上下文之间的关系。**
**本地运行助手**
启动你的本地提供者,例如使用 ollama:
以 ollama 为例,启动本地 provider
```sh
ollama serve
```
请参阅下方支持的本地提供者列表。
下方有本地支持的 provider 列表。
**更新 config.ini**
**修改 config.ini**
修改 config.ini 文件以设置 provider_name 为支持的提供者,并将 provider_model 设置为该提供者支持的 LLM。我们推荐使用具有推理能力的模型*Qwen**Deepseek*
config.ini 文件中的 provider_name 设置为支持的 providerprovider_model 设置为 provider 支持的 LLM。推荐推理模型如 *Qwen* 或 *Deepseek*
请参见 README 末尾**FAQ** 部分了解所需硬件
详细硬件要求见 README 末尾 FAQ
```sh
[MAIN]
is_local = True # 无论是在本地运行还是使用远程提供者。
provider_name = ollama # 或 lm-studio, openai 等..
provider_model = deepseek-r1:14b # 选择适合硬件的模型
is_local = True # 是否本地运行
provider_name = ollama # 或 lm-studioopenai 等
provider_model = deepseek-r1:14b # 选择适合硬件的模型
provider_server_address = 127.0.0.1:11434
agent_name = Jarvis # 您的 AI 助手的名称
recover_last_session = True # 是否恢复之前的会话
save_session = True # 是否记住当前会话
speak = True # 文本转语音
listen = False # 语音转文本,仅适用于命令行界面
work_dir = /Users/mlg/Documents/workspace # AgenticSeek 的工作空间。
jarvis_personality = False # 是否使用更"贾维斯"风格的性格,不推荐在小型模型上使用
languages = en zh # 语言列表,文本转语音将默认使用列表中的第一种语言
agent_name = Jarvis # AI 名称
recover_last_session = True # 是否恢复上次会话
save_session = True # 是否保存当前会话
speak = False # 语音输出
listen = False # 语音输入,仅 CLI,实验性
jarvis_personality = False # 是否使用 Jarvis 风格(实验性)
languages = en zh # 语言列表,语音默认第一个
[BROWSER]
headless_browser = True # 是否使用无头浏览器,只有在使用网页界面时才推荐使用。
stealth_mode = True # 使用无法检测的 selenium 来减少浏览器检测
headless_browser = True # 除非 CLI,否则保持不变
stealth_mode = True # 使用 undetected selenium 降低被检测概率
```
警告:使用 LM-studio 运行 LLM 时,请*不要*将 provider_name 设置为 `openai`。请将其设置为 `lm-studio`
**警告:**
注意:某些提供者(如 lm-studio)需要在 IP 前面加上 `http://`。例如 `http://127.0.0.1:1234`
- `config.ini` 不支持注释。不要直接复制示例配置,否则注释会导致错误。请手动修改 config.ini,去除注释。
- 若用 LM-studio 运行 LLMprovider_name 不要设为 `openai`,应设为 `lm-studio`。
- 某些 provider(如 lm-studio)要求 IP 前加 `http://`,如 `http://127.0.0.1:1234`
**本地提供者列表**
**本地 provider 列表**
| 提供者 | 本地? | 描述 |
|-------------|--------|-------------------------------------------------------|
| ollama | 是 | 使用 ollama 作为 LLM 提供者,轻松本地运行 LLM |
| lm-studio | 是 | 使用 LM Studio 本地运行 LLM`provider_name``lm-studio`|
| openai | 否 | 使用兼容 API |
| Provider | 本地 | 说明 |
|-----------|--------|----------------------------------------------------|
| ollama | 是 | 使用 ollama 本地运行 LLM |
| lm-studio | 是 | 使用 LM studio 本地运行 LLMprovider_name 设为 lm-studio|
| openai | 是 | 使用 openai 兼容 API(如 llama.cpp server |
下一步: [Start services and run AgenticSeek](#Start-services-and-Run)
下一步:[启动服务并运行 AgenticSeek](#Start-services-and-Run)
*如遇问题见**已知问题**部分*
*硬件无法本地运行 deepseek 时见**API 运行**部分*
*详细配置说明见**Config**部分*
---
## **Run with an API (透过 API 执行)**
## 使用 API 运行设置
设定 `config.ini`
**API 运行为可选,见上方本地运行方法。**
在 `config.ini` 设置所需 provider。API provider 列表如下。
```sh
[MAIN]
is_local = False
provider_name = openai
provider_model = gpt-4o
provider_server_address = 127.0.0.1:5000
provider_name = google
provider_model = gemini-2.0-flash
provider_server_address = 127.0.0.1:5000 # 无关紧要
```
警告:确保 config 中无多余空格。
警告:确保 `config.ini` 没有行尾空格。
导出 API key`export <<PROVIDER>>_API_KEY="xxx"`
如果使用基于本机的 openai-based api 则把 `is_local` 设定为 `True`
示例:`export TOGETHER_API_KEY="xxxxx"`
同时更改你的 IP 为 openai-based api 的 IP。
**API provider 列表**
下一步: [Start services and run AgenticSeek](#Start-services-and-Run)
| Provider | 本地? | 说明 |
|-----------|--------|----------------------------------------------------|
| openai | 视情况 | 使用 ChatGPT API |
| deepseek | 否 | Deepseek API(非私有) |
| huggingface| 否 | Hugging-Face API(非私有) |
| togetherAI | 否 | 使用 together AI API(非私有) |
| google | 否 | 使用 google gemini API(非私有) |
注意:使用 gemini 时代码/bash 可能失败,模型对格式提示不敏感,优化针对 deepseek r1。gpt-4o 在本项目 prompt 下表现也较差。
下一步:[启动服务并运行 AgenticSeek](#Start-services-and-Run)
*如遇问题见**已知问题**部分*
*详细配置说明见**Config**部分*
---
## Start services and Run
(启动服务并运行)
## 启动服务并运行
启动所需服务。此操作会启动 docker-compose.yml 中的所有服务,包括:
- searxng
- redissearxng 依赖)
- frontend
- backend(如用 `full`
如果需要,请激活你的 Python 环境。
```sh
source agentic_seek_env/bin/activate
./start_services.sh full # MacOS
start ./start_services.cmd full # Windows
```
启动所需的服务。这将启动 `docker-compose.yml` 中的所有服务,包括:
- searxng
- redis(由 redis 提供支持)
- 前端
**警告:** 此步骤会下载并加载所有 Docker 镜像,可能需 30 分钟。启动后请等待 backend 服务完全运行(日志中出现 backend: <info>),再发送消息。backend 启动比其他服务慢。
访问 `http://localhost:3000/`,即可看到网页界面。
**可选:使用 CLI 界面运行:**
如需 CLI 界面,需在主机安装依赖:
```sh
sudo ./start_services.sh # MacOS
./install.sh
./install.bat # windows
```
启动服务:
```sh
./start_services.sh # MacOS
start ./start_services.cmd # Windows
```
**选项 1:** 使用 CLI 界面运行。
```sh
python3 cli.py
```
**选项 2:** 使用 Web 界面运行。
注意:目前我們建議您使用 CLI 界面。Web 界面仍在積極開發中。
启动后端服务。
```sh
python3 api.py
```
访问 `http://localhost:3000/`,你应该会看到 Web 界面。
请注意,目前 Web 界面不支持消息流式传输。
*如果你不知道如何开始,请参阅 **Usage** 部分*
然后运行:`python3 cli.py`
---
## Usage 使用方法
## 使用方法
确保 agenticSeek 在中文环境下正常工作,请确保在 config.ini 中设置语言选项
languages = en zh
更多信息请参阅 Config 部分
确保服务已通过 `./start_services.sh full` 启动,并访问 `localhost:3000` 使用网页界面
确定所有的核心档案都启用了,也就是执行过这条命令 `./start_services.sh` 然后你就可以使用 `python3 cli.py` 来启动 AgenticSeek 了!
CLI 模式下可通过设置 `listen = True` 启用语音转文本。
```sh
sudo ./start_services.sh
python3 cli.py
```
退出时,只需说/输入 `goodbye`。
当你看到执行后显示 `>>> `
这表示一切运作正常,AgenticSeek 正在等待你给他任何指令。
你也可以透过设定 `config.ini` 内的 `listen = True` 来启用语音转文字。
以下为示例用法:
要退出时,只要和他说 `goodbye` 就可以退出!
> *用 python 写一个贪吃蛇游戏!*
以下是一些用法:
> *搜索法国雷恩的最佳咖啡馆,并将三家及其地址保存到 rennes_cafes.txt。*
### Coding/Bash
> *写一个 Go 程序计算阶乘,保存为 factorial.go 到你的工作区*
> *在 Golang 中帮助我进行矩阵乘法*
> *在 summer_pictures 文件夹中查找所有 JPG 文件,用今天日期重命名,并将重命名文件列表保存到 photos_list.txt*
> *使用 nmap 扫描我的网路,找出是否有任何可疑装置连接*
> *在线搜索 2024 年热门科幻电影,挑选三部今晚观看,保存到 movie_night.txt。*
> *用 Python 制作一个贪食蛇游戏*
> *搜索 2025 年最新 AI 新闻文章,选三篇,写 Python 脚本抓取标题和摘要,脚本保存为 news_scraper.py,摘要保存到 ai_news.txt/home/projects*
### 网路搜寻
> *周五,搜索免费股票价格 API,用 supersuper7434567@gmail.com 注册,然后写 Python 脚本每日获取特斯拉股价,结果保存到 stock_prices.csv*
> *进行网路搜寻,找出日本从事尖端人工智慧研究的酷炫科技新创公司*
*表单填写功能仍为实验性,可能失败。*
> *你能在网路上找到谁创造了 AgenticSeek 吗?*
输入查询后,AgenticSeek 会自动分配最佳代理执行任务。
> *你能在哪个网站上找到便宜的 RTX 4090 吗?*
由于目前为早期原型,代理路由系统可能无法总是正确分配代理。
### 档案浏览与搜寻
因此,建议明确表达需求及 AI 执行方式。例如需网页搜索时,不要说:
> *嘿,你能找到我遗失的 million_dollars_contract.pdf 在哪里吗?*
`你知道哪些适合独自旅行的国家吗?`
> *告诉我我的磁碟还剩下多少空间*
而应说:
> *寻找并阅读 README.md,并按照安装说明进行操作*
### 日常聊天
> *告诉我关于法国的事*
> *人生的意义是什么?*
> *我应该在锻炼前还是锻炼后服用肌酸?*
当你把指令送出后,AgenticSeek 会自动调用最能提供帮助的助理,去完成你交办的工作和指令。
但也有可能出现怪怪的情况,或是你要找飞机机票,他跑去教你如何一步步做出一台飞机(开玩笑的,但真的可能出现),因为这是一个早期专案,我们会努力教导他、完善他的!
所以我们希望你在使用时,能明确地表明你希望他要怎么做,下面给你一个范例!
你该说:
- 进行网络搜索,找出哪些国家最适合独自旅行
而不是说:
- 你知道哪些国家适合独自旅行?
`请进行网页搜索,找出最适合独自旅行的国家`
---
## **在自有服务器运行 LLM 的设置**
---
如有高性能电脑或服务器,可用自定义 llm server 远程运行 LLM。
## **在本地执行属于你的 LLM 伺服器**
如果你有一台功能强大的电脑或伺服器,但你想透过笔记型电脑使用它,那么你可以选择在远端伺服器上执行 LLM。
### 1️⃣ **设定并启动伺服器脚本**
在运行 AI 模型的「伺服器」上,取得 IP 位址
在运行 AI 模型的“服务器”上获取 IP 地址:
```sh
ip a | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1
ip a | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1 # 本地 IP
curl https://ipinfo.io/ip # 公网 IP
```
注意:请在 Windows 或 MacOS,分别使用 `ipconfig``ifconfig` 来寻找 IP 位址
注:Windows/macOS 可用 ipconfigifconfig 查询 IP
**如果你希望使用基于 Openai 的服务,请按照 *透过 API 执行* 部分进行。**
复制储存库并且进入 `server/` 资料夹。
克隆仓库并进入 `server/` 文件夹:
```sh
git clone --depth 1 https://github.com/Fosowl/agenticSeek.git
cd agenticSeek/server/
cd agenticSeek/llm_server/
```
安装伺服器所需的套件
安装服务器依赖
```sh
pip3 install -r requirements.txt
```
执行伺服器脚本。
运行服务器脚本:
```sh
python3 app.py --provider ollama --port 3333
```
您可以选择使用 `ollama``llamacpp` 作为 LLM 服务框架
可选择 `ollama` 或 `llamacpp` 作为 LLM 服务。
### 2️⃣ **执行**
在你的个人电脑上:
在你的电脑上:
- 更改 `config.ini`
- `provider_name = server`
- `provider_model = deepseek-r1:14b`
- `provider_server_address = {你执行模型的电脑的 IP 位址}`
修改 `config.ini`,将 `provider_name` 设为 `server``provider_model` 设为 `deepseek-r1:xxb`。
`provider_server_address` 设为运行模型机器的 IP。
```sh
[MAIN]
is_local = False
provider_name = server
provider_model = deepseek-r1:14b
provider_model = deepseek-r1:70b
provider_server_address = x.x.x.x:3333
```
下一步:[启动服务并运行 AgenticSeek](#Start-services-and-Run)
---
## 语音转文
## 语音转文
请注意,目前语音转文字功能仅支持英语
警告:目前仅 CLI 模式支持语音转文本
预设状况下,语音转文字功能是停用的。若要启用它,请在 `config.ini` 档案中,将 `listen` 选项设为 `True`
目前仅支持英文语音转文本。
默认关闭语音转文本。启用方法:在 config.ini 设置 listen 为 True
```
listen = True
```
启用后 AgenticSeek 会聆听你是否呼唤他,他才会开始听你说的话,你可以在 *config.ini* 内去设定,要怎么叫他。
启用后,语音转文本会监听触发词(即 agent 名称),再开始处理输入。可通过修改 *config.ini* 的 `agent_name` 自定义:
```
agent_name = Friday
```
为了获得比较好的结果,我们建议使用常见英文名称(JohnEmma”)作为他的名字
建议使用常见英文名如 "John""Emma" 作为 agent 名称
当你看到程式开始执行时,请大声说出他的名字,就可以唤醒 AgenticSeek 去聆听!(如Friday
看到转录开始出现后,呼叫 agent 名称唤醒(如Friday”)。
清楚说出你的求。
清晰说出你的求。
确认短句结束你说的话,以通知 AgenticSeek 继续。确认短句的范例包括
确认短语结尾,表示系统可继续处理。例如
```
"do it", "go ahead", "execute", "run", "start", "thanks", "would ya", "please", "okay?", "proceed", "continue", "go on", "do that", "go it", "do you understand?"
```
## Config
## 配置说明
Config 范例:
配置示例:
```
[MAIN]
is_local = True
provider_name = ollama
provider_model = deepseek-r1:1.5b
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:11434
agent_name = Friday
recover_last_session = False
save_session = False
speak = False
listen = False
work_dir = /Users/mlg/Documents/ai_folder
jarvis_personality = False
languages = en zh
[BROWSER]
@@ -412,160 +388,159 @@ headless_browser = False
stealth_mode = False
```
**说明**:
- is_local
- True:在本地运行。
- False:在远端伺服器运行。
- provider_name
- 框架类型
- `ollama`, `server`, `lm-studio`, `deepseek-api`
- provider_model
- 运行的模型
- `deepseek-r1:1.5b`, `deepseek-r1:14b`
- provider_server_address
- 伺服器 IP
- `127.0.0.1:11434`
- agent_name
- AgenticSeek 的名字,用作TTS的触发单词。
- `Friday`
- recover_last_session
- True:从上个对话继续。
- False:重启对话。
- save_session
- True:储存对话纪录。
- False:不保存。
- speak
- True:启用语音输出。
- False:关闭语音输出。
- listen
- True:启用语音输入。
- False:关闭语音输入。
- work_dir
- AgenticSeek 拥有能存取与交互的工作目录。
- jarvis_personality
> 就是那个钢铁人的 JARVIS
- True:启用 JARVIS 个性。
- False:关闭 JARVIS 个性。
- headless_browser
- True:前景浏览器。(很酷,推荐使用他 XD)
- False:背景执行浏览器。
- stealth_mode
- 隐私模式,但需要你自己安装反爬虫扩充功能。
- languages
- 支持的语言列表。用于代理路由系统。语言列表越长,下载的模型越多。
**说明**
## 框架
- is_local -> 本地运行(True)或远程服务器(False)
下表显示了可用的框架:
- provider_name -> 使用的 provider(如:`ollama`、`server`、`lm-studio`、`deepseek-api`
| 框架 | 本地? | 描述|
|-|-|-|
| ollama | 可 | 使用 ollama 框架去执行本地模型 |
| server | 可 | 本地伺服器执行模型远端调用 |
| lm-studio | 可 | 使用 LM Studio 在本地运行 LLM(设定provider_name为lm-studio|
| openai | 不可 | 使用 ChatGPT API(无法保证隐私)|
| deepseek-api | 不可 | 使用 Deepseek API (无法保证隐私)|
| huggingface | 不可 | 使用 Hugging-Face API (无法保证隐私)|
- provider_model -> 使用的模型,如 deepseek-r1:32b
若要选择框架,请变更 `config.ini` 文件:
- provider_server_address -> 服务器地址,如 127.0.0.1:11434(本地),API 可随意
- agent_name -> 代理名称,如 Friday,语音唤醒词
- recover_last_session -> 是否恢复上次会话(True/False
- save_session -> 是否保存会话数据(True/False
- speak -> 是否启用语音输出(True/False
- listen -> 是否启用语音输入(True/False
- jarvis_personality -> 是否使用 JARVIS 风格(True/False),仅更换 prompt
- languages -> 支持语言列表,供 LLM 路由使用,建议不要太多或太相似
- headless_browser -> 是否无头浏览器(True/False
- stealth_mode -> 是否降低被检测概率,需手动安装 anticaptcha 扩展
- languages -> 支持语言列表,代理路由系统需用,列表越长下载模型越多
## Provider 列表
下表为可用 provider
| Provider | 本地? | 说明 |
|-----------|--------|----------------------------------------------------|
| ollama | 是 | 使用 ollama 本地运行 LLM |
| server | 是 | 在其他机器托管模型,本机调用 |
| lm-studio | 是 | 使用 LM studio 本地运行 LLMprovider_name 设为 lm-studio|
| openai | 视情况 | 使用 ChatGPT API(非私有)或 openai 兼容 API |
| deepseek-api | 否 | Deepseek API(非私有) |
| huggingface| 否 | Hugging-Face API(非私有) |
| togetherAI | 否 | 使用 together AI API(非私有) |
| google | 否 | 使用 google gemini API(非私有) |
选择 provider 时修改 config.ini
```
is_local = False
provider_name = openai
provider_model = gpt-4o
is_local = True
provider_name = ollama
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:5000
```
`is_local`: 对于任何本地运行的 LLM 都应该为 True,否则 False。
`is_local`:本地 LLM 为 True,否则 False。
`provider_name`: 透过名称选择要使用的框架,请参阅上面的框架清单
`provider_name`:选择 provider 名称,见上表
`provider_model`: 设定 AgenticSeek 使用的模型。
`provider_model`:设置代理使用的模型。
`provider_server_address`: 如果不使用云端 API,则可以将其设定为任何内容
`provider_server_address`:如非 server provider,可随意
# Known issues 已知问题
# 已知问题
## Chromedriver Issues
## Chromedriver 问题
**已知问题 #1:** *chromedriver mismatch*
**已知错误 #1** *chromedriver 不匹配*
`Exception: Failed to initialize browser: Message: session not created: This version of ChromeDriver only supports Chrome version 113
Current browser version is 134.0.6998.89 with binary path`
如果你的浏览器 chromedriver 版本不一样,就会发生这种情况
出现此问题是浏览器 chromedriver 版本不匹配
你可以透过以下连结下载最新版本:
下载最新版本:
https://developer.chrome.com/docs/chromedriver/downloads
如果您使用的是 Chrome 版本 115 或更新版本,请前往
如用 Chrome 115 及以上,访问
https://googlechromelabs.github.io/chrome-for-testing/
下载与你的作业系统相符的 chromedriver 版本
下载与你操作系统匹配的 chromedriver。
![alt text](./media/chromedriver_readme.png)
如果有其他问题,请提供尽量详细的叙述到 Issues 上,尽可能包含当前环境和问题是怎么发生的
如本节不全请提交 issue
## 连接适配器问题
```
Exception: Provider lm-studio failed: HTTP request failed: No connection adapters were found for '127.0.0.1:11434/v1/chat/completions'
```
请确保 provider IP 前加 `http://`
`provider_server_address = http://127.0.0.1:11434`
## SearxNG base URL 必须提供
```
raise ValueError("SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.")
ValueError: SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.
```
可能未将 `.env.example` 重命名为 `.env`?也可导出 SEARXNG_BASE_URL
`export SEARXNG_BASE_URL="http://127.0.0.1:8080"`
## FAQ
**Q: 需要什麼硬體?**
**Q: 需要什么硬件?**
| 模型大小 | GPU | 備註 |
|-----------|--------|-----------------------------------------------------------|
| 7B | 8GB Vram | ⚠️ 不推。性能差,經常出現幻覺,規劃代理可能會失敗。 |
| 14B | 12 GB VRAM (例如 RTX 3060) | ✅ 適用於簡單任務。可能在網頁瀏覽和規劃任務上表現不佳。 |
| 32B | 24+ GB VRAM (例如 RTX 4090) | 🚀 大多數任務成功,但可能仍在任務規劃上有困難。 |
| 70B+ | 48+ GB Vram (例如 mac studio) | 💪 表現優異。建議用於高級使用情境。 |
| 模型规模 | GPU | 说明 |
|-----------|--------|----------------------------------------------------|
| 7B | 8GB 显存 | ⚠️ 不推。性能差,易幻觉,规划代理易失败。 |
| 14B | 12GB 显存(如 RTX 3060 | ✅ 简单任务可用,网页浏览和规划任务可能吃力。|
| 32B | 24GB+ 显存(如 RTX 4090 | 🚀 大多数任务成功,复杂规划仍有难度。 |
| 70B+ | 48GB+ 显存(如 mac studio | 💪 推荐,高级用例表现优异。 |
**Q为什么选 Deepseek R1 而不是其他模型?**
**Q: 为什么选 Deepseek R1**
就其尺寸而言,Deepseek R1 在推理和使用方面表现出色。我们认为非常适合我们的需求,其他模型也很好用,但 Deepseek 是我们最后选定的模型
Deepseek R1 在推理和工具调用方面表现优异。我们认为非常适合本项目,其他模型也用,但 Deepseek 是首选
**Q:我在执行时 `cli.py` 时出现错误。我该怎么办?**
**Q: 运行 `cli.py` 报错怎么办?**
1. 确保 Ollama 正在运行(ollama serve
2.`config.ini``provider_name` 的框架选择正确。
3. 依赖套件已安装
4. 如果均无效,请随时提出 Issues,同样尽可能包含当前环境和问题是怎么发生的。
确保本地服务(`ollama serve`)已启动,`config.ini` 配置正确,依赖已安装。如仍有问题欢迎提交 issue。
**Q:它真的是 100% 本地运行吗?**
**Q: 真能 100% 本地运行吗?**
是的,透过 Ollama 或其他框架,所有语音转文字、LLM 和文字转语音模型都在本地运行
*但你能选择非本地执行(OpenAI 或其他 API),同样也是可以的*
是的,使用 Ollama、lm-studio 或 server provider 时,语音、LLM、语音转文本均本地运行。非本地(OpenAI 等 API)为可选
**Q: 有 Manus 为什么还要用 AgenticSeek**
**Q:我有 Manus 为甚么还要用 AgenticSeek**
这是我们因为兴趣做的一个小 Side-Project,他特别的点在于是一个全部本地化的模型,而且可以像钢铁人里面一样与 `Jarvis` 对话,听起来就超级酷的吧!随着 Manus 的进化,我们也相应的加入更多功能!
**Q:它比 Manus 好在哪里?**
不不不,AgenticSeek 和 Manus 是不同取向的东西,我们优先考虑的是本地执行和隐私,而不是基于云端。这是一个与 Manus 相比起来更有趣且易使用的方案!
**Q: 是否支持中文以外的语言?**
DeepSeek R1 天生会说中文
但注意:代理路由系统只懂英文,所以必须通过 config.ini 的 languages 参数(如 languages = en zh)告诉系统:
如果不设置中文?后果可能是:你让它写代码,结果跳出来个"医生代理"(虽然我们根本没有这个代理... 但系统会一脸懵圈!)
实际上会下载一个小型翻译模型来协助任务分配
本项目起初只是兴趣驱动的副业。特别之处在于主打本地模型,避免 API。
灵感来自 Jarvis 和 Friday(钢铁侠),功能上更接近 Manus,因为大家最想要的是本地 manus 替代品。
与 Manus 不同,AgenticSeek 更注重独立性、隐私和避免 API 成本。
## 贡献
我们正在寻找开发者来改善 AgenticSeek你可以在 Issues 查看未解决的问题或和我们讨论更酷的新功能!
我们欢迎开发者改进 AgenticSeek请查看 open issues 或讨论区。
[贡献指南](./docs/CONTRIBUTING.md)
[![Star History Chart](https://api.star-history.com/svg?repos=Fosowl/agenticSeek&type=Date)](https://www.star-history.com/#Fosowl/agenticSeek&Date)
[Contribution guide](./docs/CONTRIBUTING.md)
## 维护者:
## 维护者:
> [Fosowl](https://github.com/Fosowl) | 巴黎时间
> [Fosowl](https://github.com/Fosowl) | 巴黎时间 | (有时很忙)
> [antoineVIVIES](https://github.com/antoineVIVIES) | 台北时间
> [https://github.com/antoineVIVIES](https://github.com/antoineVIVIES) | 台北时间 | (经常很忙)
> [steveh8758](https://github.com/steveh8758) | 台北时间
## 特别感谢:
> [tcsenpai](https://github.com/tcsenpai) 和 [plitc](https://github.com/plitc) 协助后端 docker 化
> [steveh8758](https://github.com/steveh8758) | 台北时间 | (总是很忙)
+313 -335
View File
@@ -1,46 +1,44 @@
# AgenticSeek: 類似 Manus 但基於 Deepseek R1 Agents 的本地模型。
# AgenticSeek:私有、本地的 Manus 替代方案
<p align="center">
<img align="center" src="./media/whale_readme.jpg">
<p>
[English](./README.md) | 中文 | [繁體中文](./README_CHT.md) | [Français](./README_FR.md) | [日本語](./README_JP.md) | [Português (Brasil)](./README_PTBR.md)
--------------------------------------------------------------------------------
[English](./README.md) | 繁體中文 | [日本語](./README_JP.md)
*一個**100%本地運行的 Manus AI 替代品**,支持語音的 AI 助手,可自主瀏覽網頁、編寫代碼、規劃任務,所有數據僅保存在你的設備上。專為本地推理模型設計,完全在你的硬件上運行,確保隱私無憂,無需雲端依賴。*
[![訪問 AgenticSeek](https://img.shields.io/static/v1?label=Website&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![License](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=Update%20%40Fosowl)](https://x.com/Martin993886460) [![GitHub stars](https://img.shields.io/github/stars/Fosowl/agenticSeek?style=social)](https://github.com/Fosowl/agenticSeek/stargazers)
*一个 **100% 本地替代 Manus AI** 的方案,這款支持語音的 AI 助理能够自主瀏覽網頁、编寫代码和規劃任務,同时將所有用戶資料保留在您的裝置上。專門為本地推理模型量身打造,完全在您自己的硬體上執行,确保完全的隐私保护和零雲端依賴。*
### 為什麼選擇 AgenticSeek
[![Visit AgenticSeek](https://img.shields.io/static/v1?label=Website&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![License](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=Update%20%40Fosowl)](https://x.com/Martin993886460)
* 🔒 完全本地 & 私有 —— 所有內容都在你的電腦上運行,無雲端、無數據共享。你的文件、對話和搜索都保持私密。
### 为什么選擇 AgenticSeek
* 🌐 智能網頁瀏覽 —— AgenticSeek 可自主瀏覽互聯網:搜索、閱讀、提取信息、填寫網頁表單,全程免手動。
* 🔒 完全本地化與隐私保护 - 所有功能都在您的设备上運行 — 无云端服务,无数据共享。您的文件、对话和搜索始终保持私密
* 💻 自動化編程助手 —— 需要代碼?它能編寫、調試並運行 Python、C、Go、Java 等程序,無需監督
* 🌐 智能網頁瀏覽 - AgenticSeek 能够自主瀏覽網頁 — 搜索、閱读、提取信息、填寫網页表單 — 全程无需人工操作
* 🧠 智能代理選擇 —— 你提問,它自動判斷最合適的代理來完成任務。就像有一支專家團隊隨時待命
* 💻 自主编码助手 - 需要代码?它可以编寫、调试并運行 Python、C、Go、Java 等多种语言的程序 — 全程无需监督
* 📋 規劃並執行複雜任務 —— 從旅行規劃到複雜項目,可將大任務拆分為步驟,調用多個 AI 代理協作完成
* 🧠 智能代理选择 - 您提问,它會自动选择最适合该任务的代理。就像拥有一个随时待命的專家团队。
* 🎙️ 語音支持 —— 乾淨、快速、未來感的語音與語音轉文本功能,讓你像科幻電影中的 AI 一樣與它對話。(開發中)
* 📋 规划與执行复杂任务 - 从旅行规划到复杂项目 — 它能將大型任务分解为步骤,并利用多个 AI 代理完成工作。
### **演示**
* 🎙️ 語音功能 - 清晰、快速、未来感十足的語音與語音轉文本功能,讓您能像科幻电影中一样與您的个人 AI 助手对话。
> *你能搜索 agenticSeek 項目,了解需要哪些技能,然後打開 CV_candidates.zip 並告訴我哪些最匹配該項目嗎?*
https://github.com/user-attachments/assets/4bd5faf6-459f-4f94-bd1d-238c4b331469
https://github.com/user-attachments/assets/b8ca60e9-7b3b-4533-840e-08f9ac426316
> 🛠️ **目前還在開發階段** – 歡迎任何貢獻者加入我們!
免責聲明:本演示及出現的所有文件(如 CV_candidates.zip)均為虛構。我們不是公司,只尋求開源貢獻者而非候選人。
---
> 🛠⚠️ **項目正在積極開發中**
## **安裝**
> 🙏 本項目起初只是一個副業,沒有路線圖也沒有資金支持。它意外地登上了 GitHub Trending。非常感謝大家的貢獻、反饋與耐心。
確保已安裝了 Chrome driverDocker 和 Python 3.10(或更新)。
## 前置條件
我们强烈建议您使用 Python 3.10 進行設定,否则可能會发生依赖错误
請確保已安裝 chrome driver、docker 和 python3.10。
有關於 Chrome driver 問題,請參見 **Chromedriver** 部分。
如遇 chrome driver 相關問題,請參見 **Chromedriver** 部分。
### 1️⃣ **複製儲存庫與設置環境變數**
### 1. **克隆倉庫並初始化**
```sh
git clone https://github.com/Fosowl/agenticSeek.git
@@ -48,355 +46,337 @@ cd agenticSeek
mv .env.example .env
```
### 2 **建立虛擬環境**
### 2. 修改 .env 文件內容
```sh
python3 -m venv agentic_seek_env
source agentic_seek_env/bin/activate
# On Windows: agentic_seek_env\Scripts\activate
SEARXNG_BASE_URL="http://127.0.0.1:8080"
REDIS_BASE_URL="redis://redis:6379/0"
WORK_DIR="/Users/mlg/Documents/workspace_for_ai"
OLLAMA_PORT="11434"
LM_STUDIO_PORT="1234"
CUSTOM_ADDITIONAL_LLM_PORT="11435"
OPENAI_API_KEY='optional'
DEEPSEEK_API_KEY='optional'
OPENROUTER_API_KEY='optional'
TOGETHER_API_KEY='optional'
GOOGLE_API_KEY='optional'
ANTHROPIC_API_KEY='optional'
```
### 3️⃣ **安裝所需套件**
**API Key 完全可選,若你選擇本地運行 LLM(本項目主要目的),可留空,只要硬件足夠。**
**自動安裝:**
以下環境變量用於配置應用的連接和 API 密鑰。
根據需要更新 `.env` 文件:
- **SEARXNG_BASE_URL**:保持不變
- **REDIS_BASE_URL**:保持不變
- **WORK_DIR**:本地工作目錄路徑,AgenticSeek 可讀取和操作這些文件
- **OLLAMA_PORT**Ollama 服務端口
- **LM_STUDIO_PORT**LM Studio 服務端口
- **CUSTOM_ADDITIONAL_LLM_PORT**:自定義 LLM 服務端口
下方所有 API 密鑰環境變量均為**可選**,僅在你打算使用外部 API 而非本地 LLM 時填寫。
### 3. **啟動 Docker**
確保已安裝並運行 Docker。可通過以下命令啟動:
- **Linux/macOS**
打開終端運行:
```sh
sudo systemctl start docker
```
或在應用菜單啟動 Docker Desktop。
- **Windows**
在開始菜單啟動 Docker Desktop。
驗證 Docker 是否運行:
```sh
./install.sh
docker info
```
如能看到 Docker 信息,則運行正常。
** 若要將文字轉成語音(TTS)功能支持中文,你需要安装 jieba(中文分詞庫)和 cn2an(中文數字轉換庫):**
---
```
pip3 install jieba cn2an
```
## 本地運行 LLM 的設置
**手動安裝:**
**硬件要求:**
本地運行 LLM 需有足夠硬件。至少需支持 Qwen/Deepseek 14B 的 GPU。詳細模型/性能建議見 FAQ。
**注意:對於不同作業系統,請確保已經安装的 ChromeDriver 與您已安装的 Chrome 版本一致。可以執行 `google-chrome --version`。如果您的 Chrome 版本 > 135,請參考已知问题**
**啟動本地 provider**
- *Linux*:
更新软件包列表:`sudo apt update`
安装依赖项:`sudo apt install -y alsa-utils portaudio19-dev python3-pyaudio libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1`
安装與您的 Chrome 瀏覽器版本匹配的 ChromeDriver
`sudo apt install -y chromium-chromedriver`
安装 requirements`pip3 install -r requirements.txt`
- *Macos*:
更新 brew`brew update`
安装 chromedriver`brew install --cask chromedriver`
安装 portaudio`brew install portaudio`
升级 pip`python3 -m pip install --upgrade pip`
升级 wheel`pip3 install --upgrade setuptools wheel`
安装 requirements`pip3 install -r requirements.txt`
- *Windows*:
安装 pyreadline3`pip install pyreadline3`
手动安装 portaudio(例如,通过 vcpkg 或預編譯的二進制文件),然後運行:`pip install pyaudio`
从以下網址手动下载并安装 chromedriverhttps://sites.google.com/chromium.org/driver/getting-started
將 chromedriver 放置在包含在您的 PATH 中的目录中。
安装 requirements`pip3 install -r requirements.txt`
## 在本地機器上運行 AgenticSeek
**建議至少使用 Deepseek 14B 以上參數的模型,較小的模型難以使用助理功能並且很快就會忘記上下文之間的關係。**
**本地運行助手**
啟動你的本地提供者,例如使用 ollama:
以 ollama 為例,啟動本地 provider
```sh
ollama serve
```
请参閱下方支持的本地提供者列表。
下方有本地支持的 provider 列表。
修改 config.ini 文件以設定 provider_name 为支持的提供者,并將 provider_model 設定为该提供者支持的 LLM。我们推荐使用具有推理能力的模型,如 *Qwen**Deepseek*
**修改 config.ini**
请参见 README 末尾的 **FAQ** 部分了解所需硬件
將 config.ini 文件中的 provider_name 設置為支持的 providerprovider_model 設置為 provider 支持的 LLM。推薦推理模型如 *Qwen**Deepseek*
詳細硬件要求見 README 末尾 FAQ。
```sh
[MAIN]
is_local = True # 无论是在本地運行还是使用远程提供者。
provider_name = ollama # 或 lm-studio, openai 等..
provider_model = deepseek-r1:14b # 选择适合您硬件的模型
is_local = True # 是否本地運行
provider_name = ollama # 或 lm-studioopenai 等
provider_model = deepseek-r1:14b # 選擇適合硬件的模型
provider_server_address = 127.0.0.1:11434
agent_name = Jarvis # 您的 AI 助手的名称
recover_last_session = True # 是否恢复之前的會话
save_session = True # 是否记住当前會
speak = True # 文本轉語音
listen = False # 語音轉文本,僅适用于命令行界面
work_dir = /Users/mlg/Documents/workspace # AgenticSeek 的工作空间。
jarvis_personality = False # 是否使用更"贾维斯"风格的性格,不推荐在小型模型上使用
languages = en zh # 语言列表,文本轉語音將默认使用列表中的第一种语言
agent_name = Jarvis # AI 名稱
recover_last_session = True # 是否恢復上次會話
save_session = True # 是否保存當前會
speak = False # 語音輸出
listen = False # 語音輸入,僅 CLI,實驗性
jarvis_personality = False # 是否使用 Jarvis 風格(實驗性)
languages = en zh # 語言列表,語音默認第一個
[BROWSER]
headless_browser = True # 是否使用无头瀏覽器,只有在使用網页界面时才推荐使用。
stealth_mode = True # 使用无法檢測的 selenium 来减少瀏覽器檢測
headless_browser = True # 除非 CLI,否則保持不變
stealth_mode = True # 使用 undetected selenium 降低被檢測概率
```
**本地提供者列表**
**警告:**
| 提供者 | 本地? | 描述 |
|-------------|--------|-------------------------------------------------------|
| ollama | 是 | 使用 ollama 作为 LLM 提供者,轻松本地運行 LLM |
| lm-studio | 是 | 使用 LM Studio 本地運行 LLM(將 `provider_name` 設定为 `lm-studio`|
| openai | 否 | 使用兼容的 API |
- `config.ini` 不支持註釋。不要直接複製示例配置,否則註釋會導致錯誤。請手動修改 config.ini,去除註釋。
下一步: [Start services and run AgenticSeek](#Start-services-and-Run)
- 若用 LM-studio 運行 LLMprovider_name 不要設為 `openai`,應設為 `lm-studio`
- 某些 provider(如 lm-studio)要求 IP 前加 `http://`,如 `http://127.0.0.1:1234`
**本地 provider 列表**
| Provider | 本地? | 說明 |
|-----------|--------|----------------------------------------------------|
| ollama | 是 | 使用 ollama 本地運行 LLM |
| lm-studio | 是 | 使用 LM studio 本地運行 LLMprovider_name 設為 lm-studio|
| openai | 是 | 使用 openai 兼容 API(如 llama.cpp server |
下一步:[啟動服務並運行 AgenticSeek](#Start-services-and-Run)
*如遇問題見**已知問題**部分*
*硬件無法本地運行 deepseek 時見**API 運行**部分*
*詳細配置說明見**Config**部分*
---
## **Run with an API (透過 API 執行)**
## 使用 API 運行設置
設定 `config.ini`
**API 運行為可選,見上方本地運行方法。**
`config.ini` 設置所需 provider。API provider 列表如下。
```sh
[MAIN]
is_local = False
provider_name = openai
provider_model = gpt-4o
provider_server_address = 127.0.0.1:5000
provider_name = google
provider_model = gemini-2.0-flash
provider_server_address = 127.0.0.1:5000 # 無關緊要
```
警告:確保 config 中無多餘空格。
警告:確保 `config.ini` 沒有行尾空格。
導出 API key`export <>_API_KEY="xxx"`
如果使用基於本機的 openai-based api 則把 `is_local` 設定為 `True`
示例:`export TOGETHER_API_KEY="xxxxx"`
同時更改你的 IP 為 openai-based api 的 IP。
**API provider 列表**
下一步: [Start services and run AgenticSeek](#Start-services-and-Run)
| Provider | 本地? | 說明 |
|-----------|--------|----------------------------------------------------|
| openai | 視情況 | 使用 ChatGPT API |
| deepseek | 否 | Deepseek API(非私有) |
| huggingface| 否 | Hugging-Face API(非私有) |
| togetherAI | 否 | 使用 together AI API(非私有) |
| google | 否 | 使用 google gemini API(非私有) |
注意:使用 gemini 時代碼/bash 可能失敗,模型對格式提示不敏感,優化針對 deepseek r1。gpt-4o 在本項目 prompt 下表現也較差。
下一步:[啟動服務並運行 AgenticSeek](#Start-services-and-Run)
*如遇問題見**已知問題**部分*
*詳細配置說明見**Config**部分*
---
## Start services and Run
(啟動服务并運行)
## 啟動服務並運行
啟動所需服務。此操作會啟動 docker-compose.yml 中的所有服務,包括:
- searxng
- redissearxng 依賴)
- frontend
- backend(如用 `full`
如果需要,请激活你的 Python 环境。
```sh
source agentic_seek_env/bin/activate
./start_services.sh full # MacOS
start ./start_services.cmd full # Windows
```
啟動所需的服务。这將啟動 `docker-compose.yml` 中的所有服务,包括:
- searxng
- redis(由 redis 提供支持)
- 前端
**警告:** 此步驟會下載並加載所有 Docker 鏡像,可能需 30 分鐘。啟動后請等待 backend 服務完全運行(日誌中出現 backend: ),再發送消息。backend 啟動比其他服務慢。
訪問 `http://localhost:3000/`,即可看到網頁界面。
**可選:使用 CLI 界面運行:**
如需 CLI 界面,需在主機安裝依賴:
```sh
sudo ./start_services.sh # MacOS
./install.sh
./install.bat # windows
```
啟動服務:
```sh
./start_services.sh # MacOS
start ./start_services.cmd # Windows
```
**選項 1:** 使用 CLI 界面運行。
```sh
python3 cli.py
```
**選項 2:** 使用 Web 界面運行。
注意:目前我們建議您使用 CLI 界面。Web 界面仍在積極開發中。
啟動後端服务。
```sh
python3 api.py
```
访问 `http://localhost:3000/`,你应该會看到 Web 界面。
请注意,目前 Web 界面不支持消息流式傳輸。
*如果你不知道如何開始,請參閱 **Usage** 部分*
然後運行:`python3 cli.py`
---
## Usage 使用方法
## 使用方法
为确保 agenticSeek 在中文环境下正常工作,请确保在 config.ini 中設定语言選項
languages = en zh
更多信息请参閱 Config 部分
確保服務已通過 `./start_services.sh full` 啟動,並訪問 `localhost:3000` 使用網頁界面
確定所有的核心檔案都啟用了,也就是執行過這條命令 `./start_services.sh` 然後你就可以使用 `python3 cli.py` 來啟動 AgenticSeek 了!
CLI 模式下可通過設置 `listen = True` 啟用語音轉文本。
```sh
sudo ./start_services.sh
python3 cli.py
```
退出時,只需說/輸入 `goodbye`
當你看到執行後顯示 `>>> `
這表示一切運作正常,AgenticSeek 正在等待你給他任何指令。
你也可以透過設定 `config.ini` 內的 `listen = True` 來啟用語音轉文字。
以下為示例用法:
要退出時,只要和他說 `goodbye` 就可以退出!
> *用 python 寫一個貪吃蛇遊戲!*
以下是一些用法:
> *搜索法國雷恩的最佳咖啡館,並將三家及其地址保存到 rennes_cafes.txt。*
### Coding/Bash
> *寫一個 Go 程序計算階乘,保存為 factorial.go 到你的工作區*
> *在 Golang 中幫助我進行矩陣乘法*
> *在 summer_pictures 文件夾中查找所有 JPG 文件,用今天日期重命名,並將重命名文件列表保存到 photos_list.txt*
> *使用 nmap 掃描我的網路,找出是否有任何可疑裝置連接*
> *在線搜索 2024 年熱門科幻電影,挑選三部今晚觀看,保存到 movie_night.txt。*
> *用 Python 製作一個貪食蛇遊戲*
> *搜索 2025 年最新 AI 新聞文章,選三篇,寫 Python 腳本抓取標題和摘要,腳本保存為 news_scraper.py,摘要保存到 ai_news.txt/home/projects*
### 網路搜尋
> *周五,搜索免費股票價格 API,用 supersuper7434567@gmail.com 註冊,然後寫 Python 腳本每日獲取特斯拉股價,結果保存到 stock_prices.csv*
> *進行網路搜尋,找出日本從事尖端人工智慧研究的酷炫科技新創公司*
*表單填寫功能仍為實驗性,可能失敗。*
> *你能在網路上找到誰創造了 AgenticSeek 嗎?*
輸入查詢后,AgenticSeek 會自動分配最佳代理執行任務。
> *你能在哪個網站上找到便宜的 RTX 4090 嗎?*
由於目前為早期原型,代理路由系統可能無法總是正確分配代理。
### 檔案瀏覽與搜尋
因此,建議明確表達需求及 AI 執行方式。例如需網頁搜索時,不要說:
> *嘿,你能找到我遺失的 million_dollars_contract.pdf 在哪裡嗎?*
`你知道哪些適合獨自旅行的國家嗎?`
> *告訴我我的磁碟還剩下多少空間*
而應說:
> *尋找並閱讀 README.md,並按照安裝說明進行操作*
### 日常聊天
> *告訴我關於法國的事*
> *人生的意義是什麼?*
> *我應該在鍛鍊前還是鍛鍊後服用肌酸?*
當你把指令送出後,AgenticSeek 會自動調用最能提供幫助的助理,去完成你交辦的工作和指令。
但也有可能出現怪怪的情況,或是你要找飛機機票,他跑去教你如何一步步做出一台飛機(開玩笑的,但真的可能出現),因為這是一個早期專案,我們會努力教導他、完善他的!
所以我們希望你在使用時,能明確地表明你希望他要怎麼做,下面給你一個範例!
你該說:
- 進行網路搜索,找出哪些国家最适合獨自旅行
而不是說:
- 你知道哪些国家适合獨自旅行?
`請進行網頁搜索,找出最適合獨自旅行的國家`
---
## **在自有服務器運行 LLM 的設置**
---
如有高性能電腦或服務器,可用自定義 llm server 遠程運行 LLM。
## **在本地執行屬於你的 LLM 伺服器**
如果你有一台功能強大的電腦或伺服器,但你想透過筆記型電腦使用它,那麼你可以選擇在遠端伺服器上執行 LLM。
### 1️⃣ **設定並啟動伺服器腳本**
在運行 AI 模型的「伺服器」上,取得 IP 位址
在運行 AI 模型的“服務器”上獲取 IP 地址:
```sh
ip a | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1
ip a | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1 # 本地 IP
curl https://ipinfo.io/ip # 公網 IP
```
注意:請在 Windows 或 MacOS,分別使用 `ipconfig``ifconfig` 來尋找 IP 位址
註:Windows/macOS 可用 ipconfigifconfig 查詢 IP
**如果你希望使用基於 Openai 的服務,請按照 *透過 API 執行* 部分進行。**
複製儲存庫並且進入 `server/` 資料夾。
克隆倉庫並進入 `server/` 文件夾:
```sh
git clone --depth 1 https://github.com/Fosowl/agenticSeek.git
cd agenticSeek/server/
cd agenticSeek/llm_server/
```
安裝伺服器所需的套件
安裝服務器依賴
```sh
pip3 install -r requirements.txt
```
執行伺服器腳本
運行服務器腳本
```sh
python3 app.py --provider ollama --port 3333
```
您可以選擇使用 `ollama``llamacpp` 作為 LLM 服務框架
可選擇 `ollama``llamacpp` 作為 LLM 服務。
### 2️⃣ **執行**
在你的個人電腦上:
在你的電腦上:
- 更改 `config.ini`
- `provider_name = server`
- `provider_model = deepseek-r1:14b`
- `provider_server_address = {你執行模型的電腦的 IP 位址}`
修改 `config.ini`,將 `provider_name` 設為 `server``provider_model` 設為 `deepseek-r1:xxb`
`provider_server_address` 設為運行模型機器的 IP。
```sh
[MAIN]
is_local = False
provider_name = server
provider_model = deepseek-r1:14b
provider_model = deepseek-r1:70b
provider_server_address = x.x.x.x:3333
```
下一步:[啟動服務並運行 AgenticSeek](#Start-services-and-Run)
---
## 語音轉文
## 語音轉文
请注意,目前語音轉文字功能僅支援英语
警告:目前僅 CLI 模式支持語音轉文本
預設狀況下,語音轉文字功能是停用的。若要啟用它,請在 `config.ini` 檔案中,將 `listen` 選項設為 `True`
目前僅支持英文語音轉文本。
默認關閉語音轉文本。啟用方法:在 config.ini 設置 listen 為 True
```
listen = True
```
啟用後 AgenticSeek 會聆聽你是否呼喚他,他才會開始聽你說的話,你可以在 *config.ini* 內去設定,要怎麼叫他。
啟用后,語音轉文本會監聽觸發詞(即 agent 名稱),再開始處理輸入。可通過修改 *config.ini*`agent_name` 自定義:
```
agent_name = Friday
```
為了獲得比較好的結果,我們建議使用常見英文名稱(JohnEmma”)作為他的名字
建議使用常見英文名如 "John""Emma" 作為 agent 名稱
當你看到程式開始執行時,請大聲說出他的名字,就可以喚醒 AgenticSeek 去聆聽!(如Friday
看到轉錄開始出現后,呼叫 agent 名稱喚醒(如Friday”)。
說出你的求。
說出你的求。
確認短句結束你說的話,以通知 AgenticSeek 繼續。確認短句的範例包括
確認短語結尾,表示系統可繼續處理。例如
```
"do it", "go ahead", "execute", "run", "start", "thanks", "would ya", "please", "okay?", "proceed", "continue", "go on", "do that", "go it", "do you understand?"
```
## Config
## 配置說明
Config 範例:
配置示例:
```
[MAIN]
is_local = True
provider_name = ollama
provider_model = deepseek-r1:1.5b
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:11434
agent_name = Friday
recover_last_session = False
save_session = False
speak = False
listen = False
work_dir = /Users/mlg/Documents/ai_folder
jarvis_personality = False
languages = en zh
[BROWSER]
@@ -404,160 +384,158 @@ headless_browser = False
stealth_mode = False
```
**說明**:
- is_local
- True:在本地運行。
- False:在遠端伺服器運行。
- provider_name
- 框架類型
- `ollama`, `server`, `lm-studio`, `deepseek-api`
- provider_model
- 運行的模型
- `deepseek-r1:1.5b`, `deepseek-r1:14b`
- provider_server_address
- 伺服器 IP
- `127.0.0.1:11434`
- agent_name
- AgenticSeek 的名字,用作TTS的觸發單詞。
- `Friday`
- recover_last_session
- True:從上個對話繼續。
- False:重啟對話。
- save_session
- True:儲存對話紀錄。
- False:不保存。
- speak
- True:啟用語音輸出。
- False:關閉語音輸出。
- listen
- True:啟用語音輸入。
- False:關閉語音輸入。
- work_dir
- AgenticSeek 擁有能存取與交互的工作目錄。
- jarvis_personality
> 就是那個鋼鐵人的 JARVIS
- True:啟用 JARVIS 個性。
- False:關閉 JARVIS 個性。
- headless_browser
- True:前景瀏覽器。(很酷,推薦使用他 XD)
- False:背景執行瀏覽器。
- stealth_mode
- 隱私模式,但需要你自己安裝反爬蟲擴充功能。
- languages
- 支持的语言列表。用于代理路由系统。语言列表越长,下载的模型越多。
**說明**
## 框架
- is_local -> 本地運行(True)或遠程服務器(False)
下表顯示了可用的框架:
- provider_name -> 使用的 provider(如:`ollama``server``lm-studio``deepseek-api`
| 框架 | 本地? | 描述|
|-|-|-|
| ollama | 可 | 使用 ollama 框架去執行本地模型 |
| server | 可 | 本地伺服器執行模型遠端調用 |
| lm-studio | 可 | 使用 LM Studio 在本地運行 LLM(設定provider_name為lm-studio|
| openai | 不可 | 使用 ChatGPT API(無法保證隱私)|
| deepseek-api | 不可 | 使用 Deepseek API (無法保證隱私)|
| huggingface | 不可 | 使用 Hugging-Face API (無法保證隱私)|
- provider_model -> 使用的模型,如 deepseek-r1:32b
若要選擇框架,請變更 `config.ini` 文件:
- provider_server_address -> 服務器地址,如 127.0.0.1:11434(本地),API 可隨意
- agent_name -> 代理名稱,如 Friday,語音喚醒詞
- recover_last_session -> 是否恢復上次會話(True/False
- save_session -> 是否保存會話數據(True/False
- speak -> 是否啟用語音輸出(True/False
- listen -> 是否啟用語音輸入(True/False
- jarvis_personality -> 是否使用 JARVIS 風格(True/False),僅更換 prompt
- languages -> 支持語言列表,供 LLM 路由使用,建議不要太多或太相似
- headless_browser -> 是否無頭瀏覽器(True/False
- stealth_mode -> 是否降低被檢測概率,需手動安裝 anticaptcha 擴展
- languages -> 支持語言列表,代理路由系統需用,列表越長下載模型越多
## Provider 列表
下表為可用 provider
| Provider | 本地? | 說明 |
|-----------|--------|----------------------------------------------------|
| ollama | 是 | 使用 ollama 本地運行 LLM |
| server | 是 | 在其他機器託管模型,本機調用 |
| lm-studio | 是 | 使用 LM studio 本地運行 LLMprovider_name 設為 lm-studio|
| openai | 視情況 | 使用 ChatGPT API(非私有)或 openai 兼容 API |
| deepseek-api | 否 | Deepseek API(非私有) |
| huggingface| 否 | Hugging-Face API(非私有) |
| togetherAI | 否 | 使用 together AI API(非私有) |
| google | 否 | 使用 google gemini API(非私有) |
選擇 provider 時修改 config.ini
```
is_local = False
provider_name = openai
provider_model = gpt-4o
is_local = True
provider_name = ollama
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:5000
```
`is_local`: 對於任何本地運行的 LLM 都應該為 True,否則 False。
`is_local`:本地 LLM 為 True,否則 False。
`provider_name`: 透過名稱選擇要使用的框架,請參閱上面的框架清單
`provider_name`:選擇 provider 名稱,見上表
`provider_model`: 設定 AgenticSeek 使用的模型。
`provider_model`:設置代理使用的模型。
`provider_server_address`: 如果不使用雲端 API,則可以將其設定為任何內容
`provider_server_address`:如非 server provider,可隨意
# Known issues 已知問題
# 已知問題
## Chromedriver Issues
## Chromedriver 問題
**已知問題 #1:** *chromedriver mismatch*
**已知錯誤 #1** *chromedriver 不匹配*
`Exception: Failed to initialize browser: Message: session not created: This version of ChromeDriver only supports Chrome version 113
Current browser version is 134.0.6998.89 with binary path`
如果你的瀏覽器 chromedriver 版本不一樣,就會發生這種情況
出現此問題是瀏覽器 chromedriver 版本不匹配
你可以透過以下連結下載最新版本:
下載最新版本:
https://developer.chrome.com/docs/chromedriver/downloads
果您使用的是 Chrome 版本 115 或更新版本,請前往
Chrome 115 及以上,訪問
https://googlechromelabs.github.io/chrome-for-testing/
下載與你的作業系統相符的 chromedriver 版本
下載與你操作系統匹配的 chromedriver。
![alt text](./media/chromedriver_readme.png)
果有其他問題,請提供盡量詳細的敘述到 Issues 上,盡可能包含當前環境和問題是怎麼發生的
本節不全請提交 issue
## 連接適配器問題
```
Exception: Provider lm-studio failed: HTTP request failed: No connection adapters were found for '127.0.0.1:11434/v1/chat/completions'
```
請確保 provider IP 前加 `http://`
`provider_server_address = http://127.0.0.1:11434`
## SearxNG base URL 必須提供
```
raise ValueError("SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.")
ValueError: SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.
```
可能未將 `.env.example` 重命名為 `.env`?也可導出 SEARXNG_BASE_URL
`export SEARXNG_BASE_URL="http://127.0.0.1:8080"`
## FAQ
**Q: 需要什麼硬**
**Q: 需要什麼硬**
| 模型大小 | GPU | 備註 |
|-----------|--------|-----------------------------------------------------------|
| 7B | 8GB Vram | ⚠️ 不推薦。性能差,經常出現幻覺,規劃代理可能會失敗。 |
| 14B | 12 GB VRAM (例如 RTX 3060) | ✅ 適用於簡單任務。可能在網頁瀏覽和規劃任務上表現不佳。 |
| 32B | 24+ GB VRAM (例如 RTX 4090) | 🚀 大多數任務成功,但可能仍在任務規劃上有困難。 |
| 70B+ | 48+ GB Vram (例如 mac studio) | 💪 表現優異。建議用於高級使用情境。 |
| 模型規模 | GPU | 說明 |
|-----------|--------|----------------------------------------------------|
| 7B | 8GB 顯存 | ⚠️ 不推薦。性能差,幻覺,規劃代理失敗。 |
| 14B | 12GB 顯存(如 RTX 3060 | ✅ 簡單任務可用,網頁瀏覽和規劃任務可能吃力。|
| 32B | 24GB+ 顯存(如 RTX 4090 | 🚀 大多數任務成功,複雜規劃仍有難度。 |
| 70B+ | 48GB+ 顯存(如 mac studio | 💪 推薦,高級用例表現優異。 |
**Q為什麼選 Deepseek R1 而不是其他模型**
**Q: 為什麼選 Deepseek R1**
就其尺寸而言,Deepseek R1 在推理和使用方面表現出色。我們認為非常適合我們的需求,其他模型也很好用,但 Deepseek 是我們最後選定的模型
Deepseek R1 在推理和工具調用方面表現優異。我們認為非常適合本項目,其他模型也用,但 Deepseek 是首選
**Q:我在執行時 `cli.py` 時出現錯誤。我該怎麼辦?**
**Q: 運行 `cli.py` 報錯怎麼辦?**
1. 確保 Ollama 正在運行(ollama serve
2.`config.ini``provider_name` 的框架選擇正確。
3. 依賴套件已安裝
4. 如果均無效,請隨時提出 Issues,同樣盡可能包含當前環境和問題是怎麼發生的。
確保本地服務(`ollama serve`)已啟動,`config.ini` 配置正確,依賴已安裝。如仍有問題歡迎提交 issue。
**Q:它真的是 100% 本地運行嗎?**
**Q: 真能 100% 本地運行嗎?**
是的,透過 Ollama 或其他框架,所有語音轉文字、LLM 和文字轉語音模型都在本地運行
*但你能選擇非本地執行(OpenAI 或其他 API),同樣也是可以的*
是的,使用 Ollama、lm-studio 或 server provider 時,語音、LLM、語音轉文本均本地運行。非本地(OpenAI 等 API)為可選
**Q: 有 Manus 為什麼還要用 AgenticSeek**
**Q:我有 Manus 為甚麼還要用 AgenticSeek**
這是我們因為興趣做的一個小 Side-Project,他特別的點在於是一個全部本地化的模型,而且可以像鋼鐵人裡面一樣與 `Jarvis` 對話,聽起來就超級酷的吧!隨著 Manus 的進化,我們也相應的加入更多功能!
**Q:它比 Manus 好在哪裡?**
不不不,AgenticSeek 和 Manus 是不同取向的東西,我們優先考慮的是本地執行和隱私,而不是基於雲端。這是一個與 Manus 相比起來更有趣且易使用的方案!
**Q: 是否支持中文以外的语言?**
DeepSeek R1 天生會说中文
但注意:代理路由系统只懂英文,所以必须通过 config.ini 的 languages 参数(如 languages = en zh)告诉系统:
如果不設定中文?後果可能是:你讓它寫代码,结果跳出来个"醫生代理"(虽然我们根本没有这个代理... 但系统會一脸懵圈!)
实际上會下载一个小型翻译模型来协助任务分配
本項目起初只是興趣驅動的副業。特別之處在於主打本地模型,避免 API。
靈感來自 Jarvis 和 Friday(鋼鐵俠),功能上更接近 Manus,因為大家最想要的是本地 manus 替代品。
與 Manus 不同,AgenticSeek 更注重獨立性、隱私和避免 API 成本。
## 貢獻
我們正在尋找開發者來改善 AgenticSeek你可以在 Issues 查看未解決的問題或和我們討論更酷的新功能!
我們歡迎開發者改進 AgenticSeek請查看 open issues 或討論區。
[貢獻指南](./docs/CONTRIBUTING.md)
[![Star History Chart](https://api.star-history.com/svg?repos=Fosowl/agenticSeek&type=Date)](https://www.star-history.com/#Fosowl/agenticSeek&Date)
[Contribution guide](./docs/CONTRIBUTING.md)
## 維護者:
## 维护者:
> [Fosowl](https://github.com/Fosowl) | 巴黎時間
> [Fosowl](https://github.com/Fosowl) | 巴黎時間 | (有时很忙)
> [antoineVIVIES](https://github.com/antoineVIVIES) | 台北時間
> [https://github.com/antoineVIVIES](https://github.com/antoineVIVIES) | 台北時間 | (經常很忙)
> [steveh8758](https://github.com/steveh8758) | 台北時間
> [steveh8758](https://github.com/steveh8758) | 台北時間 | (總是很忙)
## 特別感謝:
> [tcsenpai](https://github.com/tcsenpai) 和 [plitc](https://github.com/plitc) 協助後端 docker 化
+325 -277
View File
@@ -1,55 +1,48 @@
# AgenticSeek : Alternative privée et locale à Manus.
<p align="center">
<img align="center" src="./media/whale_readme.jpg">
<img align="center" src="./media/agentic_seek_logo.png" width="300" height="300" alt="Agentic Seek Logo">
<p>
--------------------------------------------------------------------------------
[English](./README.md) | [繁體中文](./README_CHT.md) | [日本語](./README_JP.md) | Français
[English](./README.md) | [中文](./README_CHS.md) | [繁體中文](./README_CHT.md) | Français | [日本語](./README_JP.md) | [Português (Brasil)](./README_PTBR.md)
# AgenticSeek: Une IA comme Manus mais à base d'agents DeepSeek R1 fonctionnant en local.
*Une **alternative 100% locale à Manus AI**, cet assistant vocal autonome navigue sur le web, écrit du code et planifie des tâches tout en gardant toutes les données sur votre appareil. Conçu pour les modèles de raisonnement locaux, il fonctionne entièrement sur votre matériel, garantissant une confidentialité totale et aucune dépendance au cloud.*
Une alternative **entièrement locale** à Manus AI, un assistant IA qui code, explore votre système de fichiers, navigue sur le web et corrige ses erreurs, tout cela sans envoyer la moindre donnée dans le cloud. Cet agent autonome fonctionne entièrement sur votre hardware, garantissant la confidentialité de vos données.
[![Visiter AgenticSeek](https://img.shields.io/static/v1?label=Website&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![Licence](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=Update%20%40Fosowl)](https://x.com/Martin993886460) [![GitHub stars](https://img.shields.io/github/stars/Fosowl/agenticSeek?style=social)](https://github.com/Fosowl/agenticSeek/stargazers)
[![Visit AgenticSeek](https://img.shields.io/static/v1?label=Website&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![License](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=Update%20%40Fosowl)](https://x.com/Martin993886460)
### Pourquoi AgenticSeek ?
> 🛠️ **En cours de développement** On cherche activement des contributeurs!
* 🔒 100% Local & Privé Tout fonctionne sur votre machine : pas de cloud, pas de partage de données. Vos fichiers, conversations et recherches restent privés.
https://github.com/user-attachments/assets/4bd5faf6-459f-4f94-bd1d-238c4b331469
* 🌐 Navigation Web Intelligente AgenticSeek peut naviguer sur Internet de façon autonome : recherche, lecture, extraction dinformations, remplissage de formulaires web — tout cela sans intervention.
> *Recherche sur le web des activités à faire à Paris*
* 💻 Assistant de Codage Autonome Besoin de code ? Il peut écrire, déboguer et exécuter des programmes en Python, C, Go, Java, et plus — sans supervision.
> *Code le jeu snake en python*
* 🧠 Sélection Intelligente dAgent Vous demandez, il choisit automatiquement le meilleur agent pour la tâche. Comme une équipe dexperts à disposition.
> *J'aimerais que tu trouve une api météo et que tu me code une application qui affiche la météo à Toulouse*
* 📋 Planifie & Exécute des Tâches Complexes De la planification de voyage à la gestion de projets complexes : il divise les grandes tâches en étapes et les réalise avec plusieurs agents IA.
* 🎙️ Contrôle Vocal Voix et reconnaissance vocale rapides et futuristes, permettant de dialoguer comme avec une IA de film de science-fiction. (En développement)
### **Démo**
## Fonctionnalités:
> *Peux-tu rechercher le projet agenticSeek, découvrir les compétences requises, puis ouvrir le fichier CV_candidates.zip et me dire lesquels correspondent le mieux au projet ?*
- **100% Local**: Fonctionne en local sur votre PC. Vos données restent les vôtres.
https://github.com/user-attachments/assets/b8ca60e9-7b3b-4533-840e-08f9ac426316
- **Accès à vos Fichiers**: Utilise bash pour naviguer et manipuler vos fichiers.
Avertissement : Cette démo, y compris tous les fichiers affichés (ex : CV_candidates.zip), est entièrement fictive. Nous ne sommes pas une entreprise, nous recherchons des contributeurs open-source, pas des candidats.
- **Codage semi-autonome**: Peut écrire, déboguer et exécuter du code en Python, C, Golang et d'autres langages à venir.
> 🛠⚠️ **Travail en cours**
- **Routage d'Agent**: Sélectionne automatiquement lagent approprié pour la tâche.
> 🙏 Ce projet a commencé comme un projet annexe sans feuille de route ni financement. Il a dépassé toutes nos attentes en finissant dans GitHub Trending. Les contributions, retours et votre patience sont grandement appréciés.
- **Planification**: Pour les taches complexe utilise plusieurs agents.
## Prérequis
- **Navigation Web Autonome**: Navigation web autonome.
Assurez-vous davoir chrome driver, docker et python3.10 installés.
- **Memoire efficace**: Gestion efficace de la mémoire et des sessions.
Pour les problèmes liés à chrome driver, voir la section **Chromedriver**.
---
## **Installation**
Assurez-vous davoir installé le pilote Chrome, Docker et Python 3.10.
Nous vous conseillons fortement d'utiliser exactement Python 3.10 pour l'installation. Des erreurs de dépendances pourraient survenir autrement.
Pour les problèmes liés au pilote Chrome, consultez la section Chromedriver.
### 1️⃣ Cloner le repo et configurer
### 1. **Cloner le dépôt et configurer**
```sh
git clone https://github.com/Fosowl/agenticSeek.git
@@ -57,242 +50,261 @@ cd agenticSeek
mv .env.example .env
```
### 2 **Créer un environnement virtuel**
### 2. Modifier le contenu du fichier .env
```sh
python3 -m venv agentic_seek_env
source agentic_seek_env/bin/activate
# Sur Windows: agentic_seek_env\Scripts\activate
SEARXNG_BASE_URL="http://127.0.0.1:8080"
REDIS_BASE_URL="redis://redis:6379/0"
WORK_DIR="/Users/mlg/Documents/workspace_for_ai"
OLLAMA_PORT="11434"
LM_STUDIO_PORT="1234"
CUSTOM_ADDITIONAL_LLM_PORT="11435"
OPENAI_API_KEY='optionnel'
DEEPSEEK_API_KEY='optionnel'
OPENROUTER_API_KEY='optionnel'
TOGETHER_API_KEY='optionnel'
GOOGLE_API_KEY='optionnel'
ANTHROPIC_API_KEY='optionnel'
```
### 3️⃣ **Installation**
**Les clés API sont totalement optionnelles pour les utilisateurs qui choisissent dexécuter le LLM localement. Ce qui est le but principal du projet. Laissez vide si vous avez le matériel suffisant.**
**Automatique:**
Les variables denvironnement suivantes configurent les connexions et clés API de votre application.
Mettez à jour le fichier `.env` avec vos propres valeurs si besoin :
- **SEARXNG_BASE_URL** : Laisser inchangé
- **REDIS_BASE_URL** : Laisser inchangé
- **WORK_DIR** : Chemin vers votre dossier de travail local. AgenticSeek pourra lire et interagir avec ces fichiers.
- **OLLAMA_PORT** : Port pour le service Ollama.
- **LM_STUDIO_PORT** : Port pour le service LM Studio.
- **CUSTOM_ADDITIONAL_LLM_PORT** : Port pour tout service LLM personnalisé.
Toutes les variables denvironnement de clé API ci-dessous sont **optionnelles**. Vous navez à les fournir que si vous souhaitez utiliser des API externes au lieu dexécuter les LLM localement.
### 3. **Démarrer Docker**
Assurez-vous que Docker est installé et en cours dexécution sur votre système. Vous pouvez démarrer Docker avec les commandes suivantes :
- **Sur Linux/macOS :**
Ouvrez un terminal et lancez :
```sh
sudo systemctl start docker
```
Ou lancez Docker Desktop depuis votre menu dapplications si installé.
- **Sur Windows :**
Lancez Docker Desktop depuis le menu Démarrer.
Vous pouvez vérifier que Docker fonctionne avec :
```sh
./install.sh
docker info
```
Si vous voyez des informations sur votre installation Docker, cest que tout fonctionne.
**Manuel:**
---
**Note : Pour tous les systèmes d'exploitation, assurez-vous que le ChromeDriver que vous installez correspond à la version de Chrome installée. Exécutez `google-chrome --version`. Consultez les problèmes connus si vous avez Chrome >135**
## Configuration pour exécuter un LLM localement
- *Linux*:
**Configuration matérielle requise :**
Mettre à jour la liste des paquets : `sudo apt update`
Pour exécuter des LLM localement, il vous faut un matériel suffisant. Au minimum, un GPU capable dexécuter Qwen/Deepseek 14B est requis. Voir la FAQ pour des recommandations détaillées.
Installer les dépendances : `sudo apt install -y alsa-utils portaudio19-dev python3-pyaudio libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1`
**Démarrer votre fournisseur local**
Installer ChromeDriver correspondant à la version de votre navigateur Chrome :
`sudo apt install -y chromium-chromedriver`
Démarrez votre fournisseur local, par exemple avec ollama :
Installer les prérequis : `pip3 install -r requirements.txt`
- *macOS*:
Mettre à jour brew : `brew update`
Installer chromedriver : `brew install --cask chromedriver`
Installer portaudio : `brew install portaudio`
Mettre à jour pip : `python3 -m pip install --upgrade pip`
Mettre à jour wheel : `pip3 install --upgrade setuptools wheel`
Installer les prérequis : `pip3 install -r requirements.txt`
- *Windows*:
Installer pyreadline3 : `pip install pyreadline3`
Installer portaudio manuellement (par exemple, via vcpkg ou des binaires précompilés) puis exécutez : `pip install pyaudio`
Télécharger et installer chromedriver manuellement depuis : https://sites.google.com/chromium.org/driver/getting-started
Placez chromedriver dans un répertoire inclus dans votre PATH.
Installer les prérequis : `pip3 install -r requirements.txt`
## Faire fonctionner sur votre machine
**Nous recommandons dutiliser au minimum DeepSeek 14B, les modèles plus petits ont du mal avec lutilisation des outils et oublient rapidement le contexte.**
Lancer votre provider local, par exemple avec ollama:
```sh
ollama serve
```
**Configurer le config.ini**
Voir ci-dessous la liste des fournisseurs locaux supportés.
Modifiez le fichier config.ini pour définir provider_name sur un fournisseur supporté et provider_model sur un LLM compatible avec votre fournisseur. Nous recommandons des modèles de raisonnement comme *Qwen* ou *Deepseek*.
**Mettre à jour le config.ini**
Consultez la section **FAQ** à la fin du README pour connaître le matériel requis.
Modifiez le fichier config.ini pour définir provider_name sur un fournisseur supporté et provider_model sur un modèle LLM supporté par votre fournisseur. Nous recommandons des modèles de raisonnement comme *Qwen* ou *Deepseek*.
Voir la **FAQ** à la fin du README pour le matériel requis.
```sh
[MAIN]
is_local = True # Si vous exécutez localement ou avec un fournisseur distant.
provider_name = ollama # ou lm-studio, openai, etc..
provider_name = ollama # ou lm-studio, openai, etc.
provider_model = deepseek-r1:14b # choisissez un modèle adapté à votre matériel
provider_server_address = 127.0.0.1:11434
agent_name = Jarvis # nom de votre IA
recover_last_session = True # récupérer ou non la session précédente
save_session = True # mémoriser ou non la session actuelle
speak = True # synthèse vocale
listen = False # reconnaissance vocale, uniquement pour CLI
work_dir = /Users/mlg/Documents/workspace # L'espace de travail pour AgenticSeek.
jarvis_personality = False # Utiliser une personnalité plus "Jarvis", non recommandé avec des petits modèles
languages = en fr # Liste des langages, la synthèse vocale utilisera par défaut la première langue de la liste
recover_last_session = True # reprendre la session précédente
save_session = True # mémoriser la session actuelle
speak = False # synthèse vocale
listen = False # Reconnaissance vocale, uniquement pour CLI, expérimental
jarvis_personality = False # Personnalité "Jarvis" (expérimental)
languages = en zh # Liste des langues, la synthèse vocale prendra la première par défaut
[BROWSER]
headless_browser = True # Utiliser ou non le navigateur sans interface graphique, recommandé uniquement avec l'interface web.
stealth_mode = True # Utiliser selenium non détectable pour réduire la détection du navigateur
headless_browser = True # laisser inchangé sauf si utilisation CLI sur lhôte.
stealth_mode = True # Utilise selenium indétectable pour réduire la détection
```
Remarque : Certains fournisseurs (ex : lm-studio) nécessitent `http://` devant l'adresse IP. Par exemple `http://127.0.0.1:1234`
**Attention** :
- Le format du fichier `config.ini` ne supporte pas les commentaires.
Ne copiez/collez pas la configuration dexemple directement, car les commentaires provoqueront des erreurs. Modifiez manuellement le fichier `config.ini` avec vos paramètres, sans commentaires.
- Ne mettez *pas* provider_name à `openai` si vous utilisez LM-studio pour exécuter les LLM. Mettez-le à `lm-studio`.
**Liste des provideurs locaux**
- Certains fournisseurs (ex : lm-studio) nécessitent `http://` devant lIP. Par exemple `http://127.0.0.1:1234`
| Fournisseur | Local ? | Description |
|-------------|---------|-----------------------------------------------------------|
| ollama | Oui | Exécutez des LLM localement avec facilité en utilisant ollama comme fournisseur LLM |
| lm-studio | Oui | Exécutez un LLM localement avec LM studio (définissez `provider_name` sur `lm-studio`) |
| openai | Oui | Utilisez une API local compatible avec openai |
**Liste des fournisseurs locaux**
| Fournisseur | Local ? | Description |
|--------------|---------|----------------------------------------------------------|
| ollama | Oui | Exécutez des LLM localement facilement avec ollama |
| lm-studio | Oui | Exécutez un LLM localement avec LM studio (`lm-studio`) |
| openai | Oui | Utilise une API compatible openai (ex : serveur llama.cpp)|
### **Démarrer les services & Exécuter**
Étape suivante : [Démarrer les services et lancer AgenticSeek](#Start-services-and-Run)
*Voir la section **Problèmes connus** en cas de souci*
*Voir la section **Utiliser une API** si votre matériel ne peut pas exécuter deepseek localement*
*Voir la section **Config** pour une explication détaillée du fichier de configuration.*
---
## Configuration pour utiliser une API
**Lutilisation dune API est optionnelle, voir ci-dessus pour lexécution locale.**
Définissez le fournisseur désiré dans le `config.ini`. Voir ci-dessous la liste des fournisseurs API.
Activez votre environnement Python si nécessaire.
```sh
source agentic_seek_env/bin/activate
[MAIN]
is_local = False
provider_name = google
provider_model = gemini-2.0-flash
provider_server_address = 127.0.0.1:5000 # sans importance
```
Attention : Ne laissez pas despace à la fin de la config.
Exportez votre clé API : `export <<PROVIDER>>_API_KEY="xxx"`
Exemple : export `TOGETHER_API_KEY="xxxxx"`
**Liste des fournisseurs API**
| Fournisseur | Local ? | Description |
|--------------|---------|----------------------------------------------------------|
| openai | Selon | Utilise lAPI ChatGPT |
| deepseek | Non | API Deepseek (non privé) |
| huggingface | Non | API Hugging-Face (non privé) |
| togetherAI | Non | Utilise lAPI together AI (non privé) |
| google | Non | Utilise lAPI gemini de Google (non privé) |
Notez que le codage/bash peut échouer avec gemini, qui ignore parfois le format demandé, optimisé pour deepseek r1. Les modèles comme gpt-4o donnent aussi de moins bons résultats avec notre prompt.
Étape suivante : [Démarrer les services et lancer AgenticSeek](#Start-services-and-Run)
*Voir la section **Problèmes connus** en cas de souci*
*Voir la section **Config** pour une explication détaillée du fichier de configuration.*
---
## Démarrer les services et lancer AgenticSeek
Démarrez les services requis. Cela lancera tous les services du docker-compose.yml, dont :
- searxng
- redis (requis par searxng)
- frontend
- backend (si vous utilisez `full`)
```sh
./start_services.sh full # MacOS
start ./start_services.cmd full # Windows
```
Démarrez les services requis. Cela lancera tous les services définis dans le fichier docker-compose.yml, y compris :
- searxng
- redis (nécessaire pour searxng)
- frontend
**Attention :** Cette étape téléchargera et chargera toutes les images Docker, ce qui peut prendre jusqu’à 30 minutes. Après le démarrage, attendez que le backend soit bien lancé (vous devriez voir backend: <info> dans les logs) avant denvoyer des messages. Le backend peut mettre plus de temps à démarrer.
Allez sur `http://localhost:3000/` pour accéder à linterface web.
**Optionnel : Utiliser linterface CLI :**
Pour utiliser le mode CLI, vous devrez installer les paquets sur lhôte :
```sh
sudo ./start_services.sh # MacOS
./install.sh
./install.bat # windows
```
Démarrez les services :
```sh
./start_services.sh # MacOS
start ./start_services.cmd # Windows
```
**Option 1 :** Exécuter avec l'interface CLI.
```sh
python3 cli.py
```
**Option 2 :** Exécuter avec l'interface Web.
Démarrez le backend.
```sh
python3 api.py
```
Allez sur `http://localhost:3000/` et vous devriez voir l'interface web.
Veuillez noter que l'interface web ne diffuse pas les messages en continu pour le moment.
Voyez la section **Utilisation** si vous ne comprenez pas comment lutiliser
Voyez la section **Problèmes** connus si vous rencontrez des problèmes
Voyez la section **Exécuter avec une API** si votre matériel ne peut pas exécuter DeepSeek localement
Voyez la section **Configuration** pour une explication détaillée du fichier de configuration.
Puis lancez : `python3 cli.py`
---
## Utilisation
Assurez-vous que les services sont en cours dexécution avec ./start_services.sh et lancez AgenticSeek avec le CLI ou l'interface Web.
Assurez-vous que les services sont lancés avec `./start_services.sh full` et allez sur `localhost:3000` pour linterface web.
**CLI:**
Vous verrez un prompt : ">>> "
Cela indique quAgenticSeek attend que vous saisissiez des instructions.
Vous pouvez également utiliser la reconnaissance vocale en définissant `listen = True` dans la configuration.
Pour quitter, dites simplement `goodbye`.
Vous pouvez aussi utiliser la reconnaissance vocale en mettant `listen = True` dans la config (mode CLI uniquement).
**Interface:**
Pour quitter, dites/tapez simplement `goodbye`.
Assurez-vous d'avoir bien démarré le backend avec `python3 api.py`.
Allez sur `localhost:3000` où vous verrez une interface web.
Tapez simplement votre message et patientez.
Si vous n'avez pas d'interface sur `localhost:3000`, c'est que vous n'avez pas démarré les services avec `start_services.sh`.
Exemples dutilisation :
Voici quelques exemples dutilisation :
> *Fais un jeu du serpent en python !*
### Programmation
> *Recherche les meilleurs cafés à Rennes, France, et enregistre une liste de trois avec leurs adresses dans rennes_cafes.txt.*
> *Aide-moi avec la multiplication de matrices en Golang*
> *Écris un programme Go pour calculer la factorielle dun nombre, sauvegarde-le sous factorial.go dans ton espace de travail*
> *Initalize un nouveau project python, setup le readme, gitignore etc.. et fait un premier commit*
> *Cherche dans mon dossier summer_pictures tous les fichiers JPG, renomme-les avec la date du jour, et enregistre la liste dans photos_list.txt*
> *Fais un jeu snake en Python*
> *Recherche en ligne les films de science-fiction populaires de 2024 et choisis-en trois à regarder ce soir. Sauvegarde la liste dans movie_night.txt.*
### Recherche web
> *Recherche les derniers articles dactualité sur lIA de 2025, sélectionne-en trois, et écris un script Python pour extraire leurs titres et résumés. Sauvegarde le script sous news_scraper.py et les résumés dans ai_news.txt dans /home/projects*
> *Fais une recherche sur le web pour trouver des startups technologiques au Japon qui travaillent sur des recherches avancées en IA*
> *Vendredi, cherche une API gratuite de prix dactions, inscris-toi avec supersuper7434567@gmail.com puis écris un script Python pour récupérer les prix quotidiens de Tesla, et sauvegarde les résultats dans stock_prices.csv*
> *Peux-tu trouver sur internet qui a créé agenticSeek ?*
*Note : le remplissage de formulaires est encore expérimental et peut échouer.*
> *Peux-tu trouver sur quel site je peux acheter une RTX 4090 à bas prix ?*
Après avoir saisi votre requête, AgenticSeek choisira le meilleur agent pour la tâche.
### Fichier
Comme il sagit dun prototype, le système de routage dagent peut ne pas toujours choisir le bon agent selon votre requête.
> *Hé, peux-tu trouver où est contrat.pdf ? Je lai perdu*
Soyez donc explicite sur ce que vous voulez et comment lIA doit procéder. Par exemple, pour une recherche web, ne dites pas :
> *Montre-moi combien despace il me reste sur mon disque*
> *Trouve et lis le fichier README.md et suis les instructions dinstallation*
### Conversation
> *Parle-moi de la France*
> *Quel est le sens de la vie ?*
> *Donne moi une recette simple pour ce midi j'ai pas d'inspi*
Après avoir saisi votre requête, AgenticSeek attribuera le meilleur agent pour la tâche.
Le système de routage des agents peut parfois ne pas toujours attribuer le bon agent en fonction de votre requête.
Par conséquent, vous devez être assez explicite sur ce que vous voulez et sur la manière dont lIA doit procéder. Par exemple, si vous voulez quelle effectue une recherche sur le web, ne dites pas :
Connait-tu de bons pays pour voyager seul ?
`Connais-tu de bons pays pour voyager en solo ?`
Dites plutôt :
Fait une recherche sur le web, quels sont les meilleurs pays pour voyager seul?
`Fais une recherche web et trouve les meilleurs pays pour voyager en solo`
---
## **Exécuter le LLM sur votre propre serveur**
Si vous disposez dun ordinateur puissant ou dun serveur que vous voulez utiliser, mais que vous souhaitez y accéder depuis votre ordinateur portable, vous avez la possibilité dexécuter le LLM sur un serveur distant.
Si vous avez un ordinateur ou un serveur puissant, mais souhaitez lutiliser depuis votre laptop, vous pouvez exécuter le LLM sur un serveur distant via notre serveur LLM personnalisé.
### 1️⃣ **Configurer et démarrer les scripts du serveur**
Sur votre "serveur" qui exécutera le modèle IA, obtenez ladresse IP
Sur votre "serveur" qui exécutera le modèle IA, récupérez ladresse IP :
```sh
ip a | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1
ip a | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1 # ip locale
curl https://ipinfo.io/ip # ip publique
```
Remarque : Pour Windows ou macOS, utilisez respectivement ipconfig ou ifconfig pour trouver ladresse IP.
Clonez le dépôt et entrez dans le dossier server/.
Note : Sous Windows ou macOS, utilisez ipconfig ou ifconfig pour trouver ladresse IP.
Clonez le dépôt et entrez dans le dossier `server/` :
```sh
git clone --depth 1 https://github.com/Fosowl/agenticSeek.git
cd agenticSeek/server/
cd agenticSeek/llm_server/
```
Installez les dépendances spécifiques au serveur :
@@ -301,198 +313,234 @@ Installez les dépendances spécifiques au serveur :
pip3 install -r requirements.txt
```
Exécutez le script du serveur.
Lancez le script serveur :
```sh
python3 app.py --provider ollama --port 3333
```
Vous avez le choix entre utiliser ollama et llamacpp comme service LLM.
Vous pouvez choisir entre `ollama` et `llamacpp` comme service LLM.
### 2️⃣ **Lancer**
Sur votre ordinateur personnel :
Maintenant, sur votre ordinateur personnel :
Modifiez le fichier config.ini pour définir provider_name sur server et provider_model sur deepseek-r1:14b.
Définissez provider_server_address sur ladresse IP de la machine qui exécutera le modèle.
Modifiez le fichier `config.ini` pour mettre `provider_name` à `server` et `provider_model` à `deepseek-r1:xxb`.
Mettez `provider_server_address` à ladresse IP de la machine qui exécute le modèle.
```sh
[MAIN]
is_local = False
provider_name = server
provider_model = deepseek-r1:14b
provider_model = deepseek-r1:70b
provider_server_address = x.x.x.x:3333
```
Ensuite, exécutez avec le CLI ou l'interface graphique comme expliqué dans la section pour les fournisseurs locaux.
Étape suivante : [Démarrer les services et lancer AgenticSeek](#Start-services-and-Run)
## **Exécuter avec une API externe**
---
AVERTISSEMENT : Assurez-vous quil ny a pas despace en fin de ligne dans la configuration.
## Reconnaissance Vocale
```sh
[MAIN]
is_local = False
provider_name = openai
provider_model = gpt-4o
provider_server_address = 127.0.0.1:5000 # n'importe pas
Attention : la reconnaissance vocale ne fonctionne quen mode CLI pour linstant.
Notez quactuellement la reconnaissance vocale ne fonctionne quen anglais.
La fonctionnalité de reconnaissance vocale est désactivée par défaut. Pour lactiver, mettez listen à True dans le fichier config.ini :
```
listen = True
```
**Liste de provideurs API**
| Fournisseur | Local ? | Description |
|--------------|---------|-----------------------------------------------------------|
| openai | Non | Utilise l'API ChatGPT |
| deepseek-api | Non | API Deepseek (non privé) |
| huggingface | Non | API Hugging-Face (non privé) |
| togetherAI | Non | Utilise l'API Together AI (non privé) |
| google | Non | Utilise l'API Google Gemini (non privé) |
Quand activée, la reconnaissance vocale attend un mot-clé déclencheur, qui est le nom de lagent, avant de commencer à traiter votre entrée. Vous pouvez personnaliser le nom de lagent via `agent_name` dans *config.ini* :
Ensuite, exécutez avec le CLI ou l'interface graphique comme expliqué dans la section pour les fournisseurs locaux.
```
agent_name = Friday
```
Pour une reconnaissance optimale, nous recommandons dutiliser un prénom anglais courant comme "John" ou "Emma" comme nom dagent.
Une fois la transcription affichée, dites le nom de lagent à voix haute pour le réveiller (ex : "Friday").
Énoncez clairement votre requête.
Terminez votre demande par une phrase de confirmation pour signaler au système de procéder. Exemples :
```
"do it", "go ahead", "execute", "run", "start", "thanks", "would ya", "please", "okay?", "proceed", "continue", "go on", "do that", "go it", "do you understand?"
```
## Config
Exemple de configuration :
Exemple de config :
```
[MAIN]
is_local = True
provider_name = ollama
provider_model = deepseek-r1:1.5b
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:11434
agent_name = Friday
recover_last_session = False
save_session = False
speak = False
listen = False
work_dir = /Users/mlg/Documents/ai_folder
jarvis_personality = False
languages = en fr
languages = en zh
[BROWSER]
headless_browser = False
stealth_mode = False
```
**Explication du fichier config.ini**:
**Explications** :
`is_local` -> Exécute lagent localement (True) ou sur un serveur distant (False).
- is_local -> Exécute lagent localement (True) ou sur un serveur distant (False).
`provider_name` -> Le fournisseur à utiliser (parmi : ollama, server, lm-studio, deepseek-api).
- provider_name -> Fournisseur à utiliser (parmi : `ollama`, `server`, `lm-studio`, `deepseek-api`)
`provider_model` -> Le modèle utilisé, par exemple, deepseek-r1:1.5b.
- provider_model -> Modèle utilisé, ex : deepseek-r1:32b.
`provider_server_address` -> Adresse du serveur, par exemple, 127.0.0.1:11434 pour local. Définissez nimporte quoi pour une API non locale.
- provider_server_address -> Adresse du serveur, ex : 127.0.0.1:11434 pour local. Mettre nimporte quoi pour une API non locale.
`agent_name` -> Nom de lagent, par exemple, Friday. Utilisé comme mot déclencheur pour la reconnaissance vocale.
- agent_name -> Nom de lagent, ex : Friday. Utilisé comme mot-clé pour la reconnaissance vocale.
`recover_last_session` -> Reprend la dernière session (True) ou non (False).
- recover_last_session -> Reprend la dernière session (True) ou non (False).
`save_session` -> Sauvegarde les données de la session (True) ou non (False).
- save_session -> Sauvegarde la session (True) ou non (False).
`speak` -> Active la sortie vocale (True) ou non (False).
- speak -> Active la synthèse vocale (True) ou non (False).
`listen` -> Écoute les entrées vocales (True) ou non (False).
- listen -> Active la reconnaissance vocale (True) ou non (False).
`work_dir` -> Dossier auquel lIA aura accès, par exemple : /Users/user/Documents/.
- jarvis_personality -> Utilise une personnalité type JARVIS (True) ou non (False). Change simplement le prompt.
`jarvis_personality` -> Utilise une personnalité inspiré de Jarvis (True) ou non (False). Cela utilise simplement une prompt alternative. Marche moins bien en français.
- languages -> Liste des langues supportées, nécessaire pour le routage des agents. Évitez den mettre trop ou des langues trop similaires.
`headless_browser` -> Exécute le navigateur sans fenêtre visible (True) ou non (False).
- headless_browser -> Lance le navigateur sans fenêtre visible (True) ou non (False).
`stealth_mode` -> Rend la détection des bots plus difficile. Le seul inconvénient est que vous devez installer manuellement lextension anticaptcha.
- stealth_mode -> Rend la détection par les bots plus difficile. Nécessite dinstaller lextension anticaptcha manuellement.
`languages` -> La liste de languages supportés (nécessaire pour le routage d'agents). Plus la liste est longue. Plus un nombre important de modèles sera téléchargés.
- languages -> Liste des langues supportées. Requis pour le système de routage. Plus la liste est longue, plus de modèles seront téléchargés.
## Providers
## Fournisseurs
Le tableau ci-dessous montre les LLM providers disponibles :
Tableau des fournisseurs disponibles :
| Provider | Local? | Description |
|-----------|--------|-----------------------------------------------------------|
| ollama | Yes | Exécutez des LLM localement avec facilité en utilisant Ollama comme fournisseur LLM
| server | Yes | Hébergez le modèle sur une autre machine, exécutez sur votre machine locale
| lm-studio | Yes | Exécutez un LLM localement avec LM Studio (définissez provider_name sur lm-studio)
| openai | No | Utilise l'API ChatGPT (pas privé) |
| deepseek-api | No | Utilise l'API Deepseek (pas privé) |
| huggingface| No | Utilise Hugging-Face (pas privé) |
| together| No | Utilise l'api Together AI |
| Fournisseur | Local ? | Description |
|--------------|---------|----------------------------------------------------------|
| ollama | Oui | Exécutez des LLM localement avec ollama |
| server | Oui | Hébergez le modèle sur une autre machine |
| lm-studio | Oui | Exécutez un LLM localement avec LM studio (`lm-studio`) |
| openai | Selon | Utilise lAPI ChatGPT (non privé) ou API compatible openai|
| deepseek-api | Non | API Deepseek (non privé) |
| huggingface | Non | API Hugging-Face (non privé) |
| togetherAI | Non | Utilise lAPI together AI (non privé) |
| google | Non | Utilise lAPI gemini de Google (non privé) |
Pour sélectionner un provider LLM, modifiez le config.ini :
Pour sélectionner un fournisseur, modifiez le config.ini :
```
is_local = False
provider_name = openai
provider_model = gpt-4o
is_local = True
provider_name = ollama
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:5000
```
`is_local` : doit être True pour tout LLM local, sinon False.
`is_local` : doit être True pour tout LLM exécuté localement, sinon False.
`provider_name` : Sélectionnez le fournisseur par son nom, voir la liste ci-dessus.
`provider_name` : Sélectionnez le fournisseur à utiliser par son nom, voir la liste des fournisseurs ci-dessus.
`provider_model` : Modèle à utiliser par lagent.
`provider_model` : Définissez le modèle à utiliser par lagent.
`provider_server_address` : peut être défini sur nimporte quoi si vous nutilisez pas le fournisseur server.
`provider_server_address` : Peut être nimporte quoi si vous nutilisez pas le fournisseur server.
# Problèmes connus
## Problèmes avec Chromedriver
Erreur #1:**incompatibilité**
**Erreur connue #1 :** *chromedriver mismatch*
`Exception: Failed to initialize browser: Message: session not created: This version of ChromeDriver only supports Chrome version 113
Current browser version is 134.0.6998.89 with binary path`
Cela se produit sil y a une incompatibilité entre votre navigateur et la version de chromedriver.
Cela arrive sil y a un décalage entre la version de votre navigateur et celle de chromedriver.
Vous devez naviguer pour télécharger la dernière version :
Téléchargez la dernière version ici :
https://developer.chrome.com/docs/chromedriver/downloads
Si vous utilisez Chrome version 115 ou plus récent, allez sur :
Si vous utilisez Chrome version 115 ou plus, allez sur :
https://googlechromelabs.github.io/chrome-for-testing/
Et téléchargez la version de chromedriver correspondant à votre système dexploitation.
Et téléchargez la version de chromedriver correspondant à votre OS.
![alt text](./media/chromedriver_readme.png)
Si cette section est incomplète, merci de faire une nouvelle issue sur github.
Si cette section est incomplète, ouvrez une issue.
## Problèmes dadaptateurs de connexion
```
Exception: Provider lm-studio failed: HTTP request failed: No connection adapters were found for '127.0.0.1:11434/v1/chat/completions'
```
Assurez-vous davoir `http://` devant ladresse IP du fournisseur :
`provider_server_address = http://127.0.0.1:11434`
## SearxNG base URL doit être fourni
```
raise ValueError("SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.")
ValueError: SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.
```
Peut-être navez-vous pas renommé `.env.example` en `.env` ? Vous pouvez aussi exporter SEARXNG_BASE_URL :
`export SEARXNG_BASE_URL="http://127.0.0.1:8080"`
## FAQ
**Q: Quel matériel est nécessaire ?**
| Taille du Modèle | GPU | Commentaire |
|--------------------|------|----------------------------------------------------------|
| 7B | 8 Go VRAM | ⚠️ Non recommandé. Performances médiocres, hallucinations fréquentes, et l'agent planificateur échouera probablement. |
| 14B | 12 Go VRAM (par ex. RTX 3060) | ✅ Utilisable pour des tâches simples. Peut rencontrer des difficultés avec la navigation web et les tâches de planification. |
| 32B | 24+ Go VRAM (par ex. RTX 4090) | 🚀 Réussite avec la plupart des tâches, peut encore avoir des difficultés avec la planification des tâches. |
| 70B+ | 48+ Go VRAM (par ex. Mac Studio) | 💪 Excellent. Recommandé pour des cas d'utilisation avancés. |
**Q : Quel matériel est nécessaire ?**
**Q: Pourquoi deepseek et pas un autre modèle**
| Taille du modèle | GPU | Commentaire |
|------------------|---------------|-----------------------------------------------------------------------------|
| 7B | 8 Go Vram | ⚠️ Non recommandé. Performances faibles, hallucinations fréquentes, échec probable des agents planificateurs. |
| 14B | 12 Go VRAM | ✅ Utilisable pour des tâches simples. Peut avoir du mal avec la navigation web et la planification. |
| 32B | 24+ Go VRAM | 🚀 Réussite sur la plupart des tâches, peut encore avoir du mal avec la planification |
| 70B+ | 48+ Go Vram | 💪 Excellent. Recommandé pour les cas avancés. |
DeepSeek R1 excelle dans le raisonnement et lutilisation doutils pour sa taille. Nous pensons que cest un choix solide pour nos besoins, bien que dautres modèles fonctionnent également (bien que moins bien pour un nombre équivalent de paramètres).
**Q : Pourquoi Deepseek R1 plutôt quun autre modèle ?**
**Q: J'ai une erreur quand je lance le programme, je fait quoi?**
Deepseek R1 excelle en raisonnement et utilisation doutils pour sa taille. Nous pensons que cest un bon choix, dautres modèles fonctionnent aussi, mais Deepseek est notre favori.
Assurez-vous quOllama est en cours dexécution (ollama serve), que votre config.ini correspond à votre fournisseur, et que les dépendances sont installées. Si cela ne fonctionne pas, nhésitez pas à signaler un problème.
**Q : Jai une erreur en lançant `cli.py`. Que faire ?**
**Q: C'est vraiment 100% local?**
Assurez-vous que le local est lancé (`ollama serve`), que votre `config.ini` correspond à votre fournisseur, et que les dépendances sont installées. Si rien ne marche, ouvrez une issue.
Oui, avec les fournisseurs Ollama, lm-studio ou Server, toute la reconnaissance vocale, le LLM et la synthèse vocale fonctionnent localement. Les options non locales (OpenAI ou autres API) sont facultatives.
**Q : Peut-on vraiment tout faire tourner en local ?**
**Q: En quoi c'est supérieur à Manus**
Oui, avec Ollama, lm-studio ou server, tout (reconnaissance vocale, LLM, synthèse vocale) fonctionne localement. Les options non-locales (OpenAI ou autres API) sont optionnelles.
Il ne l'est certainement pas, mais nous privilégions lexécution locale et la confidentialité par rapport à une approche basée sur le cloud. Cest une alternative plus accessible et surtout moins cher !
**Q : Pourquoi utiliser AgenticSeek alors que jai Manus ?**
## Contribution
Ce projet est né dun intérêt pour les agents IA. Ce qui le rend spécial, cest la volonté dutiliser des modèles locaux et d’éviter les API.
Nous nous inspirons de Jarvis et Friday (Iron Man) pour le côté "cool", mais pour la fonctionnalité, cest Manus qui nous inspire, car cest ce que les gens recherchent : une alternative locale à Manus.
Contrairement à Manus, AgenticSeek privilégie lindépendance vis-à-vis des systèmes externes, vous donnant plus de contrôle, de confidentialité et évitant les coûts dAPI.
Nous recherchons des développeurs pour améliorer AgenticSeek ! Consultez la section "issues" github ou les discussions.
## Contribuer
Nous recherchons des développeurs pour améliorer AgenticSeek ! Consultez les issues ou discussions ouvertes.
[Guide de contribution](./docs/CONTRIBUTING.md)
[![Star History Chart](https://api.star-history.com/svg?repos=Fosowl/agenticSeek&type=Date)](https://www.star-history.com/#Fosowl/agenticSeek&Date)
[Guide du contributeur](./docs/CONTRIBUTING.md)
## Mainteneurs :
> [Fosowl](https://github.com/Fosowl) | Heure de Paris
> [antoineVIVIES](https://github.com/antoineVIVIES) | Heure de Taipei
> [steveh8758](https://github.com/steveh8758) | Heure de Taipei
## Remerciements :
> [tcsenpai](https://github.com/tcsenpai) et [plitc](https://github.com/plitc) pour laide à la dockerisation du backend
## Mainteneurs:
> [Fosowl](https://github.com/Fosowl)
> [steveh8758](https://github.com/steveh8758)
> [https://github.com/antoineVIVIES](https://github.com/antoineVIVIES)
+240 -270
View File
@@ -1,48 +1,48 @@
# AgenticSeek: プライベートローカルManus代替
# AgenticSeek: プライベートローカルManus代替
<p align="center">
<img align="center" src="./media/agentic_seek_logo.png" width="300" height="300" alt="Agentic Seek ロゴ">
<img align="center" src="./media/agentic_seek_logo.png" width="300" height="300" alt="Agentic Seek Logo">
<p>
[English](./README.md) | [中文](./README_CHS.md) | [繁體中文](./README_CHT.md) | [Français](./README_FR.md) | 日本語
English | [中文](./README_CHS.md) | [繁體中文](./README_CHT.md) | [Français](./README_FR.md) | [日本語](./README_JP.md) | [Português (Brasil)](./README_PTBR.md)
*Manus AIの**100%ローカルな代替**となるこの音声対応AIアシスタントは、自律的にウェブを閲覧、コードを書き、タスク計画しながら、すべてのデータをあなたのデバイスに保持します。ローカル推論モデルに合わせて調整されており、完全にあなたのハードウェア上で動作するため、完全なプライバシーとクラウドへの依存ゼロを保証します。*
**100%ローカルで動作するManus AIの代替**となる音声対応AIアシスタントです。ウェブの自律的な閲覧、コードの作成、タスク計画を行い、すべてのデータをあなたのデバイスに保持します。ローカル推論モデル向けに最適化されており、完全なプライバシーとクラウド依存ゼロを実現します。
[![AgenticSeekを訪問](https://img.shields.io/static/v1?label=ウェブサイト&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![ライセンス](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-参加する-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=更新%20%40Fosowl)](https://x.com/Martin993886460) [![GitHubスター](https://img.shields.io/github/stars/Fosowl/agenticSeek?style=social)](https://github.com/Fosowl/agenticSeek/stargazers)
[![Visit AgenticSeek](https://img.shields.io/static/v1?label=Website&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![License](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=Update%20%40Fosowl)](https://x.com/Martin993886460) [![GitHub stars](https://img.shields.io/github/stars/Fosowl/agenticSeek?style=social)](https://github.com/Fosowl/agenticSeek/stargazers)
### なぜAgenticSeekなのか?
* 🔒 完全ローカル&プライベート - すべてがあなたのマシン上で実行されます — クラウドなし、データ共有なし。あなたのファイル、会話、検索はプライベートに保たれます。
* 🔒 完全ローカル&プライベート - すべてがあなたのマシン上で動作。クラウドデータ共有は一切なし。ファイル、会話、検索はすべてプライベートに保たれます。
* 🌐 スマートなウェブブラウジング - AgenticSeekは自でインターネットを閲覧できます — 検索、読み取り、情報抽出、ウェブフォーム入力 — すべてハンズフリーで。
* 🌐 スマートなウェブブラウジング - AgenticSeekは自でインターネットを検索・閲覧・情報抽出・フォーム入力までハンズフリーで実行します
* 💻 自律型コーディングアシスタント - コードが必要ですか?Python、C、Go、Javaなどプログラムを書き、デバッグし、実行できます — すべて監視なしで
* 💻 自律型コーディングアシスタント - コードが必要ですか?Python、C、Go、Javaなどプログラムを自動で作成・デバッグ・実行します
* 🧠 スマートエージェント選択 - あなたが尋ねると、タスクに最適なエージェントを自動的に見つけ出します。まるで専門家チームが助けてくれるようです。
* 🧠 スマートエージェント選択 - あなたの要望に応じて最適なエージェントを自動で選択。まるで専門家チームが常にサポートしてくれるようです。
* 📋 複雑なタスクの計画と実行 - 旅行計画から複雑なプロジェクトまで — 大きなタスクをステップに分割し、複数のAIエージェントを使って物事を成し遂げることができます。
* 📋 複雑なタスクの計画と実行 - 旅行計画からプロジェクト管理まで、大きなタスクを分割し、複数のAIエージェントで実行します。
* 🎙️ 音声対応 - クリーンで高速、未来的な音声と音声認識により、まるでSF映画のパーソナルAIのように話しかけることができます
* 🎙️ 音声対応 - 未来的で高速な音声認識&音声合成。まるでSF映画のパーソナルAIのように会話できます(開発中)
### **デモ**
> *agenticSeekプロジェクトを検索し、必要なスキルを学び、その後CV_candidates.zipを開いて、プロジェクトに最も適した候補者を教えてください。*
> *agenticSeekプロジェクトを検索し、必要なスキルを調べてからCV_candidates.zipを開、プロジェクトに最も合う候補者を教えて*
https://github.com/user-attachments/assets/b8ca60e9-7b3b-4533-840e-08f9ac426316
免責事項:このデモは、表示されるすべてのファイル(例CV_candidates.zipを含め、完全に架空のものです。私たちは企業ではなく、候補者ではなくオープンソースの貢献者を求めています。
注意: このデモや登場するファイル(例: CV_candidates.zipはすべて架空のものです。私たちは企業ではなく、オープンソースの貢献者を募集しています。
> 🛠️ **作業中** 貢献者を募集中です!
> 🛠⚠️ **開発中のプロジェクトです**
## インストール
> 🙏 このプロジェクトはサイドプロジェクトとして始まり、ロードマップや資金はありません。GitHub Trending入りするほど成長しました。貢献・フィードバック・ご理解に感謝します。
Chrome Driver、Docker、Python 3.10がインストールされていることを確認してください。
## 前提条件
セットアップにはPython 3.10を正確に使用することを強くお勧めします。そうでない場合、依存関係のエラーが発生する可能性があります
chrome driver、docker、python3.10がインストールされていることを確認してください
Chromeドライバーに関する問題については、**Chromedriver**セクションを参照してください。
chrome driver関連の問題は**Chromedriver**セクションを参照してください。
### 1️⃣ **リポジトリのクローンとセットアップ**
### 1. **リポジトリのクローンとセットアップ**
```sh
git clone https://github.com/Fosowl/agenticSeek.git
@@ -50,308 +50,279 @@ cd agenticSeek
mv .env.example .env
```
### 2 **仮想環境の作成**
### 2. .envファイルの内容を変更
```sh
python3 -m venv agentic_seek_env
source agentic_seek_env/bin/activate
# Windowsの場合: agentic_seek_env\Scripts\activate
SEARXNG_BASE_URL="http://127.0.0.1:8080"
REDIS_BASE_URL="redis://redis:6379/0"
WORK_DIR="/Users/mlg/Documents/workspace_for_ai"
OLLAMA_PORT="11434"
LM_STUDIO_PORT="1234"
CUSTOM_ADDITIONAL_LLM_PORT="11435"
OPENAI_API_KEY='optional'
DEEPSEEK_API_KEY='optional'
OPENROUTER_API_KEY='optional'
TOGETHER_API_KEY='optional'
GOOGLE_API_KEY='optional'
ANTHROPIC_API_KEY='optional'
```
### 3️⃣ **パッケージのインストール**
**APIキーはローカルでLLMを実行する場合は完全にオプションです。十分なハードウェアがある場合は空欄で構いません。**
Python、Dockerとdocker compose、Google Chromeがインストールされていることを確認してください。
以下の環境変数はアプリケーションの接続やAPIキーを設定します。必要に応じて`.env`ファイルを編集してください。
Python 3.10.0を推奨します。
- **SEARXNG_BASE_URL**: 変更不要
- **REDIS_BASE_URL**: 変更不要
- **WORK_DIR**: ローカル作業ディレクトリのパス。AgenticSeekがこのディレクトリのファイルを読み書きします。
- **OLLAMA_PORT**: Ollamaサービスのポート番号
- **LM_STUDIO_PORT**: LM Studioサービスのポート番号
- **CUSTOM_ADDITIONAL_LLM_PORT**: カスタムLLMサービスのポート番号
**自動インストール(推奨):**
APIキーは**すべてオプション**です。外部APIを使う場合のみ設定してください。
Linux/Macosの場合:
### 3. **Dockerの起動**
Dockerがインストールされ、起動していることを確認してください。以下のコマンドで起動できます。
- **Linux/macOSの場合:**
ターミナルで
```sh
sudo systemctl start docker
```
またはアプリケーションメニューからDocker Desktopを起動
- **Windowsの場合:**
スタートメニューからDocker Desktopを起動
Dockerが動作しているか確認するには
```sh
./install.sh
docker info
```
** テキスト読み上げ(TTS)機能で日本語をサポートするには、fugashi(日本語分かち書きライブラリ)をインストールする必要があります:**
** 注意: 日本語のテキスト読み上げ(TTS)機能には多くの依存関係が必要で、問題が発生する可能性があります。mecabrcに関する問題が発生することがあります。現在のところ、この問題を修正する方法が見つかっていません。当面は日本語でのテキスト読み上げ機能を無効にすることをお勧めします。**
必要なライブラリをインストールする場合は以下のコマンドを実行してください:
```
pip3 install --upgrade pyopenjtalk jaconv mojimoji unidic fugashi
pip install unidic-lite
python -m unidic download
```
Windowsの場合:
```sh
./install.bat
```
**手動:**
**注意:どのOSでも、インストールするChromeDriverがインストール済みのChromeバージョンと一致していることを確認してください。`google-chrome --version`を実行してください。Chrome >135の場合の既知の問題を参照してください。**
- *Linux*:
パッケージリストの更新:`sudo apt update`
依存関係のインストール:`sudo apt install -y alsa-utils portaudio19-dev python3-pyaudio libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1`
Chromeブラウザのバージョンに一致するChromeDriverのインストール:
`sudo apt install -y chromium-chromedriver`
要件のインストール:`pip3 install -r requirements.txt`
- *Macos*:
brewの更新:`brew update`
chromedriverのインストール:`brew install --cask chromedriver`
portaudioのインストール:`brew install portaudio`
pipのアップグレード:`python3 -m pip install --upgrade pip`
wheelのアップグレード:`pip3 install --upgrade setuptools wheel`
要件のインストール:`pip3 install -r requirements.txt`
- *Windows*:
pyreadline3のインストール:`pip install pyreadline3`
portaudioの手動インストール(例:vcpkgまたはビルド済みバイナリ経由)後、実行:`pip install pyaudio`
chromedriverの手動ダウンロードとインストール:https://sites.google.com/chromium.org/driver/getting-started
PATHに含まれるディレクトリにchromedriverを配置します。
要件のインストール:`pip3 install -r requirements.txt`
と入力し、情報が表示されればOKです。
---
## マシン上でローカルLLMを実行するためのセットアップ
## ローカルLLMを実行する場合のセットアップ
**少なくともDeepseek 14Bの使用を推奨します。より小さなモデルは、特にウェブブラウジングのタスクで苦労します。**
**ハードウェア要件:**
ローカルでLLMを動かすには十分なハードウェアが必要です。最低でもQwen/Deepseek 14Bが動作するGPUが必要です。詳細はFAQを参照してください。
**ローカルプロバイダーのセットアップ**
**ローカルプロバイダーの起動例**
ローカルプロバイダーを開始します。例えばollamaの場合:
例: ollamaを使う場合
```sh
ollama serve
```
サポートされているローカルプロバイダーのリストについては、以下を参照してください
対応プロバイダーは下記参照
**config.iniの更新**
config.iniファイルを変更して、provider_nameをサポートされているプロバイダー、provider_modelをプロバイダーがサポートするLLMに設定します。*Qwen*や*Deepseek*などの推論モデルを推奨します。
config.iniファイルprovider_nameをサポートされているプロバイダー、provider_modelを対応モデルに設定してください。推論モデルは*Qwen*や*Deepseek*を推奨します。
必要なハードウェアについては、READMEの最後にある**FAQ**を参照してください。
FAQで必要なハードウェアを確認してください。
```sh
[MAIN]
is_local = True # ローカルで実行するか、リモートプロバイダーで実行するか。
provider_name = ollama # またはlm-studio、openaiなど。
provider_model = deepseek-r1:14b # ハードウェアに合ったモデルを選択してください
is_local = True
provider_name = ollama
provider_model = deepseek-r1:14b
provider_server_address = 127.0.0.1:11434
agent_name = Jarvis # AIの名前
recover_last_session = True # 前のセッションを復元するかどうか
save_session = True # 現在のセッションを記憶するかどうか
speak = True # テキスト読み上げ
listen = False # 音声認識、CLIのみ
work_dir = /Users/mlg/Documents/workspace # AgenticSeekのワークスペース。
jarvis_personality = False # より「Jarvis」らしい性格を使用するかどうか(実験的)
languages = en zh # 言語のリスト、テキスト読み上げはリストの最初の言語にデフォルト設定されます
agent_name = Jarvis
recover_last_session = True
save_session = True
speak = False
listen = False
jarvis_personality = False
languages = en zh
[BROWSER]
headless_browser = True # ヘッドレスブラウザを使用するかどうか、ウェブインターフェースを使用する場合のみ推奨。
stealth_mode = True # undetected seleniumを使用してブラウザ検出を減らす
headless_browser = True
stealth_mode = True
```
警告:LM-studioを使用してLLMを実行する場合、provider_nameを`openai`に設定しないでください。`lm-studio`に設定してください。
**注意:**
注意:一部のプロバイダー(例:lm-studio)では、IPの前に`http://`が必要です。例:`http://127.0.0.1:1234`
- `config.ini`はコメントをサポートしません。例の設定をそのままコピペせず、コメントを除いて手動で編集してください。
- LM-studioを使う場合、provider_nameは`lm-studio`にしてください(`openai`ではありません)。
- 一部プロバイダー(例: lm-studio)はIPアドレスの前に`http://`が必要です(例: `http://127.0.0.1:1234`)。
**ローカルプロバイダーのリスト**
**ローカルプロバイダー一覧**
| プロバイダー | ローカル | 説明 |
| プロバイダー | ローカル? | 説明 |
|-----------|--------|-----------------------------------------------------------|
| ollama | はい | ollamaをLLMプロバイダーとして使用して、LLMをローカルで簡単に実行します |
| lm-studio | はい | LM studioでLLMをローカル実行します(`provider_name``lm-studio`に設定|
| openai | はい | openai互換API(例llama.cppサーバー)を使用します |
| ollama | はい | ollamaでローカルLLMを簡単に実行 |
| lm-studio | はい | LM studioでローカルLLMを実行(`provider_name`は`lm-studio`|
| openai | はい/いいえ | openai互換API(例: llama.cppサーバー) |
次のステップ[サービスの開始とAgenticSeekの実行](#サービスの開始と実行)
次のステップ: [サービスの起動とAgenticSeekの実行](#Start-services-and-Run)
*問題が発生した場合は、**既知の問題**セクション参照してください*
*問題がある場合は**Known issues**セクション参照*
*ハードウェアがローカルでdeepseekを実行できない場合は、**APIで実行**セクション参照してください*
*ローカルでdeepseekが動かない場合は**Run with an API**セクション参照*
*詳細な設定ファイルの説明については、**設定**セクション参照してください。*
*詳細な設定は**Config**セクション参照*
---
## APIで実行するためのセットアップ
## APIで実行する場合のセットアップ
`config.ini`で目的のプロバイダーを設定します。APIプロバイダーのリストについては、以下を参照してください。
**API利用はオプションです。ローカル実行は上記参照。**
`config.ini`で希望のプロバイダーを設定してください。APIプロバイダー一覧は下記参照。
```sh
[MAIN]
is_local = False
provider_name = google
provider_model = gemini-2.0-flash
provider_server_address = 127.0.0.1:5000 # 関係ありません
provider_server_address = 127.0.0.1:5000 # 任意
```
警告:設定に末尾のスペースがないことを確認してください。
注意: configに余計なスペースがないようにしてください。
APIキーをエクスポートします:`export <<PROVIDER>>_API_KEY="xxx"`
APIキーをエクスポート: `export <<PROVIDER>>_API_KEY="xxx"`
例:`export TOGETHER_API_KEY="xxxxx"`
例: `export TOGETHER_API_KEY="xxxxx"`
**APIプロバイダーのリスト**
**APIプロバイダー一覧**
| プロバイダー | ローカル | 説明 |
| プロバイダー | ローカル? | 説明 |
|-----------|--------|-----------------------------------------------------------|
| openai | 場合による | ChatGPT APIを使用 |
| deepseek-api | いいえ | Deepseek API(非プライベート) |
| openai | 場合による | ChatGPT API |
| deepseek | いいえ | Deepseek API(非プライベート) |
| huggingface| いいえ | Hugging-Face API(非プライベート) |
| togetherAI | いいえ | together AI APIを使用(非プライベート) |
| google | いいえ | google gemini APIを使用(非プライベート) |
| togetherAI | いいえ | together AI API(非プライベート) |
| google | いいえ | google gemini API(非プライベート) |
*gpt-4oや他のclosedAIモデルの使用は推奨しません*。ウェブブラウジングやタスク計画のパフォーマンスが悪いです。
geminiではコーディングやbashが失敗する場合があります。deepseek r1向けに最適化されたプロンプトを無視する傾向があります。gpt-4oも同様にプロンプトとの相性が悪い場合があります。
また、geminiではコーディング/bashが失敗する可能性があることに注意してください。deepseek r1用に最適化されたフォーマットのプロンプトを無視するようです。
次のステップ: [サービスの起動とAgenticSeekの実行](#Start-services-and-Run)
次のステップ:[サービスの開始とAgenticSeekの実行](#サービスの開始と実行)
*問題がある場合は**Known issues**セクション参照*
*問題が発生した場合は、**既知の問題**セクション参照してください*
*詳細な設定ファイルの説明については、**設定**セクションを参照してください。*
*詳細な設定は**Config**セクション参照*
---
## サービスの開始と実行
## サービスの起動とAgenticSeekの実行
必要に応じてPython環境をアクティブ化します。
```sh
source agentic_seek_env/bin/activate
```
必要なサービスを開始します。これにより、docker-compose.ymlからすべてのサービスが開始されます。これには以下が含まれます:
必要なサービスを起動します。docker-compose.ymlから以下のサービスが起動します:
- searxng
- redissearxngに必要
- redissearxng
- frontend
- backend`full`の場合)
```sh
sudo ./start_services.sh # MacOS
start ./start_services.cmd # Window
./start_services.sh full # MacOS
start ./start_services.cmd full # Windows
```
**オプション1** CLIインターフェースで実行します
**注意:** このステップで全Dockerイメージがダウンロード・展開されるため最大30分かかる場合があります。backendサービスが完全に起動するまで(ログにbackend: <info>が表示されるまで)待ってください
`http://localhost:3000/`にアクセスするとWebインターフェースが表示されます。
**オプション:** CLIインターフェースで実行
CLIで実行する場合はホストにパッケージをインストールしてください。
```sh
python3 cli.py
./install.sh
./install.bat # windows
```
CLIモードでは、config.iniで`headless_browser`をFalseに設定することをお勧めします。
**オプション2** Webインターフェースで実行します。
バックエンドを開始します。
サービス起動:
```sh
python3 api.py
./start_services.sh # MacOS
start ./start_services.cmd # Windows
```
`http://localhost:3000/`にアクセスすると、Webインターフェースが表示されます。
その後 `python3 cli.py` を実行
---
## 使用方法
## 使い方
`./start_services.sh`でサービスが起動していることを確認し、CLIモードの場合は`python3 cli.py`で、Webインターフェースの場合は`python3 api.py`を実行してから`localhost:3000`にアクセスしてAgenticSeekを実行します。
`./start_services.sh full`でサービスが起動していることを確認し、Webインターフェースは`localhost:3000`です。
設定で`listen = True`を設定することで、音声認識を使用することもできます。CLIモードのみ
CLIモードで音声認識を使う場合はconfigで`listen = True`にしてください
終了するには、単に`goodbye`と発言/入力します
終了するにはgoodbye」と入力または発話してください
以下に使用例をいくつか示します:
使用例:
> *Pythonでスネークゲームを作って!*
> *pythonでスネークゲームを作って!*
> *フランスレンヌでトップのカフェをウェブ検索し、3つのカフェのリストとその住所をrennes_cafes.txtに保存して。*
> *フランスレンヌの人気カフェをウェブ検索し、3つ選んで住所とともにrennes_cafes.txtに保存して。*
> *数値の階乗を計算するGoプログラムを書いて、それをfactorial.goとしてワークスペースに保存して。*
> *Go言語で階乗を計算するプログラムを書き、workspaceにfactorial.goとして保存して。*
> *summer_picturesフォルダ内のすべてのJPGファイルを検索し、今日の日付で名前を変更し、名前変更されたファイルのリストをphotos_list.txtに保存して。*
> *summer_picturesフォルダ内のJPGファイルをすべて検索し、今日の日付でリネームし、リストをphotos_list.txtに保存して。*
> *2024年の人気SF映画をオンラインで検索し、今夜観る映画を3つ選んで。リストをmovie_night.txtに保存して。*
> *2024年の人気SF映画をウェブで調べ、今夜観る3本を選んでmovie_night.txtに保存して。*
> *2025年の最新AIニュース記事をウェブ検索し、3つ選択して、それらのタイトルと要約をスクレイピングするPythonスクリプトを書いて。スクリプトをnews_scraper.pyとして、要約を/home/projectsのai_news.txtに保存して。*
> *2025年の最新AIニュース記事をウェブ検索し、3つ選んでタイトルと要約をPythonスクリプトでスクレイピング。news_scraper.pyにスクリプト、ai_news.txtに要約を保存して。*
> *金曜日、無料の株価APIをウェブで検索し、supersuper7434567@gmail.comで登録し、そのAPIを使用してテスラの日々の価格を取得するPythonスクリプトを書いて、結果をstock_prices.csvに保存して。*
> *金曜日、無料の株価APIをウェブでし、supersuper7434567@gmail.comで登録後、Teslaの日次株価を取得するPythonスクリプトを書き、stock_prices.csvに保存して。*
*フォーム入力機能はまだ実験的であり、失敗する可能性があることに注意してください。*
*フォーム入力機能は実験的で失敗する場合があります。*
クエリを入力すると、AgenticSeekが最適なエージェントを自動で割り当てます。
クエリを入力すると、AgenticSeekはタスクに最適なエージェント割り当てます。
初期プロトタイプのため、エージェント割り当てが最適でない場合があります。
これは初期のプロトタイプであるため、エージェントルーティングシステムがクエリに基づいて常に適切なエージェントを割り当てるとは限りません。
そのため、AIにしてほしいことや手順を明確に伝えてください。例えばウェブ検索をさせたい場合は
したがって、何をしたいのか、AIがどのように進むべきかについて非常に明確にする必要があります。たとえば、ウェブ検索を実行させたい場合は、次のように言わないでください:
`Do you know some good countries for solo-travel?`
`一人旅に適した良い国を知っていますか?`
ではなく
代わりに、次のように尋ねてください:
`Do a web search and find out which are the best country for solo-travel`
`ウェブ検索をして、一人旅に最適な国を見つけてください`
のように依頼してください
---
## **自のサーバーでLLMを実行するためのセットアップ**
## **自のサーバーでLLMを実行する場合**
強力なコンピューターまたは使用できるサーバーがあるが、ラップトップから使用したい場合は、カスタムLLMサーバーを使用してリモートサーバーでLLMを実行するオプションがあります。
高性能なPCやサーバーを持っていて、ノートPCから用したい場合は、カスタムLLMサーバーを使てリモート実行できます。
AIモデルを実行する「サーバー」でIPアドレスを取得します。
AIモデルを動かす「サーバー」でIPアドレスを取得
```sh
ip a | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1 # ローカルIP
curl https://ipinfo.io/ip # パブリックIP
curl https://ipinfo.io/ip # グローバルIP
```
注意:WindowsまたはmacOSの場合、それぞれipconfigまたはifconfigを使用してIPアドレスを見つけます。
リポジトリをクローンし、`server/`フォルダに入ります。
WindowsmacOSの場合ipconfigifconfigで確認
リポジトリをクローンし、`server/`フォルダへ
```sh
git clone --depth 1 https://github.com/Fosowl/agenticSeek.git
cd agenticSeek/server/
cd agenticSeek/llm_server/
```
サーバー固有の要件をインストールします:
サーバー用依存パッケージをインストール
```sh
pip3 install -r requirements.txt
```
サーバー スクリプトを実行します。
サーバースクリプトを実行
```sh
python3 app.py --provider ollama --port 3333
```
LLMサービスとして`ollama``llamacpp`のどちらかを選択できます。
LLMサービスは`ollama`または`llamacpp`から選択可能です。
個人PC側では
次に、個人のコンピュータで:
`config.ini`ファイルを変更して、`provider_name``server`に、`provider_model``deepseek-r1:xxb`に設定します。
`provider_server_address`をモデルを実行するマシンのIPアドレスに設定します。
`config.ini`で`provider_name`を`server`、`provider_model`を`deepseek-r1:xxb`に設定。
`provider_server_address`はサーバーのIPアドレスに設定。
```sh
[MAIN]
@@ -361,41 +332,42 @@ provider_model = deepseek-r1:70b
provider_server_address = x.x.x.x:3333
```
次のステップ:[サービスの開始とAgenticSeekの実行](#サービスの開始と実行)
次のステップ: [サービスの起動とAgenticSeekの実行](#Start-services-and-Run)
---
## 音声認識
## 音声認識Speech to Text
現在音声認識は英語でのみ機能することに注意してください。
注意: 現在音声認識はCLIモードのみ対応
音声認識機能はデフォルトで無効になっています。有効にするには、config.iniファイルでlistenオプションをTrueに設定します:
現状、音声認識は英語のみ対応です。
デフォルトでは無効です。有効にするにはconfig.iniでlistenをTrueにしてください。
```
listen = True
```
有効にすると、音声認識機能は、入力を処理し始める前にトリガーキーワード(エージェントの名前)をリッスンします。*config.ini*ファイルで`agent_name`の値を更新することで、エージェントの名前をカスタマイズできます:
有効時は、エージェント名(例: Friday)をトリガーワードとして発話すると認識が始まります。エージェント名は*config.ini*の`agent_name`で変更可能です。
```
agent_name = Friday
```
最適な認識のためには、エージェント名として「John」や「Emma」のような一般的な英語の名前を使用することをお勧めします。
認識精度向上のため、"John"や"Emma"など一般的な英語名を推奨します。
トランスクリプトが表示され始めたら、エージェントの名前を声に出して起動します(例:「Friday)。
トランスクリプトが表示され始めたら、エージェント名を発話して起動してください(例: "Friday")。
クエリをはっきりと話します
クエリを明瞭に話してください
システムに処理を進めるよう合図するために、確認フレーズでリクエスト終了します。確認フレーズの例は次のとおりです:
リクエスト終了時に以下のような確認フレーズを発話してください:
```
"do it", "go ahead", "execute", "run", "start", "thanks", "would ya", "please", "okay?", "proceed", "continue", "go on", "do that", "go it", "do you understand?"
```
## 設定
## 設定ファイル(Config
設定例
設定例:
```
[MAIN]
is_local = True
@@ -407,7 +379,6 @@ recover_last_session = False
save_session = False
speak = False
listen = False
work_dir = /Users/mlg/Documents/ai_folder
jarvis_personality = False
languages = en zh
[BROWSER]
@@ -415,54 +386,50 @@ headless_browser = False
stealth_mode = False
```
**説明**:
**各項目の説明:**
- is_local -> エージェントをローカル実行するTrue)かリモートサーバーで実行するFalse)か
- is_local -> ローカル実行(True)かリモート(False)か
- provider_name -> 使用するプロバイダー`ollama``server``lm-studio``deepseek-api`のいずれか
- provider_name -> 使用するプロバイダー名(`ollama`, `server`, `lm-studio`, `deepseek-api`など
- provider_model -> 使用するモデル、例:deepseek-r1:32b
- provider_model -> 使用モデル例: deepseek-r1:32b
- provider_server_address -> サーバーアドレス、例:ローカルの場合は127.0.0.1:11434。非ローカルAPIの場合は何でも設定します
- provider_server_address -> サーバーアドレス例: 127.0.0.1:11434ローカルの場合)。API利用時は任意
- agent_name -> エージェントの名前、例:Friday。TTSのトリガーワードとして使用されます。
- agent_name -> エージェント名(例: Friday。TTSのトリガーワード
- recover_last_session -> 前回セッションから再開するTrueしない(Falseか。
- recover_last_session -> 前回セッションから再開(True)/しない(False
- save_session -> セッションデータ保存するTrueしない(Falseか。
- save_session -> セッションデータ保存(True)/しない(False
- speak -> 音声出力有効にするTrueかしないFalseか。
- speak -> 音声出力有効(True/無効False
- listen -> 音声入力をリッスンするTrueかしないFalseか。
- listen -> 音声入力有効True/無効False
- work_dir -> AIがアクセスできるフォルダ。例:/Users/user/Documents/
- jarvis_personality -> JARVIS風パーソナリティ(True)/通常(False)。プロンプトファイルが変わります
- jarvis_personality -> JARVISのような性格を使用する(True)かしない(False)か。これは単にプロンプトファイルを変更します
- languages -> サポート言語リスト。エージェントルーティングに必要。多すぎる/似た言語は非推奨
- languages -> サポートされている言語のリスト。LLMルーターが正しく機能するために必要です。あまりにも多くの言語や類似した言語を入れすぎないようにしてください。
- headless_browser -> ブラウザを非表示で実行(True)/表示(False)
- headless_browser -> 表示ウィンドウなしでブラウザを実行する(True)かしない(False)か。
- stealth_mode -> ボット検出回避。anticaptcha拡張の手動インストールが必要
- stealth_mode -> ボット検出を困難にします。唯一の欠点は、anticaptcha拡張機能を手動でインストールする必要があることです。
- languages -> サポート言語リスト。ルーティング用。多いほどモデルダウンロード数増加
- languages -> サポートされている言語のリスト。エージェントルーティングシステムに必要です。言語リストが長いほど、ダウンロードされるモデルが多くなります。
## プロバイダー一覧
## プロバイダー
以下の表は、利用可能なプロバイダーを示しています:
| プロバイダー | ローカル? | 説明 |
| プロバイダー | ローカル? | 説明 |
|-----------|--------|-----------------------------------------------------------|
| ollama | はい | ollamaをLLMプロバイダーとして使用して、LLMをローカルで簡単に実行します |
| server | はい | モデルを別のマシンでホストし、ローカルマシンで実行します |
| lm-studio | はい | LM studioでLLMをローカル実行します(`lm-studio` |
| openai | 場合による | ChatGPT API(非プライベート)またはopenai互換APIを使用 |
| ollama | はい | ollamaでローカルLLMを簡単に実行 |
| server | はい | 別マシンでモデルをホストし、ローカルから利用 |
| lm-studio | はい | LM studioでローカルLLMを実行(`lm-studio` |
| openai | 場合による | ChatGPT API(非プライベート)またはopenai互換API |
| deepseek-api | いいえ | Deepseek API(非プライベート) |
| huggingface| いいえ | Hugging-Face API(非プライベート) |
| togetherAI | いいえ | together AI APIを使用(非プライベート) |
| google | いいえ | google gemini APIを使用(非プライベート) |
| togetherAI | いいえ | together AI API(非プライベート) |
| google | いいえ | google gemini API(非プライベート) |
プロバイダー選択するには、config.iniを変更します:
プロバイダー選択config.ini
```
is_local = True
@@ -470,101 +437,104 @@ provider_name = ollama
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:5000
```
`is_local`: ローカルで実行されるLLMの場合はTrue、それ以外の場合はFalseである必要があります。
`is_local`: ローカルLLMならTrue、それ以外はFalse
`provider_name`: 使用するプロバイダーを名前で選択します。上記のプロバイダーリストを参照してください。
`provider_name`: 上記リストから選択
`provider_model`: エージェントが使用するモデルを設定します。
`provider_model`: 使用モデル
`provider_server_address`: サーバーアドレス。APIプロバイダーには使用されません。
`provider_server_address`: serverプロバイダー以外は任意
# 既知の問題
## Chromedriverの問題
**既知のエラー #1:** *chromedriverの不一致*
**既知のエラー #1:** *chromedriverのバージョン不一致*
`Exception: Failed to initialize browser: Message: session not created: This version of ChromeDriver only supports Chrome version 113
Current browser version is 134.0.6998.89 with binary path`
これはブラウザとchromedriverのバージョンが一致しない場合に発生します。
これはブラウザとchromedriverのバージョンが一致していない場合に発生します。
最新バージョンをダウンロードするためにナビゲートする必要があります:
最新版は下記からダウンロードしてください:
https://developer.chrome.com/docs/chromedriver/downloads
Chromeバージョン115以降を使用している場合は、以下にアクセスしてください:
Chrome 115以降の場合は
https://googlechromelabs.github.io/chrome-for-testing/
そして、OSに一致するchromedriverバージョンをダウンロードします。
からOSに合ったchromedriverをダウンロード
![代替テキスト](./media/chromedriver_readme.png)
![alt text](./media/chromedriver_readme.png)
このセクションが不完全な場合は、問題を提起してください。
このセクションが不十分な場合はissueを立ててください。
## 接続アダプタの問題
## connection adaptersの問題
```
Exception: Provider lm-studio failed: HTTP request failed: No connection adapters were found for '127.0.0.1:11434/v1/chat/completions'
```
プロバイダーのIPアドレスの前に`http://`があることを確認してください
provider IPアドレスの前に`http://`を付けてください:
`provider_server_address = http://127.0.0.1:11434`
## SearxNGのベースURLを指定する必要があります
## SearxNG base URLが必要
```
raise ValueError("SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.")
ValueError: SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.
```
`.env.example``.env`として移動しなかった可能性がありますか?SEARXNG_BASE_URLをエクスポートすることもできます:
`.env.example`を`.env`にリネームしていない場合に発生します。もしくは下記でエクスポート:
`export SEARXNG_BASE_URL="http://127.0.0.1:8080"`
## FAQ
**Q: どのようなハードウェアが必要ですか?**
**Q: どなハードウェアが必要**
| モデルサイズ | GPU | コメント |
|-----------|------------|--------------------------------------------------------------------------|
| 7B | 8GB VRAM | ⚠️ 推奨。パフォーマンスが悪く、幻覚が頻繁に発生し、プランナーエージェントは失敗する可能性が高いです。 |
| 14B | 12GB VRAM(例:RTX 3060 | ✅ 簡単なタスクには使用可。ウェブブラウジングや計画タスクで苦労する可能性があります。 |
| 32B | 24GB以上のVRAM(例:RTX 4090 | 🚀 ほとんどのタスクで成功しますが、タスク計画でまだ苦労する可能性があります。 |
| 70B+ | 48GB以上のVRAM(例:mac studio | 💪 素晴らしい。高度なユースケースに推奨されます。 |
| モデルサイズ | GPU | コメント |
|-----------|--------|-----------------------------------------------------------|
| 7B | 8GB Vram | ⚠️ 推奨しません。性能が低く、幻覚やプランナー失敗が多発します。 |
| 14B | 12 GB VRAM (例: RTX 3060) | ✅ 簡単なタスクなら使用可。ウェブブラウジングや計画タスクは苦手。 |
| 32B | 24+ GB VRAM (例: RTX 4090) | 🚀 ほとんどのタスクで成功。計画タスクはやや苦手 |
| 70B+ | 48+ GB Vram (例: mac studio) | 💪 高度な用途に最適。推奨 |
**Q: なぜ他のモデルではなくDeepseek R1なのですか?**
**Q: なぜDeepseek R1を推奨?**
Deepseek R1は、そのサイズに対して推論ツール使用に優れています。私たちのニーズに合っていると考えており、他のモデルも正常に動作しますが、Deepseekが私たちの主要な選択肢です。
Deepseek R1は推論ツール用に優れています。他モデルも使えますが、Deepseekが主力です。
**Q: `cli.py`を実行するとエラーが発生します。どうすればよいですか?**
**Q: `cli.py`実行時にエラーが出る場合は?**
ローカルが実行されていること(`ollama serve`)、`config.ini`がプロバイダーと一致していること、依存関係がインストールされていることを確認してください。それでも解決しない場合は、遠慮なく問題を提起してください。
`ollama serve`が動作しているか、`config.ini`が正しいか、依存パッケージがインストールされている確認してください。解決しない場合はissueを立ててください。
**Q: 本当に100%ローカルで実行できますか**
**Q: 本当に100%ローカルで動作する**
はい、Ollama、lm-studio、またはサーバープロバイダーを使用すると、すべての音声認識LLM、テキスト読み上げモデルがローカルで実行されます。非ローカルオプション(OpenAIまたはその他のAPIはオプションです。
Ollama、lm-studio、serverプロバイダーなら音声認識LLM・音声合成すべてローカルで動作します。API利用はオプションです。
**Q: Manusがあるのに、なぜAgenticSeekを使うべきなのですか**
**Q: ManusがあるのにAgenticSeekを使う理由は**
れは、AIエージェントへの関心から始めたサイドプロジェクトです。特別なのは、ローカルモデルを使用し、APIを避けたいということです。
私たちはJarvisとFriday(アイアンマン映画)からインスピレーションを得て「クール」にしましたが、機能性についてはManusからより多くのインスピレーションを得ています。なぜなら、それが人々が最初に望むもの、つまりローカルなManusの代替だからです。
Manusとは異なり、AgenticSeekは外部システムからの独立性を優先し、より多くの制御、プライバシーを提供し、APIコストを回避します。
のプロジェクトはローカルモデル利用とAPI回避を目的に始まりました。JarvisやFriday(アイアンマン)風の「かっこよさ」とManusの機能性を両立。Manusと違い外部依存を排除し、プライバシーとコスト削減を重視しています。
## 貢献する
## コントリビュート
AgenticSeek改善するための開発者を募集しています!オープンな問題やディスカッションを確認してください。
AgenticSeek改善にご協力ください!issueやディスカッションをチェック
[貢献ガイド](./docs/CONTRIBUTING.md)
[コントリビューションガイド](./docs/CONTRIBUTING.md)
[![スター履歴チャート](https://api.star-history.com/svg?repos=Fosowl/agenticSeek&type=Date)](https://www.star-history.com/#Fosowl/agenticSeek&Date)
[![Star History Chart](https://api.star-history.com/svg?repos=Fosowl/agenticSeek&type=Date)](https://www.star-history.com/#Fosowl/agenticSeek&Date)
## メンテナー
## メンテナー:
> [Fosowl](https://github.com/Fosowl) | パリ時間
> [https://github.com/antoineVIVIES](antoineVIVIES) | 台北時間
> [antoineVIVIES](https://github.com/antoineVIVIES) | 台北時間
> [steveh8758](https://github.com/steveh8758) | 台北時間
## Special Thanks:
> [tcsenpai](https://github.com/tcsenpai) および [plitc](https://github.com/plitc) バックエンドDocker化への貢献に感謝
> [steveh8758](https://github.com/steveh8758) | 台北時間 |(常に忙しい)
+546
View File
@@ -0,0 +1,546 @@
# AgenticSeek: Alternativa Privada e Local ao Manus.
<p align="center">
<img align="center" src="./media/agentic_seek_logo.png" width="300" height="300" alt="Agentic Seek Logo">
<p>
English | [中文](./README_CHS.md) | [繁體中文](./README_CHT.md) | [Français](./README_FR.md) | [日本語](./README_JP.md) | [Português (Brasil)](./README_PTBR.md)
*Uma **alternativa 100% local ao Manus AI**, este assistente de voz com IA navega autonomamente na web, escreve código e planeja tarefas mantendo todos os dados no seu dispositivo. Feito para modelos de raciocínio locais, roda inteiramente no seu hardware, garantindo total privacidade e zero dependência da nuvem.*
[![Visite AgenticSeek](https://img.shields.io/static/v1?label=Website&message=AgenticSeek&color=blue&style=flat-square)](https://fosowl.github.io/agenticSeek.html) ![Licença](https://img.shields.io/badge/license-GPL--3.0-green) [![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?logo=discord&logoColor=white)](https://discord.gg/8hGDaME3TC) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fosowl.svg?style=social&label=Update%20%40Fosowl)](https://x.com/Martin993886460) [![GitHub stars](https://img.shields.io/github/stars/Fosowl/agenticSeek?style=social)](https://github.com/Fosowl/agenticSeek/stargazers)
### Por que AgenticSeek?
* 🔒 Totalmente Local & Privado - Tudo roda na sua máquina — sem nuvem, sem compartilhamento de dados. Seus arquivos, conversas e buscas permanecem privados.
* 🌐 Navegação Inteligente na Web - O AgenticSeek pode navegar na internet sozinho — pesquisar, ler, extrair informações, preencher formulários — tudo sem as mãos.
* 💻 Assistente Autônomo de Programação - Precisa de código? Ele pode escrever, depurar e executar programas em Python, C, Go, Java e mais — tudo sem supervisão.
* 🧠 Seleção Inteligente de Agentes - Você pede, ele escolhe automaticamente o melhor agente para a tarefa. Como ter uma equipe de especialistas pronta para ajudar.
* 📋 Planeja & Executa Tarefas Complexas - De planejamento de viagens a projetos complexos — pode dividir grandes tarefas em etapas e concluí-las usando múltiplos agentes de IA.
* 🎙️ Ativado por Voz - Voz limpa, rápida e futurista, além de reconhecimento de fala, permitindo que você converse como se fosse sua IA pessoal de um filme de ficção científica. (Em desenvolvimento)
### **Demo**
> *Você pode pesquisar sobre o projeto agenticSeek, aprender quais habilidades são necessárias, depois abrir o CV_candidates.zip e então me dizer quais combinam melhor com o projeto?*
https://github.com/user-attachments/assets/b8ca60e9-7b3b-4533-840e-08f9ac426316
Aviso: Esta demonstração, incluindo todos os arquivos que aparecem (ex: CV_candidates.zip), são totalmente fictícios. Não somos uma corporação, buscamos colaboradores open-source, não candidatos.
> 🛠⚠️ **Trabalho Ativo em Progresso**
> 🙏 Este projeto começou como um projeto paralelo e não tem roteiro nem financiamento. Cresceu muito além do esperado ao aparecer no GitHub Trending. Contribuições, feedback e paciência são profundamente apreciados.
## Pré-requisitos
Certifique-se de ter chrome driver, docker e python3.10 instalados.
Para problemas relacionados ao chrome driver, veja a seção **Chromedriver**.
### 1. **Clone o repositório e configure**
```sh
git clone https://github.com/Fosowl/agenticSeek.git
cd agenticSeek
mv .env.example .env
```
### 2. Altere o conteúdo do arquivo .env
```sh
SEARXNG_BASE_URL="http://127.0.0.1:8080"
REDIS_BASE_URL="redis://redis:6379/0"
WORK_DIR="/Users/mlg/Documents/workspace_for_ai"
OLLAMA_PORT="11434"
LM_STUDIO_PORT="1234"
CUSTOM_ADDITIONAL_LLM_PORT="11435"
OPENAI_API_KEY='opcional'
DEEPSEEK_API_KEY='opcional'
OPENROUTER_API_KEY='opcional'
TOGETHER_API_KEY='opcional'
GOOGLE_API_KEY='opcional'
ANTHROPIC_API_KEY='opcional'
```
**As chaves de API são totalmente opcionais para quem optar por rodar LLM localmente. Que é o objetivo principal deste projeto. Deixe em branco se você tiver hardware suficiente**
As seguintes variáveis de ambiente configuram as conexões e chaves de API do seu aplicativo.
Atualize o arquivo `.env` com seus próprios valores conforme necessário:
- **SEARXNG_BASE_URL**: Deixe inalterado
- **REDIS_BASE_URL**: Deixe inalterado
- **WORK_DIR**: Caminho para seu diretório de trabalho local. O AgenticSeek poderá ler e interagir com esses arquivos.
- **OLLAMA_PORT**: Porta para o serviço Ollama.
- **LM_STUDIO_PORT**: Porta para o serviço LM Studio.
- **CUSTOM_ADDITIONAL_LLM_PORT**: Porta para qualquer serviço LLM adicional.
Todas as variáveis de ambiente de chave de API abaixo são **opcionais**. Só forneça se for usar APIs externas em vez de rodar LLMs localmente.
### 3. **Inicie o Docker**
Certifique-se de que o Docker está instalado e rodando no seu sistema. Você pode iniciar o Docker com os seguintes comandos:
- **No Linux/macOS:**
Abra um terminal e execute:
```sh
sudo systemctl start docker
```
Ou inicie o Docker Desktop pelo menu de aplicativos, se instalado.
- **No Windows:**
Inicie o Docker Desktop pelo menu Iniciar.
Você pode verificar se o Docker está rodando executando:
```sh
docker info
```
Se aparecerem informações sobre sua instalação do Docker, está funcionando corretamente.
---
## Configuração para rodar LLM localmente na sua máquina
**Requisitos de Hardware:**
Para rodar LLMs localmente, você precisará de hardware suficiente. No mínimo, uma GPU capaz de rodar Qwen/Deepseek 14B é necessária. Veja o FAQ para recomendações detalhadas de modelo/desempenho.
**Configure seu provedor local**
Inicie seu provedor local, por exemplo com ollama:
```sh
ollama serve
```
Veja abaixo a lista de provedores locais suportados.
**Atualize o config.ini**
Altere o arquivo config.ini para definir o provider_name para um provedor suportado e provider_model para um LLM suportado pelo seu provedor. Recomendamos modelos de raciocínio como *Qwen* ou *Deepseek*.
Veja o **FAQ** no final do README para hardware necessário.
```sh
[MAIN]
is_local = True # Se está rodando localmente ou com provedor remoto.
provider_name = ollama # ou lm-studio, openai, etc.
provider_model = deepseek-r1:14b # escolha um modelo compatível com seu hardware
provider_server_address = 127.0.0.1:11434
agent_name = Jarvis # nome da sua IA
recover_last_session = True # recuperar sessão anterior
save_session = True # lembrar sessão atual
speak = False # texto para fala
listen = False # fala para texto, apenas para CLI, experimental
jarvis_personality = False # usar personalidade "Jarvis" (experimental)
languages = en zh # Lista de idiomas, TTS usará o primeiro da lista
[BROWSER]
headless_browser = True # deixe inalterado a menos que use CLI no host.
stealth_mode = True # Usa selenium indetectável para reduzir detecção do navegador
```
**Aviso**:
- O formato do arquivo `config.ini` não suporta comentários.
Não copie e cole a configuração de exemplo diretamente, pois comentários causarão erros. Em vez disso, modifique manualmente o arquivo `config.ini` com suas configurações desejadas, sem comentários.
- *NÃO* defina provider_name como `openai` se estiver usando LM-studio para rodar LLMs. Use `lm-studio`.
- Alguns provedores (ex: lm-studio) exigem `http://` antes do IP. Exemplo: `http://127.0.0.1:1234`
**Lista de provedores locais**
| Provedor | Local? | Descrição |
|------------|--------|---------------------------------------------------------|
| ollama | Sim | Rode LLMs localmente facilmente usando ollama |
| lm-studio | Sim | Rode LLM localmente com LM studio (`provider_name` = `lm-studio`)|
| openai | Sim | Use API compatível com openai (ex: servidor llama.cpp) |
Próximo passo: [Inicie os serviços e rode o AgenticSeek](#Start-services-and-Run)
*Veja a seção **Problemas conhecidos** se tiver problemas*
*Veja a seção **Rodar com uma API** se seu hardware não rodar deepseek localmente*
*Veja a seção **Config** para explicação detalhada do arquivo de configuração.*
---
## Configuração para rodar com uma API
**Rodar com uma API é opcional, veja acima para rodar localmente.**
Defina o provedor desejado no `config.ini`. Veja abaixo a lista de provedores de API.
```sh
[MAIN]
is_local = False
provider_name = google
provider_model = gemini-2.0-flash
provider_server_address = 127.0.0.1:5000 # não importa
```
Aviso: Certifique-se de não haver espaço no final da linha no config.
Exporte sua chave de API: `export <<PROVIDER>>_API_KEY="xxx"`
Exemplo: exportar `TOGETHER_API_KEY="xxxxx"`
**Lista de provedores de API**
| Provedor | Local? | Descrição |
|------------|--------|---------------------------------------------------------|
| openai | Depende| Use API do ChatGPT |
| deepseek | Não | API Deepseek (não privado) |
| huggingface| Não | API Hugging-Face (não privado) |
| togetherAI | Não | Use API together AI (não privado) |
| google | Não | Use API google gemini (não privado) |
Observe que código/bash pode falhar com gemini, pois ignora nosso prompt de formatação, que é otimizado para deepseek r1. Modelos como gpt-4o também apresentam desempenho ruim com nosso prompt.
Próximo passo: [Inicie os serviços e rode o AgenticSeek](#Start-services-and-Run)
*Veja a seção **Problemas conhecidos** se tiver problemas*
*Veja a seção **Config** para explicação detalhada do arquivo de configuração.*
---
## Inicie os serviços e rode
Inicie os serviços necessários. Isso iniciará todos os serviços do docker-compose.yml, incluindo:
- searxng
- redis (necessário para searxng)
- frontend
- backend (se usar `full`)
```sh
./start_services.sh full # MacOS
start ./start_services.cmd full # Windows
```
**Aviso:** Este passo fará download e carregará todas as imagens Docker, o que pode levar até 30 minutos. Após iniciar os serviços, aguarde até que o serviço backend esteja totalmente rodando (você verá backend: <info> no log) antes de enviar mensagens. O backend pode demorar mais para iniciar.
Acesse `http://localhost:3000/` e você verá a interface web.
**Opcional:** Rode com a interface CLI:
Para rodar com CLI, instale os pacotes no host:
```sh
./install.sh
./install.bat # windows
```
Inicie os serviços:
```sh
./start_services.sh # MacOS
start ./start_services.cmd # Windows
```
Depois execute: `python3 cli.py`
---
## Uso
Certifique-se de que os serviços estão rodando com `./start_services.sh full` e acesse `localhost:3000` para a interface web.
Você também pode usar fala para texto definindo `listen = True` no config. Apenas para modo CLI.
Para sair, basta dizer/digitar `goodbye`.
Exemplos de uso:
> *Faça um jogo da cobrinha em python!*
> *Pesquise na web pelos melhores cafés em Rennes, França, e salve uma lista de três com seus endereços em rennes_cafes.txt.*
> *Escreva um programa Go para calcular o fatorial de um número, salve como factorial.go no seu workspace*
> *Procure na pasta summer_pictures por todos os arquivos JPG, renomeie com a data de hoje e salve a lista dos arquivos renomeados em photos_list.txt*
> *Pesquise online por filmes de ficção científica populares de 2024 e escolha três para assistir hoje à noite. Salve a lista em movie_night.txt.*
> *Pesquise na web pelos últimos artigos de notícias de IA de 2025, selecione três e escreva um script Python para extrair títulos e resumos. Salve o script como news_scraper.py e os resumos em ai_news.txt em /home/projects*
> *Sexta-feira, pesquise na web por uma API gratuita de preços de ações, registre-se com supersuper7434567@gmail.com e escreva um script Python para buscar os preços diários da Tesla usando a API, salvando os resultados em stock_prices.csv*
*Observe que o preenchimento de formulários ainda é experimental e pode falhar.*
Após digitar sua consulta, o AgenticSeek alocará o melhor agente para a tarefa.
Como este é um protótipo inicial, o sistema de roteamento de agentes pode não alocar sempre o agente certo para sua consulta.
Portanto, seja explícito no que deseja e como a IA deve proceder. Por exemplo, se quiser que faça uma busca na web, não diga:
`Você conhece alguns bons países para viajar sozinho?`
Em vez disso, peça:
`Faça uma busca na web e descubra quais são os melhores países para viajar sozinho`
---
## **Configuração para rodar o LLM em seu próprio servidor**
Se você tem um computador potente ou servidor, mas quer usar a partir do seu laptop, pode rodar o LLM em um servidor remoto usando nosso servidor LLM customizado.
No seu "servidor" que rodará o modelo de IA, obtenha o endereço IP
```sh
ip a | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1 # ip local
curl https://ipinfo.io/ip # ip público
```
Nota: Para Windows ou macOS, use ipconfig ou ifconfig para encontrar o IP.
Clone o repositório e entre na pasta `server/`.
```sh
git clone --depth 1 https://github.com/Fosowl/agenticSeek.git
cd agenticSeek/llm_server/
```
Instale os requisitos específicos do servidor:
```sh
pip3 install -r requirements.txt
```
Rode o script do servidor.
```sh
python3 app.py --provider ollama --port 3333
```
Você pode escolher entre usar `ollama` e `llamacpp` como serviço LLM.
Agora, no seu computador pessoal:
Altere o arquivo `config.ini` para definir `provider_name` como `server` e `provider_model` como `deepseek-r1:xxb`.
Defina `provider_server_address` para o IP da máquina que rodará o modelo.
```sh
[MAIN]
is_local = False
provider_name = server
provider_model = deepseek-r1:70b
provider_server_address = x.x.x.x:3333
```
Próximo passo: [Inicie os serviços e rode o AgenticSeek](#Start-services-and-Run)
---
## Fala para Texto
Aviso: fala para texto só funciona no modo CLI no momento.
Atualmente, fala para texto só funciona em inglês.
A funcionalidade de fala para texto está desativada por padrão. Para ativar, defina listen como True no arquivo config.ini:
```
listen = True
```
Quando ativado, o recurso escuta por uma palavra-chave de ativação, que é o nome do agente, antes de processar sua entrada. Você pode personalizar o nome do agente atualizando o valor `agent_name` no *config.ini*:
```
agent_name = Friday
```
Para melhor reconhecimento, recomendamos usar um nome comum em inglês como "John" ou "Emma" como nome do agente.
Quando o transcript começar a aparecer, diga o nome do agente em voz alta para ativá-lo (ex: "Friday").
Fale sua consulta claramente.
Finalize seu pedido com uma frase de confirmação para o sistema prosseguir. Exemplos de frases de confirmação incluem:
```
"do it", "go ahead", "execute", "run", "start", "thanks", "would ya", "please", "okay?", "proceed", "continue", "go on", "do that", "go it", "do you understand?"
```
## Configuração
Exemplo de config:
```
[MAIN]
is_local = True
provider_name = ollama
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:11434
agent_name = Friday
recover_last_session = False
save_session = False
speak = False
listen = False
jarvis_personality = False
languages = en zh
[BROWSER]
headless_browser = False
stealth_mode = False
```
**Explicação**:
- is_local -> Roda o agente localmente (True) ou em servidor remoto (False).
- provider_name -> Provedor a ser usado (um de: `ollama`, `server`, `lm-studio`, `deepseek-api`)
- provider_model -> Modelo usado, ex: deepseek-r1:32b.
- provider_server_address -> Endereço do servidor, ex: 127.0.0.1:11434 para local. Qualquer valor para API não local.
- agent_name -> Nome do agente, ex: Friday. Usado como palavra-chave para TTS.
- recover_last_session -> Retoma da última sessão (True) ou não (False).
- save_session -> Salva dados da sessão (True) ou não (False).
- speak -> Ativa saída de voz (True) ou não (False).
- listen -> Ativa entrada por voz (True) ou não (False).
- jarvis_personality -> Usa personalidade tipo JARVIS (True) ou não (False). Apenas muda o prompt.
- languages -> Lista de idiomas suportados, necessário para o roteador de LLM funcionar corretamente. Evite muitos idiomas ou muito parecidos.
- headless_browser -> Roda navegador sem janela visível (True) ou não (False).
- stealth_mode -> Dificulta detecção de bot. Único contra é instalar manualmente a extensão anticaptcha.
- languages -> Lista de idiomas suportados. Necessário para o sistema de roteamento de agentes. Quanto maior a lista, mais modelos serão baixados.
## Provedores
Tabela de provedores disponíveis:
| Provedor | Local? | Descrição |
|------------|--------|---------------------------------------------------------|
| ollama | Sim | Rode LLMs localmente facilmente usando ollama |
| server | Sim | Hospede o modelo em outra máquina, use localmente |
| lm-studio | Sim | Rode LLM localmente com LM studio (`lm-studio`) |
| openai | Depende| Use API do ChatGPT (não privado) ou API compatível |
| deepseek-api| Não | API Deepseek (não privado) |
| huggingface| Não | API Hugging-Face (não privado) |
| togetherAI | Não | Use API together AI (não privado) |
| google | Não | Use API google gemini (não privado) |
Para selecionar um provedor, altere o config.ini:
```
is_local = True
provider_name = ollama
provider_model = deepseek-r1:32b
provider_server_address = 127.0.0.1:5000
```
`is_local`: deve ser True para qualquer LLM rodando localmente, senão False.
`provider_name`: Selecione o provedor pelo nome, veja a lista acima.
`provider_model`: Defina o modelo a ser usado pelo agente.
`provider_server_address`: pode ser qualquer valor se não usar o provedor server.
# Problemas conhecidos
## Problemas com Chromedriver
**Erro conhecido #1:** *chromedriver incompatível*
`Exception: Failed to initialize browser: Message: session not created: This version of ChromeDriver only supports Chrome version 113
Current browser version is 134.0.6998.89 with binary path`
Isso ocorre se houver incompatibilidade entre seu navegador e a versão do chromedriver.
Você precisa baixar a versão mais recente:
https://developer.chrome.com/docs/chromedriver/downloads
Se estiver usando Chrome versão 115 ou superior, acesse:
https://googlechromelabs.github.io/chrome-for-testing/
E baixe o chromedriver correspondente ao seu sistema operacional.
![alt text](./media/chromedriver_readme.png)
Se esta seção estiver incompleta, abra uma issue.
## Problemas de adaptadores de conexão
```
Exception: Provider lm-studio failed: HTTP request failed: No connection adapters were found for '127.0.0.1:11434/v1/chat/completions'
```
Certifique-se de ter `http://` antes do IP do provedor:
`provider_server_address = http://127.0.0.1:11434`
## SearxNG base URL deve ser fornecida
```
raise ValueError("SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.")
ValueError: SearxNG base URL must be provided either as an argument or via the SEARXNG_BASE_URL environment variable.
```
Talvez você não tenha movido `.env.example` para `.env`? Você também pode exportar SEARXNG_BASE_URL:
`export SEARXNG_BASE_URL="http://127.0.0.1:8080"`
## FAQ
**P: Que hardware eu preciso?**
| Tamanho do Modelo | GPU | Comentário |
|-------------------|-------------|---------------------------------------------------------|
| 7B | 8GB Vram | ⚠️ Não recomendado. Desempenho ruim, alucinações frequentes, agentes de planejamento podem falhar. |
| 14B | 12 GB VRAM (ex: RTX 3060) | ✅ Usável para tarefas simples. Pode ter dificuldades com navegação web e planejamento. |
| 32B | 24+ GB VRAM (ex: RTX 4090) | 🚀 Sucesso na maioria das tarefas, pode ainda ter dificuldades com planejamento |
| 70B+ | 48+ GB Vram (ex: mac studio) | 💪 Excelente. Recomendado para uso avançado. |
**P: Por que Deepseek R1 em vez de outros modelos?**
Deepseek R1 se destaca em raciocínio e uso de ferramentas para seu tamanho. Achamos que é uma ótima escolha para nossas necessidades, outros modelos funcionam bem, mas Deepseek é nossa principal escolha.
**P: Recebo erro ao rodar `cli.py`. O que faço?**
Certifique-se de que o local está rodando (`ollama serve`), seu `config.ini` corresponde ao provedor e as dependências estão instaladas. Se nada funcionar, abra uma issue.
**P: Pode rodar 100% localmente mesmo?**
Sim, com Ollama, lm-studio ou provedores server, todo o reconhecimento de fala, LLM e TTS rodam localmente. Opções não locais (OpenAI ou outras APIs) são opcionais.
**P: Por que usar AgenticSeek se já tenho Manus?**
Começou como um projeto paralelo por interesse em agentes de IA. O diferencial é usar modelos locais e evitar APIs.
Nos inspiramos em Jarvis e Friday (filmes do Homem de Ferro) para torná-lo "legal", mas funcionalmente nos inspiramos mais no Manus, pois é isso que as pessoas querem: uma alternativa local ao Manus.
Ao contrário do Manus, o AgenticSeek prioriza independência de sistemas externos, dando mais controle, privacidade e evitando custos de API.
## Contribua
Procuramos desenvolvedores para melhorar o AgenticSeek! Veja as issues abertas ou discussões.
[Guia de contribuição](./docs/CONTRIBUTING.md)
[![Star History Chart](https://api.star-history.com/svg?repos=Fosowl/agenticSeek&type=Date)](https://www.star-history.com/#Fosowl/agenticSeek&Date)
## Mantenedores:
> [Fosowl](https://github.com/Fosowl) | Horário de Paris
> [antoineVIVIES](https://github.com/antoineVIVIES) | Horário de Taipei
> [steveh8758](https://github.com/steveh8758) | Horário de Taipei
## Agradecimentos Especiais:
> [tcsenpai](https://github.com/tcsenpai) e [plitc](https://github.com/plitc) pela ajuda na dockerização do backend
+10 -1
View File
@@ -22,6 +22,10 @@ from sources.utility import pretty_print
from sources.logger import Logger
from sources.schemas import QueryRequest, QueryResponse
from dotenv import load_dotenv
load_dotenv()
from celery import Celery
@@ -34,7 +38,7 @@ config.read('config.ini')
api.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost", "http://localhost:3000"],
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
@@ -247,4 +251,9 @@ async def process_query(request: QueryRequest):
interaction.save_session()
if __name__ == "__main__":
envport = os.getenv("BACKEND_PORT")
if envport:
port = int(envport)
else:
port = 8000
uvicorn.run(api, host="0.0.0.0", port=8000)
+1 -2
View File
@@ -3,12 +3,11 @@ is_local = True
provider_name = ollama
provider_model = deepseek-r1:14b
provider_server_address = 127.0.0.1:11434
agent_name = Name_of_your_AI
agent_name = Jarvis
recover_last_session = False
save_session = False
speak = False
listen = False
work_dir = /Users/mlg/Documents/workspace_for_agenticseek
jarvis_personality = False
languages = en
[BROWSER]
+36 -34
View File
@@ -3,6 +3,7 @@ version: '3'
services:
redis:
container_name: redis
profiles: ["core", "full"]
image: docker.io/valkey/valkey:8-alpine
command: valkey-server --save 30 1 --loglevel warning
restart: unless-stopped
@@ -24,15 +25,16 @@ services:
searxng:
container_name: searxng
profiles: ["core", "full"]
image: docker.io/searxng/searxng:latest
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./searxng:/etc/searxng:rw
- ./searxng:/etc/searxng:rw,z
environment:
- SEARXNG_BASE_URL=http://localhost:8080/
- SEARXNG_SECRET_KEY=$(openssl rand -hex 32)
- SEARXNG_BASE_URL=${SEARXNG_BASE_URL:-http://localhost:8080/}
- SEARXNG_SECRET_KEY=${SEARXNG_SECRET_KEY}
- UWSGI_WORKERS=4
- UWSGI_THREADS=4
cap_add:
@@ -51,50 +53,50 @@ services:
frontend:
container_name: frontend
profiles: ["core", "full"]
build:
context: ./frontend
dockerfile: Dockerfile.frontend
ports:
- "3000:3000"
volumes:
- ./frontend/agentic-seek-front/src:/app/src
- ./frontend/agentic-seek-front/src:/app/src:rw,z
- ./screenshots:/app/screenshots
environment:
- NODE_ENV=development
- CHOKIDAR_USEPOLLING=true
- BACKEND_URL=http://backend:8000
- REACT_APP_BACKEND_URL=http://0.0.0.0:${BACKEND_PORT:-8000}
networks:
- agentic-seek-net
# NOTE: backend service is not working yet due to issue with chromedriver on docker.
# Therefore backend is run on host machine.
# Open to pull requests to fix this.
#backend:
# container_name: backend
# build:
# context: ./
# dockerfile: Dockerfile.backend
# stdin_open: true
# tty: true
# shm_size: 8g
# ports:
# - "8000:8000"
# volumes:
# - ./:/app
# environment:
# - NODE_ENV=development
# - REDIS_URL=redis://redis:6379/0
# - SEARXNG_URL=http://searxng:8080
# - OLLAMA_URL=http://localhost:11434
# - LM_STUDIO_URL=http://localhost:1234
# extra_hosts:
# - "host.docker.internal:host-gateway"
# depends_on:
# - redis
# - searxng
# networks:
# - agentic-seek-net
backend:
container_name: backend
profiles: ["backend", "full"]
build:
context: .
dockerfile: Dockerfile.backend
ports:
- ${BACKEND_PORT:-7777}:${BACKEND_PORT:-7777}
- ${OLLAMA_PORT:-11434}:${OLLAMA_PORT:-11434}
- ${LM_STUDIO_PORT:-1234}:${LM_STUDIO_PORT:-1234}
- ${CUSTOM_ADDITIONAL_LLM_PORT:-8000}:${CUSTOM_ADDITIONAL_LLM_PORT:-8000}
volumes:
- ./:/app
- ${WORK_DIR:-.}:/opt/workspace
command: python3 api.py
environment:
- SEARXNG_URL=${SEARXNG_BASE_URL:-http://searxng:8080}
- REDIS_URL=${REDIS_BASE_URL:-redis://redis:6379/0}
- WORK_DIR=/opt/workspace
- OPENAI_API_KEY=${OPENAI_API_KEY}
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
- TOGETHER_API_KEY=${TOGETHER_API_KEY}
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- HUGGINGFACE_API_KEY=${HUGGINGFACE_API_KEY}
- DSK_DEEPSEEK_API_KEY=${DSK_DEEPSEEK_API_KEY}
network_mode: "host"
volumes:
redis-data:
+7 -5
View File
@@ -4,6 +4,8 @@ import axios from 'axios';
import './App.css';
import { colors } from './colors';
const BACKEND_URL = process.env.BACKEND_PORT || 'http://0.0.0.0:8000';
function App() {
const [query, setQuery] = useState('');
const [messages, setMessages] = useState([]);
@@ -27,7 +29,7 @@ function App() {
const checkHealth = async () => {
try {
await axios.get('http://127.0.0.1:8000/health');
await axios.get(`${BACKEND_URL}/health`);
setIsOnline(true);
console.log('System is online');
} catch {
@@ -39,7 +41,7 @@ function App() {
const fetchScreenshot = async () => {
try {
const timestamp = new Date().getTime();
const res = await axios.get(`http://127.0.0.1:8000/screenshots/updated_screen.png?timestamp=${timestamp}`, {
const res = await axios.get(`${BACKEND_URL}/screenshots/updated_screen.png?timestamp=${timestamp}`, {
responseType: 'blob'
});
console.log('Screenshot fetched successfully');
@@ -90,7 +92,7 @@ function App() {
const fetchLatestAnswer = async () => {
try {
const res = await axios.get('http://127.0.0.1:8000/latest_answer');
const res = await axios.get(`${BACKEND_URL}/latest_answer`);
const data = res.data;
updateData(data);
@@ -141,7 +143,7 @@ function App() {
setIsLoading(false);
setError(null);
try {
const res = await axios.get('http://127.0.0.1:8000/stop');
const res = await axios.get(`${BACKEND_URL}/stop`);
setStatus("Requesting stop...");
} catch (err) {
console.error('Error stopping the agent:', err);
@@ -162,7 +164,7 @@ function App() {
try {
console.log('Sending query:', query);
setQuery('waiting for response...');
const res = await axios.post('http://127.0.0.1:8000/query', {
const res = await axios.post(`${BACKEND_URL}/query`, {
query,
tts_enabled: false
});
+54
View File
@@ -0,0 +1,54 @@
[project]
name = "agenticseek"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"adaptive-classifier>=0.0.10",
"aiofiles>=24.1.0",
"anyio>=3.5.0,<5",
"celery>=5.5.1",
"certifi==2025.4.26",
"chromedriver-autoinstaller>=0.6.4",
"colorama>=0.4.6",
"distro>=1.7.0,<2",
"fake-useragent>=2.1.0",
"fastapi>=0.115.12",
"flask>=3.1.0",
"httpx>=0.27,<0.29",
"ipython>=8.13.0",
"jiter>=0.4.0,<1",
"kokoro==0.9.4",
"langid>=1.1.6",
"librosa>=0.10.2.post1",
"markdownify>=1.1.0",
"numpy>=1.24.4",
"ollama>=0.4.7",
"openai>=1.84.0",
"ordered-set>=4.1.0",
"playsound3>=1.0.0",
"protobuf>=3.20.3",
"pyaudio>=0.2.14",
"pydantic>=2.10.6",
"pydantic-core>=2.27.2",
"pypdf>=5.4.0",
"pypinyin>=0.54.0",
"python-dotenv>=1.0.0",
"requests>=2.31.0",
"sacremoses>=0.0.53",
"scipy>=1.9.3",
"selenium>=4.27.1",
"selenium-stealth>=1.0.6",
"sentencepiece>=0.2.0",
"setuptools>=75.6.0",
"sniffio>=1.3.1",
"soundfile>=0.13.1",
"termcolor>=2.4.0",
"text2emotion>=0.0.5",
"torch>=2.4.1",
"tqdm>4",
"transformers>=4.46.3",
"undetected-chromedriver>=3.5.5",
"uvicorn>=0.34.0",
]
+2 -2
View File
@@ -13,11 +13,10 @@ requests>=2.31.0
numpy>=1.24.4
colorama>=0.4.6
python-dotenv>=1.0.0
playsound>=1.3.0
playsound3>=1.0.0
soundfile>=0.13.1
transformers>=4.46.3
torch>=2.4.1
python-dotenv>=1.0.0
ollama>=0.4.7
scipy>=1.9.3
soundfile>=0.13.1
@@ -41,6 +40,7 @@ fake_useragent>=2.1.0
selenium_stealth>=1.0.6
undetected-chromedriver>=3.5.5
sentencepiece>=0.2.0
together>=1.5.0
tqdm>4
openai
sniffio
+26 -19
View File
@@ -4,25 +4,18 @@ echo "Starting installation for Linux..."
set -e
if ! command -v python3.10 &> /dev/null; then
echo "Error: Python 3.10 is not installed. Please install Python 3.10 and try again."
echo "You can install it using: sudo apt-get install python3.10 python3.10-dev python3.10-venv"
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo "Error: uv is not installed. Please install uv first."
echo "You can install it using: curl -LsSf https://astral.sh/uv/install.sh | sh"
exit 1
fi
# Check if pip3.10 is available
if ! python3.10 -m pip --version &> /dev/null; then
echo "Error: pip for Python 3.10 is not installed. Installing python3.10-pip..."
sudo apt-get install -y python3.10-pip || { echo "Failed to install python3.10-pip"; exit 1; }
fi
# Update package list
sudo apt-get update || { echo "Failed to update package list"; exit 1; }
# make sure essential tool are installed
sudo apt-get install -y \
python3-dev \
python3-pip \
python3-wheel \
build-essential \
alsa-utils \
portaudio19-dev \
@@ -33,15 +26,29 @@ sudo apt-get install -y \
libnss3 \
libxss1 || { echo "Failed to install packages"; exit 1; }
# Upgrade pip for Python 3.10
python3.10 -m pip install --upgrade pip || { echo "Failed to upgrade pip"; exit 1; }
# Install and upgrade setuptools and wheel
python3.10 -m pip install --upgrade setuptools wheel || { echo "Failed to install setuptools and wheel"; exit 1; }
# Install Selenium for chromedriver
python3.10 -m pip install selenium || { echo "Failed to install selenium"; exit 1; }
# Install Python dependencies from requirements.txt
python3.10 -m pip install -r requirements.txt --no-cache-dir || { echo "Failed to install requirements.txt"; exit 1; }
# Initialize uv project if pyproject.toml doesn't exist
if [ ! -f "pyproject.toml" ]; then
echo "Initializing uv project..."
uv init --python 3.10 || { echo "Failed to initialize uv project"; exit 1; }
fi
# Sync the project (creates venv and installs dependencies)
echo "Setting up Python environment with uv..."
uv sync --python 3.10 || { echo "Failed to sync uv project"; exit 1; }
# Add specific packages
echo "Adding Selenium..."
uv add selenium || { echo "Failed to add selenium"; exit 1; }
# Add dependencies from requirements.txt if it exists
if [ -f "requirements.txt" ]; then
echo "Adding dependencies from requirements.txt..."
uv add -r requirements.txt || { echo "Failed to add requirements from requirements.txt"; exit 1; }
fi
# install docker compose
sudo apt install -y docker-compose
echo "Installation complete for Linux!"
echo "To activate the environment, run: source .venv/bin/activate"
echo "Or run commands with: uv run <command>"
+25 -17
View File
@@ -4,18 +4,13 @@ echo "Starting installation for macOS..."
set -e
if ! command -v python3.10 &> /dev/null; then
echo "Error: Python 3.10 is not installed. Please install Python 3.10 and try again."
echo "You can install it using: sudo apt-get install python3.10 python3.10-dev python3.10-venv"
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo "Error: uv is not installed. Please install uv first."
echo "You can install it using: curl -LsSf https://astral.sh/uv/install.sh | sh"
exit 1
fi
# Check if pip3.10 is available
if ! python3.10 -m pip --version &> /dev/null; then
echo "Error: pip for Python 3.10 is not installed. Installing python3.10-pip..."
sudo apt-get install -y python3.10-pip || { echo "Failed to install python3.10-pip"; exit 1; }
fi
# Check if homebrew is installed
if ! command -v brew &> /dev/null; then
echo "Homebrew not found. Installing Homebrew..."
@@ -31,13 +26,26 @@ brew install --cask chromedriver
# Install portaudio for pyAudio using Homebrew
brew install portaudio
# Upgrade pip for Python 3.10
python3.10 -m pip install --upgrade pip || { echo "Failed to upgrade pip"; exit 1; }
# Install and upgrade setuptools and wheel
python3.10 -m pip install --upgrade setuptools wheel || { echo "Failed to install setuptools and wheel"; exit 1; }
# Install Selenium for chromedriver
python3.10 -m pip install selenium || { echo "Failed to install selenium"; exit 1; }
# Install Python dependencies from requirements.txt
python3.10 -m pip install -r requirements.txt --no-cache-dir || { echo "Failed to install requirements.txt"; exit 1; }
# Initialize uv project if pyproject.toml doesn't exist
if [ ! -f "pyproject.toml" ]; then
echo "Initializing uv project..."
uv init --python 3.10 || { echo "Failed to initialize uv project"; exit 1; }
fi
# Sync the project (creates venv and installs dependencies)
echo "Setting up Python environment with uv..."
uv sync --python 3.10 || { echo "Failed to sync uv project"; exit 1; }
# Add specific packages
echo "Adding Selenium..."
uv add selenium || { echo "Failed to add selenium"; exit 1; }
# Add dependencies from requirements.txt if it exists
if [ -f "requirements.txt" ]; then
echo "Adding dependencies from requirements.txt..."
uv add -r requirements.txt || { echo "Failed to add requirements from requirements.txt"; exit 1; }
fi
echo "Installation complete for macOS!"
echo "To activate the environment, run: source .venv/bin/activate"
echo "Or run commands with: uv run <command>"
+60 -10
View File
@@ -1,17 +1,67 @@
@echo off
echo Starting installation for Windows...
REM Install Python dependencies from requirements.txt
pip install pyreadline3
pip install -r requirements.txt
REM Check if uv is installed
uv --version >nul 2>&1
if %errorlevel% neq 0 (
echo Error: uv is not installed. Please install uv first.
echo You can install it using: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
pause
exit /b 1
)
REM Install Selenium
pip install selenium
REM Initialize uv project if pyproject.toml doesn't exist
if not exist "pyproject.toml" (
echo Initializing uv project...
uv init --python 3.10
if %errorlevel% neq 0 (
echo Failed to initialize uv project
pause
exit /b 1
)
)
REM Sync the project (creates venv and installs dependencies)
echo Setting up Python environment with uv...
uv sync --python 3.10
if %errorlevel% neq 0 (
echo Failed to sync uv project
pause
exit /b 1
)
REM Add specific packages
echo Adding pyreadline3...
uv add pyreadline3
if %errorlevel% neq 0 (
echo Failed to add pyreadline3
pause
exit /b 1
)
echo Adding Selenium...
uv add selenium
if %errorlevel% neq 0 (
echo Failed to add selenium
pause
exit /b 1
)
REM Add dependencies from requirements.txt if it exists
if exist "requirements.txt" (
echo Adding dependencies from requirements.txt...
uv add -r requirements.txt
if %errorlevel% neq 0 (
echo Warning: Some packages from requirements.txt failed to install.
)
)
echo Installation complete for Windows!
echo To activate the environment, run: .venv\Scripts\activate
echo Or run commands with: uv run ^<command^>
echo.
echo Note: pyAudio installation may require additional steps on Windows.
echo Please install portaudio manually (e.g., via vcpkg or prebuilt binaries) and then run: pip install pyaudio
echo Also, download and install chromedriver manually from: https://sites.google.com/chromium.org/driver/getting-started
echo Place chromedriver in a directory included in your PATH.
echo Installation partially complete for Windows. Follow manual steps above.
echo If pyAudio fails to install, please install portaudio manually and try again.
echo Also, chromedriver-autoinstaller should handle chromedriver automatically.
echo If needed, download chromedriver manually from: https://sites.google.com/chromium.org/driver/getting-started
pause
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -5,12 +5,12 @@ gid = searxng
# Number of workers (usually CPU count)
# default value: %k (= number of CPU core, see Dockerfile)
workers = 1
workers = 4
# Number of threads per worker
# default value: 4 (see Dockerfile)
enable-threads = true
threads = 1
enable-threads = 4
threads = 4
# The right granted on the created socket
chmod-socket = 666
+4 -2
View File
@@ -140,8 +140,10 @@ class Agent():
Remove the reasoning block of reasoning model like deepseek.
"""
end_tag = "</think>"
end_idx = text.rfind(end_tag)+8
return text[end_idx:]
end_idx = text.rfind(end_tag)
if end_idx == -1:
return text
return text[end_idx+8:]
def extract_reasoning_text(self, text: str) -> None:
"""
+14 -7
View File
@@ -41,7 +41,7 @@ class BrowserAgent(Agent):
self.memory = Memory(self.load_prompt(prompt_path),
recover_last_session=False, # session recovery in handled by the interaction class
memory_compression=False,
model_provider=provider.get_model_name())
model_provider=provider.get_model_name() if provider else None)
def get_today_date(self) -> str:
"""Get the date"""
@@ -77,14 +77,14 @@ class BrowserAgent(Agent):
def get_unvisited_links(self) -> List[str]:
return "\n".join([f"[{i}] {link}" for i, link in enumerate(self.navigable_links) if link not in self.search_history])
def make_newsearch_prompt(self, user_prompt: str, search_result: dict) -> str:
def make_newsearch_prompt(self, prompt: str, search_result: dict) -> str:
search_choice = self.stringify_search_results(search_result)
self.logger.info(f"Search results: {search_choice}")
return f"""
Based on the search result:
{search_choice}
Your goal is to find accurate and complete information to satisfy the users request.
User request: {user_prompt}
User request: {prompt}
To proceed, choose a relevant link from the search results. Announce your choice by saying: "I will navigate to <link>"
Do not explain your choice.
"""
@@ -235,13 +235,17 @@ class BrowserAgent(Agent):
return links
def select_link(self, links: List[str]) -> str | None:
"""
Select the first unvisited link that is not the current page.
Preference is given to links not in search_history.
"""
for lk in links:
if lk == self.current_page:
self.logger.info(f"Already visited {lk}. Skipping.")
if lk == self.current_page or lk in self.search_history:
self.logger.info(f"Skipping already visited or current link: {lk}")
continue
self.logger.info(f"Selected link: {lk}")
return lk
self.logger.warning("No link selected.")
self.logger.warning("No suitable link selected.")
return None
def get_page_text(self, limit_to_model_ctx = False) -> str:
@@ -396,7 +400,10 @@ class BrowserAgent(Agent):
if (link == None and len(extracted_form) < 3) or Action.GO_BACK.value in answer or link in self.search_history:
pretty_print(f"Going back to results. Still {len(unvisited)}", color="status")
self.status_message = "Going back to search results..."
prompt = self.make_newsearch_prompt(user_prompt, unvisited)
request_prompt = user_prompt
if link is None:
request_prompt += f"\nYou previously choosen:\n{self.last_answer} but the website is unavailable. Consider other options."
prompt = self.make_newsearch_prompt(request_prompt, unvisited)
self.search_history.append(link)
self.current_page = link
continue
+26 -8
View File
@@ -19,6 +19,7 @@ import time
import random
import os
import shutil
import uuid
import tempfile
import markdownify
import sys
@@ -42,7 +43,14 @@ def get_chrome_path() -> str:
paths = ["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta"]
else: # Linux
paths = ["/usr/bin/google-chrome", "/usr/bin/chromium-browser", "/usr/bin/chromium", "/opt/chrome/chrome", "/usr/local/bin/chrome"]
paths = ["/usr/bin/google-chrome",
"/opt/chrome/chrome",
"/usr/bin/chromium-browser",
"/usr/bin/chromium",
"/usr/local/bin/chrome",
"/opt/google/chrome/chrome-headless-shell",
#"/app/chrome_bundle/chrome136/chrome-linux64"
]
for path in paths:
if os.path.exists(path) and os.access(path, os.X_OK):
@@ -75,6 +83,7 @@ def install_chromedriver() -> str:
chromedriver_path = shutil.which("chromedriver")
if not chromedriver_path:
try:
print("ChromeDriver not found, attempting to install automatically...")
chromedriver_path = chromedriver_autoinstaller.install()
except Exception as e:
raise FileNotFoundError(
@@ -120,17 +129,28 @@ def create_driver(headless=False, stealth_mode=True, crx_path="./crx/nopecha.crx
chrome_options.binary_location = chrome_path
if headless:
chrome_options.add_argument("--headless")
#chrome_options.add_argument("--headless")
chrome_options.add_argument("--headless=new")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--disable-webgl")
user_data_dir = tempfile.mkdtemp()
user_agent = get_random_user_agent()
width, height = (1920, 1080)
chrome_options.add_argument(f"--user-data-dir={user_data_dir}")
chrome_options.add_argument(f"--accept-lang={lang}-{lang.upper()},{lang};q=0.9")
chrome_options.add_argument("--timezone=Europe/Paris")
user_data_dir = tempfile.mkdtemp(prefix="chrome_profile_")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument('--disable-dev-shm-usage')
profile_dir = f"/tmp/chrome_profile_{uuid.uuid4().hex[:8]}"
chrome_options.add_argument(f'--user-data-dir={profile_dir}')
chrome_options.add_argument(f"--accept-lang={lang}-{lang.upper()},{lang};q=0.9")
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-background-timer-throttling")
chrome_options.add_argument("--timezone=Europe/Paris")
chrome_options.add_argument('--remote-debugging-port=9222')
chrome_options.add_argument('--disable-background-timer-throttling')
chrome_options.add_argument('--disable-backgrounding-occluded-windows')
chrome_options.add_argument('--disable-renderer-backgrounding')
chrome_options.add_argument('--disable-features=TranslateUI')
chrome_options.add_argument('--disable-ipc-flooding-protection')
chrome_options.add_argument("--mute-audio")
chrome_options.add_argument("--disable-notifications")
chrome_options.add_argument("--autoplay-policy=user-gesture-required")
@@ -698,8 +718,6 @@ if __name__ == "__main__":
input("press enter to continue")
print("AntiCaptcha / Form Test")
browser.go_to("https://www.google.com/recaptcha/api2/demo")
time.sleep(50)
browser.go_to("https://bot.sannysoft.com")
time.sleep(5)
#txt = browser.get_text()
+3 -43
View File
@@ -1,8 +1,6 @@
from typing import List, Tuple, Type, Dict
import re
import langid
import nltk
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from transformers import MarianMTModel, MarianTokenizer
from sources.utility import pretty_print, animate_thinking
@@ -16,7 +14,6 @@ class LanguageUtility:
args:
supported_language: list of languages for translation, determine which Helsinki-NLP model to load
"""
self.sid = None
self.translators_tokenizer = None
self.translators_model = None
self.logger = Logger("language.log")
@@ -25,11 +22,6 @@ class LanguageUtility:
def load_model(self) -> None:
animate_thinking("Loading language utility...", color="status")
try:
nltk.data.find('vader_lexicon')
except LookupError:
nltk.download('vader_lexicon')
self.sid = SentimentIntensityAnalyzer()
self.translators_tokenizer = {lang: MarianTokenizer.from_pretrained(f"Helsinki-NLP/opus-mt-{lang}-en") for lang in self.supported_language if lang != "en"}
self.translators_model = {lang: MarianMTModel.from_pretrained(f"Helsinki-NLP/opus-mt-{lang}-en") for lang in self.supported_language if lang != "en"}
@@ -65,49 +57,17 @@ class LanguageUtility:
translation = model.generate(**inputs)
return tokenizer.decode(translation[0], skip_special_tokens=True)
def detect_emotion(self, text: str) -> str:
"""
Detect the dominant emotion in the given text
Args:
text: string to analyze
Returns: string of the dominant emotion
"""
try:
scores = self.sid.polarity_scores(text)
emotions = {
'Happy': max(scores['pos'], 0),
'Angry': 0,
'Sad': max(scores['neg'], 0),
'Fear': 0,
'Surprise': 0
}
if scores['compound'] < -0.5:
emotions['Angry'] = abs(scores['compound']) * 0.5
emotions['Fear'] = abs(scores['compound']) * 0.5
elif scores['compound'] > 0.5:
emotions['Happy'] = scores['compound']
emotions['Surprise'] = scores['compound'] * 0.5
dominant_emotion = max(emotions, key=emotions.get)
if emotions[dominant_emotion] == 0:
return 'Neutral'
self.logger.info(f"Emotion: {dominant_emotion} for text: {text}")
return dominant_emotion
except Exception as e:
raise e
def analyze(self, text):
"""
Combined analysis of language and emotion
Args:
text: string to analyze
Returns: dictionary with language and emotion results
Returns: dictionary with language related information
"""
try:
language = self.detect_language(text)
emotions = self.detect_emotion(text)
return {
"language": language,
"emotions": emotions
"language": language
}
except Exception as e:
raise e
@@ -125,4 +85,4 @@ if __name__ == "__main__":
pretty_print(f"Language: {detector.detect_language(text)}", color="status")
result = detector.analyze(text)
trans = detector.translate(text, result['language'])
pretty_print(f"Translation: {trans} - from: {result['language']} - Emotion: {result['emotions']}")
pretty_print(f"Translation: {trans} - from: {result['language']}")
+32 -33
View File
@@ -14,7 +14,6 @@ from openai import OpenAI
from sources.logger import Logger
from sources.utility import pretty_print, animate_thinking
class Provider:
def __init__(self, provider_name, model, server_address="127.0.0.1:5000", is_local=False):
self.provider_name = provider_name.lower()
@@ -58,38 +57,6 @@ class Provider:
exit(1)
return api_key
def anthropic_fn(self, history, verbose=False):
"""
Use Anthropic to generate text.
"""
from anthropic import Anthropic
client = Anthropic(api_key=self.api_key)
system_message = None
messages = []
for message in history:
clean_message = {'role': message['role'], 'content': message['content']}
if message['role'] == 'system':
system_message = message['content']
else:
messages.append(clean_message)
try:
response = client.messages.create(
model=self.model,
max_tokens=1024,
messages=messages,
system=system_message
)
if response is None:
raise Exception("Anthropic response is empty.")
thought = response.content[0].text
if verbose:
print(thought)
return thought
except Exception as e:
raise Exception(f"Anthropic API error: {str(e)}") from e
def respond(self, history, verbose=True):
"""
Use the choosen provider to generate text.
@@ -255,6 +222,38 @@ class Provider:
except Exception as e:
raise Exception(f"OpenAI API error: {str(e)}") from e
def anthropic_fn(self, history, verbose=False):
"""
Use Anthropic to generate text.
"""
from anthropic import Anthropic
client = Anthropic(api_key=self.api_key)
system_message = None
messages = []
for message in history:
clean_message = {'role': message['role'], 'content': message['content']}
if message['role'] == 'system':
system_message = message['content']
else:
messages.append(clean_message)
try:
response = client.messages.create(
model=self.model,
max_tokens=1024,
messages=messages,
system=system_message
)
if response is None:
raise Exception("Anthropic response is empty.")
thought = response.content[0].text
if verbose:
print(thought)
return thought
except Exception as e:
raise Exception(f"Anthropic API error: {str(e)}") from e
def google_fn(self, history, verbose=False):
"""
Use google gemini to generate text.
+38 -6
View File
@@ -3,11 +3,18 @@ from typing import List, Tuple, Type, Dict
import queue
import threading
import numpy as np
import torch
import time
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
import librosa
import pyaudio
IMPORT_FOUND = True
try:
import torch
import librosa
import pyaudio
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
except ImportError:
print(Fore.RED + "Speech To Text disabled." + Fore.RESET)
IMPORT_FOUND = False
audio_queue = queue.Queue()
done = False
@@ -23,13 +30,18 @@ class AudioRecorder:
self.chunk = chunk
self.record_seconds = record_seconds
self.verbose = verbose
self.audio = pyaudio.PyAudio()
self.thread = threading.Thread(target=self._record, daemon=True)
self.thread = None
self.audio = None
if IMPORT_FOUND:
self.audio = pyaudio.PyAudio()
self.thread = threading.Thread(target=self._record, daemon=True)
def _record(self) -> None:
"""
Record audio from the microphone and add it to the audio queue.
"""
if not IMPORT_FOUND:
return
stream = self.audio.open(format=self.format, channels=self.channels, rate=self.rate,
input=True, frames_per_buffer=self.chunk)
if self.verbose:
@@ -58,10 +70,14 @@ class AudioRecorder:
def start(self) -> None:
"""Start the recording thread."""
if not IMPORT_FOUND:
return
self.thread.start()
def join(self) -> None:
"""Wait for the recording thread to finish."""
if not IMPORT_FOUND:
return
self.thread.join()
class Transcript:
@@ -69,6 +85,9 @@ class Transcript:
Transcript is a class that transcribes audio from the audio queue and adds it to the transcript.
"""
def __init__(self):
if not IMPORT_FOUND:
print(Fore.RED + "Transcript: Speech to Text is disabled." + Fore.RESET)
return
self.last_read = None
device = self.get_device()
torch_dtype = torch.float16 if device == "cuda" else torch.float32
@@ -91,6 +110,8 @@ class Transcript:
)
def get_device(self) -> str:
if not IMPORT_FOUND:
return "cpu"
if torch.backends.mps.is_available():
return "mps"
if torch.cuda.is_available():
@@ -108,6 +129,8 @@ class Transcript:
def transcript_job(self, audio_data: np.ndarray, sample_rate: int = 16000) -> str:
"""Transcribe the audio data."""
if not IMPORT_FOUND:
return ""
if audio_data.dtype != np.float32:
audio_data = audio_data.astype(np.float32) / np.iinfo(audio_data.dtype).max
if len(audio_data.shape) > 1:
@@ -122,6 +145,9 @@ class AudioTranscriber:
AudioTranscriber is a class that transcribes audio from the audio queue and adds it to the transcript.
"""
def __init__(self, ai_name: str, verbose: bool = False):
if not IMPORT_FOUND:
print(Fore.RED + "AudioTranscriber: Speech to Text is disabled." + Fore.RESET)
return
self.verbose = verbose
self.ai_name = ai_name
self.transcriptor = Transcript()
@@ -152,6 +178,8 @@ class AudioTranscriber:
"""
Transcribe the audio data using AI stt model.
"""
if not IMPORT_FOUND:
return
global done
if self.verbose:
print(Fore.BLUE + "AudioTranscriber: Started processing..." + Fore.RESET)
@@ -185,9 +213,13 @@ class AudioTranscriber:
def start(self):
"""Start the transcription thread."""
if not IMPORT_FOUND:
return
self.thread.start()
def join(self):
if not IMPORT_FOUND:
return
"""Wait for the transcription thread to finish."""
self.thread.join()
+11 -5
View File
@@ -5,9 +5,14 @@ import subprocess
from sys import modules
from typing import List, Tuple, Type, Dict
from kokoro import KPipeline
from IPython.display import display, Audio
import soundfile as sf
IMPORT_FOUND = True
try:
from kokoro import KPipeline
from IPython.display import display, Audio
import soundfile as sf
except ImportError:
print("Speech synthesis disabled. Please install the kokoro package.")
IMPORT_FOUND = False
if __name__ == "__main__":
from utility import pretty_print, animate_thinking
@@ -33,7 +38,7 @@ class Speech():
}
self.pipeline = None
self.language = language
if enable:
if enable and IMPORT_FOUND:
self.pipeline = KPipeline(lang_code=self.lang_map[language])
self.voice = self.voice_map[language][voice_idx]
self.speed = 1.2
@@ -57,7 +62,7 @@ class Speech():
sentence (str): The text to convert to speech. Will be pre-processed.
voice_idx (int, optional): Index of the voice to use from the voice map.
"""
if not self.pipeline:
if not self.pipeline or not IMPORT_FOUND:
return
if voice_idx >= len(self.voice_map[self.language]):
pretty_print("Invalid voice number, using default voice", color="error")
@@ -159,6 +164,7 @@ class Speech():
if __name__ == "__main__":
# TODO add info message for cn2an, jieba chinese related import
IMPORT_FOUND = False
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
speech = Speech()
tosay_en = """
+12 -17
View File
@@ -50,19 +50,15 @@ class Tools():
def set_allow_language_exec_bash(value: bool) -> None:
self.allow_language_exec_bash = value
def check_config_dir_validity(self):
"""Check if the config directory is valid."""
path = self.config['MAIN']['work_dir']
if path == "":
print("WARNING: Work directory not set in config.ini")
return False
if path.lower() == "none":
print("WARNING: Work directory set to none in config.ini")
return False
if not os.path.exists(path):
print(f"WARNING: Work directory {path} does not exist")
return False
return True
def safe_get_work_dir_path(self):
path = None
path = os.getenv('WORK_DIR', path)
if path is None or path == "":
path = self.config['MAIN']['work_dir'] if 'MAIN' in self.config and 'work_dir' in self.config['MAIN'] else None
if path is None or path == "":
print("No work directory specified, using default.")
path = self.create_work_dir()
return path
def config_exists(self):
"""Check if the config file exists."""
@@ -73,11 +69,10 @@ class Tools():
default_path = os.path.dirname(os.getcwd())
if self.config_exists():
self.config.read('./config.ini')
config_path = self.config['MAIN']['work_dir']
dir_path = default_path if not self.check_config_dir_validity() else config_path
workdir_path = self.safe_get_work_dir_path()
else:
dir_path = default_path
return dir_path
workdir_path = default_path
return workdir_path
@abstractmethod
def execute(self, blocks:[str], safety:bool) -> str:
+31 -6
View File
@@ -1,10 +1,35 @@
@echo off
docker-compose up
if %ERRORLEVEL% neq 0 (
echo Error: Failed to start containers. Check Docker logs with 'docker compose logs'.
echo Possible fixes: Ensure Docker Desktop is running or check if port 8080 is free.
exit /b 1
if "%1"=="full" (
echo Starting full deployment...
) else (
echo Starting partial deployment... (backend run on host), use "full" to run all services in containers
)
timeout /t 10 /nobreak >nul
where openssl >nul 2>&1
if %ERRORLEVEL% == 0 (
for /f %%i in ('openssl rand -hex 32') do set SEARXNG_SECRET_KEY=%%i
) else (
where python3 >nul 2>&1
if %ERRORLEVEL% == 0 (
for /f %%i in ('python3 -c "import secrets; print(secrets.token_hex(32))"') do set SEARXNG_SECRET_KEY=%%i
) else (
echo Error: Neither openssl nor python is available to generate a secret key.
exit /b 1
)
)
REM Stop all containers
echo Stopping containers...
docker stop $(docker ps -aq) >nul 2>&1
REM Generate secret key
for /f %%i in ('powershell -command "[System.Web.Security.Membership]::GeneratePassword(64,0)"') do set SEARXNG_SECRET_KEY=%%i
if "%1"=="full" (
docker compose up -d backend
timeout /t 5 /nobreak >nul
docker compose --profile full up
) else (
docker compose --profile core up
)
+73 -8
View File
@@ -1,12 +1,35 @@
#!/bin/bash
source .env
command_exists() {
command -v "$1" &> /dev/null
}
if [ -z "$WORK_DIR" ]; then
echo "Error: WORK_DIR environment variable is not set. Please set it in your .env file."
exit 1
fi
#
# Check if Docker is installed é running
#
if [[ "$OSTYPE" == "darwin"* ]]; then
dir_size_bytes=$(du -s -b "$WORK_DIR" 2>/dev/null | awk '{print $1}')
else
dir_size_bytes=$(du -s --bytes "$WORK_DIR" 2>/dev/null | awk '{print $1}')
fi
max_size_bytes=$((2 * 1024 * 1024 * 1024))
echo "Mounting $WORK_DIR ($dir_size_bytes bytes) to docker."
if [ "$dir_size_bytes" -gt "$max_size_bytes" ]; then
echo "Error: WORK_DIR ($WORK_DIR) contains more than 2GB of data ($(du -sh "$WORK_DIR" 2>/dev/null | awk '{print $1}'))."
exit 1
fi
if [ "$1" = "full" ]; then
echo "Starting full deployment with backend and all services..."
else
echo "Starting core deployment with frontend and search services only... use ./start_services.sh full to start backend as well"
fi
if ! command_exists docker; then
echo "Error: Docker is not installed. Please install Docker first."
@@ -60,15 +83,57 @@ if [ ! -f "docker-compose.yml" ]; then
exit 1
fi
# start docker compose for searxng, redis, frontend services
# Stop all running containers to ensure a clean state
echo "Warning: stopping all docker containers (t-4 seconds)..."
sleep 4
docker stop $(docker ps -a -q)
echo "All containers stopped"
if ! $COMPOSE_CMD up; then
echo "Error: Failed to start containers. Check Docker logs with '$COMPOSE_CMD logs'."
echo "Possible fixes: Run with sudo or ensure port 8080 is free."
exit 1
# export searxng secret key (cross-platform)
if command -v openssl &> /dev/null; then
export SEARXNG_SECRET_KEY=$(openssl rand -hex 32)
else
# Fallback: use Python if openssl is not available
if command -v python3 &> /dev/null; then
export SEARXNG_SECRET_KEY=$(python3 -c "import secrets; print(secrets.token_hex(32))")
else
echo "Error: Neither openssl nor python is available to generate a secret key."
exit 1
fi
fi
if [ "$1" = "full" ]; then
# First start backend and wait for it to be healthy
echo "Full docker deployement. Starting backend service..."
if ! $COMPOSE_CMD up -d backend; then
echo "Error: Failed to start backend container."
exit 1
fi
# Wait for backend to be healthy (check if it's running and not restarting)
echo "Waiting for backend to be ready..."
for i in {1..30}; do
if [ "$(docker inspect -f '{{.State.Running}}' backend)" = "true" ] && \
[ "$(docker inspect -f '{{.State.Restarting}}' backend)" = "false" ]; then
echo "backend is ready!"
break
fi
if [ $i -eq 30 ]; then
echo "Error: backend failed to start properly after 30 seconds"
$COMPOSE_CMD logs backend
exit 1
fi
sleep 1
done
if ! $COMPOSE_CMD --profile full up; then
echo "Error: Failed to start containers. Check Docker logs with '$COMPOSE_CMD logs'."
echo "Possible fixes: Run with sudo or ensure port 8080 is free."
exit 1
fi
else
if ! $COMPOSE_CMD --profile core up; then
echo "Error: Failed to start containers. Check Docker logs with '$COMPOSE_CMD logs'."
echo "Possible fixes: Run with sudo or ensure port 8080 is free."
exit 1
fi
fi
sleep 10
+1 -1
View File
@@ -23,7 +23,7 @@ class TestBrowserAgentParsing(unittest.TestCase):
"https://thriveonai.com/15-ai-startups-in-japan-to-take-note-of",
"www.google.com",
"https://test.org/about?page=1",
"https://weatherstack.com/documentation",
"https://weatherstack.com/documentation"
]
result = self.agent.extract_links(test_text)
self.assertEqual(result, expected)
+230
View File
@@ -0,0 +1,230 @@
import unittest
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from sources.tools.tools import Tools
class TestToolsParsing(unittest.TestCase):
"""
Test suite for the Tools class parsing functionality, specifically the load_exec_block method.
This method is responsible for extracting code blocks from LLM-generated text.
"""
def setUp(self):
"""Set up test fixtures before each test method."""
class TestTool(Tools):
def execute(self, blocks, safety=False):
return "test execution"
def execution_failure_check(self, output):
return False
def interpreter_feedback(self, output):
return "test feedback"
self.tool = TestTool()
self.tool.tag = "python" # Set tag for testing
def test_load_exec_block_single_block(self):
"""Test parsing a single code block from LLM text."""
llm_text = """Here's some Python code:
```python
print("Hello, World!")
x = 42
```
That's the code."""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNotNone(blocks)
self.assertEqual(len(blocks), 1)
self.assertEqual(blocks[0], '\nprint("Hello, World!")\nx = 42\n')
self.assertIsNone(save_path)
def test_load_exec_block_multiple_blocks(self):
"""Test parsing multiple code blocks from LLM text."""
llm_text = """First block:
```python
import os
print("First block")
```
Second block:
```python
import sys
print("Second block")
```
Done."""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNotNone(blocks)
self.assertEqual(len(blocks), 2)
self.assertEqual(blocks[0], '\nimport os\nprint("First block")\n')
self.assertEqual(blocks[1], '\nimport sys\nprint("Second block")\n')
self.assertIsNone(save_path)
def test_load_exec_block_with_save_path(self):
"""Test parsing code block with save path specification."""
llm_text = """```python
save_path: test_file.py
import os
print("Hello with save path")
```"""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNotNone(blocks)
self.assertEqual(len(blocks), 1)
self.assertEqual(blocks[0], '\nsave_path: test_file.py\nimport os\nprint("Hello with save path")\n')
self.assertIsNone(save_path)
def test_load_exec_block_with_indentation(self):
"""Test parsing code blocks with leading whitespace/indentation."""
llm_text = """ Here's indented code:
```python
def hello():
print("Hello")
return True
```
End of code."""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNotNone(blocks)
self.assertEqual(len(blocks), 1)
expected_code = '\ndef hello():\n print("Hello")\n return True\n'
self.assertEqual(blocks[0], expected_code)
def test_load_exec_block_no_blocks(self):
"""Test parsing text with no code blocks."""
llm_text = """This is just regular text with no code blocks.
There are no python blocks here.
Just plain text."""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNone(blocks)
self.assertIsNone(save_path)
def test_load_exec_block_wrong_tag(self):
"""Test parsing text with code blocks but wrong language tag."""
llm_text = """```javascript
console.log("This is JavaScript, not Python");
```"""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNone(blocks)
self.assertIsNone(save_path)
def test_load_exec_block_incomplete_block(self):
"""Test parsing text with incomplete code block (missing closing tag)."""
llm_text = """```python
print("This block has no closing tag")
x = 42"""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertEqual(blocks, [])
self.assertIsNone(save_path)
def test_load_exec_block_empty_block(self):
"""Test parsing empty code block."""
llm_text = """```python
```"""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNotNone(blocks)
self.assertEqual(len(blocks), 1)
self.assertEqual(blocks[0], '\n')
def test_load_exec_block_mixed_content(self):
"""Test parsing text with mixed content including code blocks."""
llm_text = """Let me help you with that task.
First, I'll import the necessary modules:
```python
import os
import sys
```
Then I'll define a function:
```python
def process_data(data):
return data.upper()
```
Finally, let's use it:
```python
result = process_data("hello world")
print(result)
```
That should work!"""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNotNone(blocks)
self.assertEqual(len(blocks), 3)
self.assertEqual(blocks[0], '\nimport os\nimport sys\n')
self.assertEqual(blocks[1], '\ndef process_data(data):\n return data.upper()\n')
self.assertEqual(blocks[2], '\nresult = process_data("hello world")\nprint(result)\n')
def test_load_exec_block_with_special_characters(self):
"""Test parsing code blocks containing special characters."""
llm_text = """```python
text = "Hello \"world\" with 'quotes'"
regex = r"^\\d+$"
path = "C:\\Users\\test\\file.txt"
```"""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertIsNotNone(blocks)
self.assertEqual(len(blocks), 1)
expected = '\ntext = "Hello "world" with \'quotes\'"\nregex = r"^\\d+$"\npath = "C:\\Users\\test\\file.txt"\n'
self.assertEqual(blocks[0], expected)
def test_load_exec_block_tag_undefined(self):
"""Test that assertion error is raised when tag is undefined."""
self.tool.tag = "undefined"
llm_text = """```python
print("test")
```"""
with self.assertRaises(AssertionError):
self.tool.load_exec_block(llm_text)
def test_found_executable_blocks_flag(self):
"""Test that the executable blocks found flag is set correctly."""
self.assertFalse(self.tool.found_executable_blocks())
llm_text = """```python
print("test")
```"""
blocks, save_path = self.tool.load_exec_block(llm_text)
self.assertTrue(self.tool.found_executable_blocks())
self.assertFalse(self.tool.found_executable_blocks())
def test_get_parameter_value(self):
"""Test the get_parameter_value helper method."""
block = """param1 = value1
param2 = value2
some other text
param3 = value3"""
self.assertEqual(self.tool.get_parameter_value(block, "param1"), "value1")
self.assertEqual(self.tool.get_parameter_value(block, "param2"), "value2")
self.assertEqual(self.tool.get_parameter_value(block, "param3"), "value3")
self.assertIsNone(self.tool.get_parameter_value(block, "nonexistent"))
if __name__ == '__main__':
unittest.main()
Generated
+3649
View File
File diff suppressed because it is too large Load Diff