diff --git a/.gitignore b/.gitignore index 337477f..8f1103c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # customize your .gitignore as needed nanobot-config/workspace/sessions/* +MCP/mars-mcp/chromadb # ---> Python # Byte-compiled / optimized / DLL files diff --git a/Dockerfile b/Dockerfile index f21e0e7..9a1c70f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,16 @@ FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim -ENV PATH="/root/.local/bin:${PATH}" +ENV PATH="/usr/local/bin:${PATH}" -# Install nanobot from PyPI via uv tool. -RUN uv tool install --upgrade nanobot-ai -i https://pypi.tuna.tsinghua.edu.cn/simple +# Install nanobot into the system Python so channel plugins can share the same environment. +RUN uv pip install --system --upgrade nanobot-ai -i https://pypi.tuna.tsinghua.edu.cn/simple # Persist nanobot config/workspace here via volume mount. -RUN mkdir -p /root/.nanobot /opt/mcp +RUN mkdir -p /root/.nanobot /opt/mcp /opt/plugins + +# Preinstall local channel plugin into the same env as nanobot (entry point discovery). +COPY nanobot-channel-web /opt/plugins/nanobot-channel-web +RUN uv pip install --system /opt/plugins/nanobot-channel-web -i https://pypi.tuna.tsinghua.edu.cn/simple # Preinstall local MCP project dependencies into the image. COPY MCP /opt/mcp @@ -14,7 +18,7 @@ RUN uv pip install --system -e /opt/mcp/mars-mcp -e /opt/mcp/map-mcp -i https:// WORKDIR /workspace -EXPOSE 18790 +EXPOSE 18790 8005 9000 ENTRYPOINT ["nanobot"] CMD ["status"] diff --git a/MCP/mars-mcp/server.py b/MCP/mars-mcp/server.py index e3525bc..c1270b7 100644 --- a/MCP/mars-mcp/server.py +++ b/MCP/mars-mcp/server.py @@ -27,12 +27,12 @@ DATACUBE_API_URL = os.getenv( ) EMBEDDING_API_URL = os.getenv( "EMBEDDING_API_URL", - "http://192.168.190.42:11434/api/embeddings" + "http://192.168.190.62:11434/api/embeddings" ) EMBEDDING_MODEL = os.getenv("EMBEDDING_MODEL", "qwen3-embedding:8b-fp16") CHROMADB_PATH = os.getenv( "CHROMADB_PATH", - str(Path("~/studio/mars-data-serv-llm/data/chromadb").expanduser()) + str(Path("/opt/mcp/mars-mcp/chromadb").expanduser()) ) logging.basicConfig(level=logging.WARNING) diff --git a/README.md b/README.md index cb25508..180cf50 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,5 @@ mars-nanobot配置文件。 ```bash sudo docker compose build -docker compose up -d nanobot-gateway +sudo docker compose up -d nanobot-gateway ``` diff --git a/docker-compose.yml b/docker-compose.yml index f80c653..9250ae4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,7 @@ services: ports: - "18790:18790" - "8005:8005" + - "8009:9000" nanobot-cli: build: diff --git a/nanobot-config/config.json b/nanobot-config/config.json index c1e89ab..035417e 100644 --- a/nanobot-config/config.json +++ b/nanobot-config/config.json @@ -126,7 +126,7 @@ ] }, "web": { - "enabled": false, + "enabled": true, "host": "0.0.0.0", "port": 9000, "allowFrom": [ diff --git a/nanobot-config/workspace/SOUL.md b/nanobot-config/workspace/SOUL.md index 152495d..01c254f 100644 --- a/nanobot-config/workspace/SOUL.md +++ b/nanobot-config/workspace/SOUL.md @@ -1,6 +1,6 @@ # Soul -I am nanobot 🐈, a **Mars Digital Assistant** (火星数字助手). +I am a **Mars Digital Assistant** (火星数字助手). ## Identity diff --git a/nanobot-config/workspace/TOOLS.md b/nanobot-config/workspace/TOOLS.md index 51c3a2d..23fdd7e 100644 --- a/nanobot-config/workspace/TOOLS.md +++ b/nanobot-config/workspace/TOOLS.md @@ -13,3 +13,18 @@ This file documents non-obvious constraints and usage patterns. ## cron — Scheduled Reminders - Please refer to cron skill for usage. + +## Web Search Tool Priority + +When web search is required, follow this priority order: + +1. **First Choice: `multi-search-engine-2-0-1` skill** + - Installed at: `skills/multi-search-engine-2-0-1/` + - 17 search engines (8 CN + 9 Global) + - No API key required + - Supports: advanced search operators, time filters, site search, privacy engines, WolframAlpha + +2. **Second Choice: Web Search Prime MCP** (`mcp_web-search-prime_*`) + - Provided by Zhipu AI + - Requires API key (configured in config.json) + - Use only if multi-search-engine is not available diff --git a/nanobot-config/workspace/memory/MEMORY.md b/nanobot-config/workspace/memory/MEMORY.md index 5a658da..c1e510c 100644 --- a/nanobot-config/workspace/memory/MEMORY.md +++ b/nanobot-config/workspace/memory/MEMORY.md @@ -22,7 +22,6 @@ This file stores important information that should persist across sessions. - Prefers detailed geological analysis and feature descriptions - Interested in scientific value and geological evolution of Martian features - Natural language interaction style for all operations -- **When web search is needed, prioritize using multi-search-engine skill** (17 engines including Baidu, Google, DuckDuckGo, WolframAlpha, etc.) ## Project Context @@ -46,6 +45,14 @@ This file stores important information that should persist across sessions. - `map_get_drawn_geometry` - Get hand-drawn geometry - **Note**: No layer switching capability available +### Web Search Priority +- **优先使用**: `multi-search-engine-2-0-1` skill(已安装) + - 集成17个搜索引擎(8个中文 + 9个全球) + - 无需API密钥 + - 支持高级搜索操作符、时间过滤、站内搜索、隐私搜索引擎、WolframAlpha知识查询 + - 安装位置: C:\Users\islon\.nanobot\workspace\skills\multi-search-engine-2-0-1 +- **次选**: Web Search Prime MCP(智谱提供,需要API密钥) + ### Data Sources - **Tianwen-1 MoRIC imagery** (`tianwen_moric`): High-resolution Mars imagery from Chinese Tianwen-1 mission