模块化AI助手 是 AI Skill Hub 本期精选AI工具之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
模块化AI助手 是一款基于 Python 开发的开源工具,专注于 ai、assistant、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
模块化AI助手 是一款基于 Python 开发的开源工具,专注于 ai、assistant、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install cogtrix
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install cogtrix
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/NorthlandPositronics/Cogtrix
cd Cogtrix
pip install -e .
# 验证安装
python -c "import cogtrix; print('安装成功')"
# 命令行使用
cogtrix --help
# 基本用法
cogtrix input_file -o output_file
# Python 代码中调用
import cogtrix
# 示例
result = cogtrix.process("input")
print(result)
# cogtrix 配置文件示例(config.yml) app: name: "cogtrix" debug: false log_level: "INFO" # 运行时指定配置文件 cogtrix --config config.yml # 或通过环境变量配置 export COGTRIX_API_KEY="your-key" export COGTRIX_OUTPUT_DIR="./output"
An AI agent that lives on your laptop. Talk to a local LLM, give it tools, let it do real work — read your files, search the web, write code, run shell commands, ping Slack. No API key required to start. Bring your own when you want to plug in GPT‑4, Claude, Gemini, or DeepSeek.
You> Find the five most-cited deep-learning papers from arXiv in 2025,
summarize each in two sentences, and save the list to papers.md.
Cogtrix> web_search("most cited arxiv deep learning papers 2025")
http_get("https://arxiv.org/abs/2501.…")
http_get("https://arxiv.org/abs/2502.…")
http_get("https://arxiv.org/abs/2503.…")
write_file("papers.md", "# Top arXiv DL papers 2025\n…")
Done. 5 papers summarized — see papers.md.
That's one prompt, six tool calls, one file on disk. Cogtrix chained them on its own.
---
| Capability | How Cogtrix does it |
|---|---|
| **Local-first** | Default backend is Ollama. Works offline, no telemetry, no rate limits. |
| **Multi-provider** | Ollama, OpenAI, Anthropic, Gemini, DeepSeek, plus any OpenAI-compatible endpoint. Switch with /model. |
| **67 built-in tools** | Files, Git, GitHub, shell, Python, HTTP, search (7 providers), text/NLP, math, scheduling, RAG, messaging — full list in [Tools Reference](docs/TOOLS_REFERENCE.md). |
| **Three memory modes** | conversation for chat, code for programming (tracks files + errors), reasoning for planning (tracks goals + decisions). All modes do hybrid memory — rolling summary plus semantic recall. |
| **Tool safety** | Sensitive tools (shell, write, patch) ask for confirmation. -y to auto-approve in trusted contexts. |
| **MCP support** | Connect to any Model Context Protocol server — Anthropic's MCP ecosystem works out of the box. |
| **Workflows** | Bundle a system prompt, knowledge base, and tool policy into a reusable named workflow with auto-detection. |
| **Headless mode** | Run as a WhatsApp or Telegram daemon (see below). |
| **REST + WebSocket API** | 159 endpoints, 2 WebSocket streams — drives the React web UI and any custom integration. |
---
docker pull ghcr.io/northlandpositronics/cogtrix:latest
docker run -it --network host ghcr.io/northlandpositronics/cogtrix:latest
The image bundles every optional package (Anthropic, Google, MCP, all search providers, NumPy/SciPy). --network host lets it reach a local Ollama. Mount your config (-v "$HOME/.cogtrix.yaml:/app/.cogtrix.yaml:ro") and persist sessions (-v cogtrix-data:/data). Append api to the docker command to launch the REST/WS server instead of the interactive CLI.
---
Cogtrix runs with zero config when Ollama is on localhost. For anything more, drop a YAML file in .cogtrix.yaml (project) or ~/.cogtrix.yaml (global):
providers:
my-server:
type: ollama
base_url: "http://192.168.1.100:11434"
openai:
type: openai
models:
default: local
local: # everyday work — local qwen3 on a home GPU
provider: my-server
model: qwen3:8b
fast: my-server/qwen3:8b # same model, shorthand alias form
smart: openai/gpt-4.1 # heavy reasoning, e.g. /think and /delegate
services:
tavily:
api_key: "tvly-..." # cleaner results than DuckDuckGo at low volume
JSON works too (.cogtrix.json). Settings are resolved highest priority first: CLI flags → environment variables → config file → built-in defaults.
Full reference: Configuration Guide.
---
uv pip install "cogtrix[anthropic]" # Anthropic Claude
uv pip install "cogtrix[google]" # Google Gemini
uv pip install "cogtrix[api]" # REST API server + Stripe billing
uv pip install "cogtrix[mcp]" # MCP server support
uv pip install "cogtrix[search]" # Tavily, Exa, Brave, SerpAPI
uv pip install "cogtrix[rag]" # RAG (needs C++ build tools)
uv pip install "cogtrix[saml]" # SAML 2.0 SSO (needs libxmlsec1-dev on Linux)
uv pip install "cogtrix[ldap]" # LDAP / Active Directory sync
---
Cogtrix ships a FastAPI server that exposes 159 REST endpoints across 27 route groups plus 2 WebSocket streams. It's the same API the React web frontend uses.
```bash export COGTRIX_JWT_SECRET="$(python -c 'import secrets; print(secrets.token_hex(32))')" python -m src.api
```
Interactive docs at http://localhost:8000/api/v1/docs (Swagger) and /api/v1/redoc.
Auth: JWT bearer tokens (Authorization: Bearer <token>). First registered user gets the admin role automatically. API keys (prefix cgx_live_) can be created and managed via /api/v1/auth/api-keys and are accepted in the same Authorization: Bearer header — the request-auth dependency dispatches on prefix.
WebSockets: The session stream (/ws/v1/sessions/{id}) requires the JWT in the Authorization header; the ?token=<jwt> query-parameter fallback was removed for security (#1128). The admin log stream (/ws/v1/logs) still accepts ?token=<jwt> for clients that can't set custom WS headers.
Route map by group:
| Group | Count | Notes |
|---|---|---|
auth/* | 9 | Register, login, refresh, logout, logout-all, profile, API key CRUD |
agents/* | 2 | List & get named agents |
sessions/* | 6 | Create/list/get/update/delete sessions |
sessions/{id}/messages/* | 3 | Send, list history, clear history |
sessions/{id}/memory/* | 3 | Get state, switch mode, clear |
sessions/{id}/tools/* | 4 | List, load, enable, disable |
config/* | 15 | Read/write config, providers, models, setup wizard |
assistant/* | 24 | Start/stop, channels, phonebook, outbound, campaigns |
assistant/workflows/* | 11 | Workflow CRUD, documents, chat bindings |
tasks/* | 5 | Background-task queue with log stream |
users/* | 5 | User management (admin) |
rag/* | 5 | RAG document & query CRUD |
mcp/* | 5 | MCP server connections |
admin/* | 7 | Org list, global stats, usage metrics, impersonation, audit log |
system/* | 2 | Server info, shutdown |
health | 3 | Liveness, readiness, full-readiness |
metrics | 1 | Prometheus scrape endpoint |
organizations/* | 1 | Update org-member role (other org CRUD lives in admin/*) |
teams/* | 8 | Team management, membership |
workspaces/* | 10 | Workspace CRUD, membership, scoped config |
plans/* | 6 | Plan CRUD + /org-plans/{id} assignment |
usage/* | 3 | Usage summary, per-event records, manual record |
enforcement/* | 1 | Plan limit snapshot and headroom |
saml/* | 3 | SAML 2.0 SSO: metadata, SSO, ACS |
scim/v2/* | 7 | SCIM 2.0 provisioning (Okta, Azure AD) |
ldap/* | 2 | LDAP/AD status, sync trigger |
jit/* | 2 | JIT provisioning status, test |
cross-workspace/* | 3 | Cross-workspace message bus |
billing/* | 4 | Stripe Checkout, Customer Portal, subscription, webhook |
ws://host/ws/v1/sessions/{id} | WS | Streaming agent turns, tool confirmation, token events |
ws://host/ws/v1/logs | WS | Live log stream (admin only) |
Full reference: API Reference · Client Contract · WebSocket Protocol.
---
| Symptom | Likely cause | Fix |
|---|---|---|
Connection refused on startup | Ollama isn't running | ollama serve in another terminal |
Model not found | Model not pulled yet | ollama pull qwen3:8b |
| No search results | DuckDuckGo rate-limited | Wait, retry, or add a Tavily/Brave key |
| Empty or garbled response | Model too small or OOM | Try a smaller model: -m qwen3:8b |
Tool missing from /tools | API key for that tool isn't set | Set the key — tools auto-hide when unconfigured |
41 on demand (3 unavailable) — meaning? | Normal on-demand loading | 41 tools ready to request, 3 hidden for missing keys ([details](docs/CONFIGURATION.md#tool-loading)) |
Invalid API key (OpenAI) | Key missing or expired | export OPENAI_API_KEY="sk-..." |
| Not sure if config is valid | Typo or wrong structure | python cogtrix.py --check-config |
Detailed debugging: run with --debug (logs every LLM call, tool input/output, and context info to cogtrix.log).
---
该工具使用 NOASSERTION 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
📄 NOASSERTION — 请查阅原始协议条款了解具体使用限制。
经综合评估,模块化AI助手 在AI工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | Cogtrix |
| 原始描述 | 开源AI工具:About Modular AI assistant — 60 built-in tools, multi-provider LLM support (Olla。⭐20 · Python |
| Topics | aiassistantllmpython |
| GitHub | https://github.com/NorthlandPositronics/Cogtrix |
| License | NOASSERTION |
| 语言 | Python |
收录时间:2026-05-26 · 更新时间:2026-05-30 · License:NOASSERTION · AI Skill Hub 不对第三方内容的准确性作法律背书。