Pack · #384 trending skills repo

WorkWit-AI-Agent

crane-in-clear-sky/WorkWit-AI-Agent

WorkWit: a self-hosted, open-source (MIT) enterprise AI Agent platform for office automation — built-in contract review & resume screening, 40+ skills, MCP connectors, multi-tenant RBAC. Deploy with one Docker Compose.

Stars
108
This week
+0
Forks
6
Open issues
1
Skills inside
36
Star trend · last 9 days+0 ★
Oct 29, 2026: 108 starsOct 30, 2026: 108 starsOct 31, 2026: 108 starsNov 1, 2026: 108 starsNov 2, 2026: 108 starsNov 3, 2026: 109 starsNov 4, 2026: 108 starsNov 5, 2026: 108 starsNov 6, 2026: 108 starsNov 7, 2026: 108 stars

Get started

Install the skills

npx skills add crane-in-clear-sky/WorkWit-AI-Agent

Installs into Claude Code, Codex, Cursor, OpenCode and the other agents it finds on your machine.

Inside this repo

36 skills

academic_paper_expert|\n学术论文写作专家。精通社科/理工科论文结构、APA/GB-T7714引用规范、学术表达范式。\n提供论文结构设计、文献综述、摘要撰写、学术语言润色等全流程指导。\n当用户提到「写论文」「学术写作」「文献综述」「论文润色」「摘要」时触发。workwit/backend/builtin_skills/academic_paper_expertardot_design_core\"Foundational workflow and hard rules shared by ALL Ardot canvas design tasks (UI screens, slides, posters, design systems, design-to-code). This skill carries the canvas schema, editing principles, the standard step-by-step workflow, visual style guide, and composite effects. It is injected automaworkwit/backend/builtin_skills/ardot_design_coreardot_design_router\"Dispatcher for WorkBuddy's Ardot design assistant. Use this when a design task is in Craft/design mode but the specific deliverable type is not yet determined from UI signals. It classifies intent (UI screen / slides / poster / design-to-code) and tells you which domain Ardot skill to load, then dworkwit/backend/builtin_skills/ardot_design_routerardot_design_to_code\"Use this skill for Ardot canvas tasks that convert a design into frontend code, or extract a design system / style guide from a website. Covers: design-to-code, design → HTML/CSS/JS, export as webpage, pixel-perfect reproduction, generate an Application from a design, slide transitions, responsiveworkwit/backend/builtin_skills/ardot_design_to_codeardot_poster\"Use this skill for Ardot canvas design tasks whose deliverable is a visual poster — posters, flyers, billboards, banners, event posters, promotional single-page graphics, e-commerce banners, brand visuals, logos, icons & illustrations rendered on the Ardot canvas. Trigger phrases: design a poster,workwit/backend/builtin_skills/ardot_posterardot_slides\"Use this skill for Ardot canvas design tasks whose deliverable is a slide deck / presentation design (NOT a PowerPoint .pptx file). Covers presentations, decks, pitch decks, keynote-style slides, launch-event slides, roadshow decks, proposal/pitch slides rendered as Ardot design canvases. Trigger workwit/backend/builtin_skills/ardot_slidesardot_ui_design\"Use this skill for Ardot canvas design tasks whose deliverable is a UI / interface design — web pages, web apps, dashboards, landing pages, marketing sites, official sites, homepages, mobile app screens (iOS / Android / 小程序), forms, tables, components, and design systems / design tokens / componenworkwit/backend/builtin_skills/ardot_ui_designbusiness_copy_expert|\n商业文案写作专家。精通品牌文案、营销邮件、产品描述、广告策划、社交媒体内容。\n基于 AIDA 模型和广告法合规要求,提供高转化率的文案创作与诊断。\n「写文案」「营销文案」「品牌Slogan」「广告语」「产品描述」「推广文案」「文案优化」触发。workwit/backend/builtin_skills/business_copy_expertcloudstudio_deployDeploy static sites to CloudStudio sandbox workspaces or take published sites offline. This skill should be used when users want to deploy a local build directory (e.g. dist/, build/, out/) to a CloudStudio workspace, preview or publish a static site with a shareable URL, or unpublish an existing deworkwit/backend/builtin_skills/cloudstudio_deploydesign_token|\n按文档类型(genre)选择主题并输出标准化设计令牌(Design Tokens),驱动 doc-typeset skill 的所有样式决策。\n支持公文、学术论文、商务报告、创意营销、通用五大场景,输出含 typography/color/spacing/layout 的 W3C DTCG 格式 JSON 和 CSS 变量映射。\n当 generate_word 流水线需要确定排版风格、需要字体/颜色/间距/页边距决策时,必须调用此 skill;\n不要跳过它直接写裸值——所有样式决策的唯一入口就是这里。workwit/backend/builtin_skills/design_tokendoc_typeset|\n消费 design tokens + 文档内容,输出排版美化的 HTML。\n内置 7 种垂类模板(合同/学术论文/公文/商务报告/会议纪要/研报/年报)和 4 个装饰组件,所有样式通过 CSS 变量引用 Token,禁止裸值。\n在 generate_word 流水线中每当需要将文本内容转化为结构化美化 HTML 时,必须使用此 skill;\n不要自己写 HTML 或内联 CSS——doc-typeset 是内容→HTML 的唯一标准转换路径。workwit/backend/builtin_skills/doc_typesetexpert_manager|\n专家包的全生命周期运营:转化(从开源仓库/本地项目创建专家包)、修改已有专家、合规检查、批量更新、质量审查。\n触发词:创建专家、转化专家、转成专家、生成专家包、导入专家、convert expert、修改专家、编辑专家、更新专家、modify expert、检查专家、审查专家包、专家合规、专家运营、expert ops。workwit/backend/builtin_skills/expert_managerformat_extract>\n把 .docx 文档转为语义化 HTML + 提取内嵌图片(标题层级、表格样式、段落缩进、字体颜色等结构信息),供调用方做后续格式分析;也可独立评估 HTML 转换质量。适用场景(**技术性底层调用**):\"docx 转 HTML\"、\"提取 docx 结构为 HTML\"、\"HTML 转换质量评估\"。本 Skill 是底层格式提取工具,**不自行判断是否应被触发**、**不猜测输出位置**——是否调用、何时调用、产物落在哪一律由上层调用方(如 generate_word)决定,调用时必须显式传入 `--output-dir`。用户关于\"文档排版 / 套模板 / 参考这份 doworkwit/backend/builtin_skills/format_extractgeneral_writerL1 通用写作兜底专家。覆盖公文、周报、方案、邮件、文案、散文、新媒体稿件等场景,采用 7 维质量评分框架(事实/逻辑/结构/语言/风格/受众/洞察)与 10 种文体适配矩阵。当 L0 路由未命中任何 L2 专家时作为兜底触发。适用于没有特定领域严格规范的通用写作任务。workwit/backend/builtin_skills/general_writergenerate_fillable_contract_html生成适于 HTML 转 DOCX 的中文待填合同、报价单和授权委托书 HTML。用户要求创建待填业务文档模板、合同填空或可按书签填写的 HTML 时使用。workwit/backend/builtin_skills/generate_fillable_contract_htmlgeo_map_compliance_guard>\nALWAYS TRIGGER map compliance skill for any map generation, visualization, routing, or location service request to enforce strict China map data compliance rules, including approved data-source whitelist, key safety controls, territorial integrity requirements, privacy protection, and Tencent Mapworkwit/backend/builtin_skills/geo_map_compliance_guardhtml_review|\nHTML 质量门禁 skill(路线 A + 路线 B 共享)。对 doc-typeset(路线 A)或 doc-edit(路线 B)输出的 HTML 进行 5 维度质量检测(design-token 合规性、结构完整性、排版合理性、文体契合度、装饰使用合理性),输出结构化检测报告,不通过则打回上游做一次定向修正(不循环)。\n在 generate_word 路线 A 和路线 B 流水线中,每次 HTML 输出后必须调用此 skill;\n当需要检查 HTML 是否存在裸样式值、标题跳级、缺少必需文体元素、装饰过度等问题时,都应使用此 skill 而非手动检查。workwit/backend/builtin_skills/html_reviewhtml_to_docx|\n将 HTML 字符串或文件高保真转换为 Microsoft Word (.docx) 文档。\n支持 CSS 变量预处理、10+ 种 HTML 元素精确映射、14 种 CSS 属性映射、中文字体、4 种装饰组件、TOC 目录、页眉页脚、图片嵌入。\n提供 CLI(subprocess)和 Python API 双模式调用;在需要将 HTML 文档转为可编辑 Word 文件时使用此 skill。workwit/backend/builtin_skills/html_to_docxhumanizer|\nRemove signs of AI-generated writing from text. Use when editing or reviewing\ntext to make it sound more natural and human-written. Based on Wikipedia's\ncomprehensive \"Signs of AI writing\" guide. Detects and fixes patterns including:\ninflated symbolism, promotional language, superficial -ingworkwit/backend/builtin_skills/humanizerhumanizer_zh|\n去除文本中的 AI 生成痕迹。适用于编辑或审阅文本,使其听起来更自然、更像人类书写。\n基于维基百科的\"AI 写作特征\"综合指南。检测并修复以下模式:夸大的象征意义、\n宣传性语言、以 -ing 结尾的肤浅分析、模糊的归因、破折号过度使用、三段式法则、\nAI 词汇、否定式排比、过多的连接性短语。workwit/backend/builtin_skills/humanizer_zhlegal_contract_expertL2 法律合同专家。覆盖各类合同、协议、条款、契约的起草与审查,包含必备条款完整性检查(标的/价款/违约/争议解决/生效条件)、权利义务对称性审核、高风险点防范(不可抗力/知识产权归属/保密期限)。采用严格 Critic 审查,涉及法律责任任务**强制**走 per-section 模式分章审查。触发关键词:合同、契约、协议、条款、甲乙方、违约金、不可抗力、争议解决。workwit/backend/builtin_skills/legal_contract_expertlibrary当要写/整理在线文档、建数据表增删改查、导入 CSV·Excel、做看板/dashboard/运营页/汇报页、md 转网页或演示 HTML 发布、建目录、上传下载网盘文件、审阅修订、分享协作,以及提到资料库/知识库/网盘/空间/workbuddy.cn/space 链接时使用。资料库是 WorkBuddy 原生的内容管理、分享协作与轻发布模块,覆盖在线文档(doc)、网页链接(link)、结构化数据表(database)、数据/汇报页面(page)、网盘文件(drive)与空间管理(manage);凡说资料库/知识库或出现 space 链接、未显式点名腾讯文档/飞书/Notion/乐享/金山文workwit/backend/builtin_skills/librarymarketplace_skill_installer|\n在 WorkBuddy 对话中通过一句话从推荐市场(BuiltinMarket)搜索并安装 Skill。\n触发词:安装 skill、安装技能、install skill、添加技能、装个 X 技能、帮我安装 X、find skill、install marketplace skill、search skill。workwit/backend/builtin_skills/marketplace_skill_installermultimodal_generation>\n3D模型生成和基于模板的视频特效能力。仅支持:文生3D模型、图生3D模型、基于模板的图片视频特效(video-fx)。\n适用于用户需要 AI 创作 3D 模型或对图片应用模板特效(如拥抱、变身、万物归尘等动效模板)的场景。\n当用户提出以下意图时触发:生成/制作3D模型、对图片应用特效模板或动效模板。\n注意:本技能不处理图片生成、视频生成任务。生成图片请用 generate_image 工具,生成视频请用 generate_video 工具。workwit/backend/builtin_skills/multimodal_generationpoetry_prose_expert|\n诗歌与散文写作专家。精通现代诗、古体诗词、散文、随笔、文学评论等文学创作。\n基于中国现代诗歌美学和散文艺术理论,帮助作者提升文学表达力。\n当用户提到「写诗」「写散文」「诗歌」「随笔」「文学评论」时触发。workwit/backend/builtin_skills/poetry_prose_expertrecommend_connectors|\n当用户任务需要外部 App、服务、API、MCP、授权或第三方数据,而当前没有已连接工具覆盖时,搜索并用内联卡片推荐真实 Connector。workwit/backend/builtin_skills/recommend_connectorsrecommend_experts|\n当任务需要专业判断、深度研究、专业角色或多角色协作,且当前会话尚未选择 Expert 时,搜索并用内联卡片推荐真实专家或专家团。workwit/backend/builtin_skills/recommend_expertsscience_writing_expert|\n科普写作专家。精通面向大众的科学解释、科技评测、深度报道、科普文章等。\n基于科学传播理论和费曼学习法,将复杂科学概念转化为人人能懂的精彩内容。\n当用户提到「科普文章」「科学解释」「科技评测」「深度报道」「科普」时触发。workwit/backend/builtin_skills/science_writing_expertskill_creatorGuide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends CodeBuddy's capabilities with specialized knowledge, workflows, or tool integrations.workwit/backend/builtin_skills/skill_creatorstock_research_report_expertL2 证券/行业研究报告专家。生成专业的行业深度报告、个股研究、动态点评等金融研究文档。内置标准化报告结构框架,覆盖深度研报、常规点评、商业计划书、咨询交付物四档体量。触发关键词:行业研究、深度报告、个股研究、研报、券商报告、产业分析、行业跟踪、投资分析。workwit/backend/builtin_skills/stock_research_report_experttdoc_orchestrator\"文档创作与美化的统一编排入口(本地通道)。当用户意图涉及文档写作或排版美化时调用。职责:识别意图 → 编排 stage 能力链(S1 创作 / S2 美化 / S3 HTML→DOCX 转换)→ 委派 generate_word/generate_word/generate_word 执行;S3 产出 .docx 后**强制 `系统下载卡片(自动生成)` 打开预览**,本 skill 调用结束。⚠️ 文档编辑不在本 skill 内承接,由 `tencent-docs-routing` skill 处理。不适用:纯代码文件、非文档类操作。\"workwit/backend/builtin_skills/tdoc_orchestratortech_blog_expert|\n技术博客写作专家。精通技术文章、教程、架构解析、源码分析、开源项目文档。\n基于 Developer Experience (DX) 和技术传播最佳实践,帮助开发者写出清晰、准确、有深度的技术内容。\n「写技术文章」「写博客」「写教程」「技术分享」「架构文档」「README」触发。workwit/backend/builtin_skills/tech_blog_experttencent_pptx创建专业的 PowerPoint 演示文稿。适用于根据主题、大纲、文档、数据或参考材料生成完整 .pptx;在新建演示文稿时参考上传PPTX 的视觉风格;也可基于材料或旧 PPT 内容重新生成一版演示文稿。workwit/backend/builtin_skills/tencent_pptxunderline_toolkit生成带下划线填空位的 Word 文档(create 模式)或对已有下划线模板回填数据(fill 模式)。适用于合同、协议、申请表、有封面的文档(如毕业论文)等。触发关键词:下划线、填空、下划线模板、合同填空、表单回填、下划线回填。workwit/backend/builtin_skills/underline_toolkitwb_finance_skill>-\n金融/投资/股票/基金/ETF/板块/指数/宏观/外汇/大宗商品/财报/估值/持仓/交易/仓位/量化/因子/回测/选股/期权/衍生品/投行建模/技术指标/行情监控/预警——金融场景总入口,优先级**高于**所有其他金融相关 skill。请求涉及任一上述领域时(包括字面没出现\"金融\"\"股票\"但本质围绕这些标的或方法论展开的问题),都务必**第一时间优先加载本 skill**。workwit/backend/builtin_skills/wb_finance_skillwork_report_expert|\n年终总结与汇报写作专家。精通工作总结、述职报告、项目汇报、竞聘演讲、周报月报等职场写作。\n基于金字塔原理和STAR法则,帮助职场人写出结构清晰、数据有力、亮点突出的汇报材料。\n当用户提到「年终总结」「述职报告」「工作汇报」「竞聘演讲」「周报」「月报」时触发。workwit/backend/builtin_skills/work_report_expert

Documentation

README

View on GitHub ↗

English |

WorkWit - Enterprise AI Office Assistant

An enterprise-oriented, privately deployable AI Agent platform. The backend is built on FastAPI + SQLite, and the frontend is a zero-dependency, vanilla-JS single-page application. The whole stack is deployed with one command via Docker Compose.

It is far more than a "contract-review gadget" - it is a unified office-agent foundation that integrates multi-model inference, extensible Skills, Tools, MCP connectors, sandboxed execution, multi-tenant access control, scheduled automation, and long-term memory. Office scenarios such as contract review and resume screening work out of the box, and new capabilities can be continuously extended through "skills + tools".


Why WorkWit

WorkWit is a self-hosted, enterprise-grade AI Agent platform built to make an organization's office work smarter - without giving up control of your data.

  • Fully open source and self-hosted (MIT). No subscription, no per-seat fees, no vendor lock-in. Run it on your own infrastructure; your data never leaves your servers.
  • Built for organizations, not just individuals. Real multi-tenant RBAC (Organization / Department / User) with a single source of truth for permission bits (FEATURE_REGISTRY).
  • Office scenarios out of the box. Contract review (with Party A / Party B stance) and resume screening (job-profile matching score) ship as built-in modules - no assembly required.
  • Trivial to deploy and audit. One docker compose up, a single backend container, SQLite storage, and a zero-dependency frontend. No build step; easy to read, fork, and harden.
  • Unified capability catalog. Skills, tools, and MCP connectors are merged into one catalog and kept in sync automatically, so adding a capability is one registration, not three integrations.
  • Safe by default. User-supplied code runs in a restricted sandbox (AST scan + CPU/memory/process/timeout limits + privilege drop); secrets stay in .env / data/ that are git-ignored.
  • Extensible by design. 40+ built-in skills, a Skills Marketplace, a Tool Library, and the MCP connector framework let you grow capabilities continuously.

Core Features

  • General-purpose Agent core: a ReAct (plan-act) loop supporting tool calls, streaming SSE output, and automatic decomposition/execution of multi-step tasks. The model proactively warns when it "claims a file was generated" but never actually invoked a tool (hallucination guard).
  • Skills Marketplace: file-based skills (SKILL.md), with 40+ built-in skills (PPT generation, Word typesetting, WeChat official-account / Xiaohongshu writing, contract/legal, research reports, map compliance, 3D/video, Tencent Docs, and more). Supports versioning, rollback, visibility control, and install/uninstall.
  • Tool Library: built-in tools (web search, web fetch, charts, email, text-to-image/video, PPT/Word generation, contract risk analysis, and more) + user-defined tools (sandboxed execution) + external MCP connectors.
  • MCP Connector Framework: connect to standard MCP servers via data/mcp.json (supporting both streamable-http and stdio transports); external tools are auto-synced into the unified capability catalog.
  • Sandboxed Execution: user-uploaded Python code runs in a restricted subprocess (AST static scanning + CPU/memory/process/timeout limits + privilege drop + module and file guards).
  • Multi-tenancy and RBAC: a three-tier structure of Organization / Department / User, with fine-grained feature permission bits (FEATURE_REGISTRY); admins can centrally manage models, navigation, SMTP, MCP, and more.
  • Multi-model Access: OpenAI-compatible interfaces, with four roles - chat / vision / embed / rerank. Can connect directly to vLLM / Ollama, or use LiteLLM as a unified gateway (a reference litellm_config.yaml is included).
  • Automation: a background scheduler supports scheduled / recurring tasks.
  • Long-term Memory and Conversation History: user-level long-term memory and cross-session history retrieval.
  • Office scenarios out of the box: contract review (selectable stance), resume screening (job-profile matching score), and more.

Tech Stack

Layer Choice
Backend FastAPI (async), SQLite, Uvicorn
Frontend Vanilla HTML/JS SPA (backend/static/index.html, zero build dependencies)
Model Access OpenAI-compatible API (direct or via LiteLLM gateway)
Deployment Docker Compose (single backend container, port 4001:8000)
Execution Isolation subprocess sandbox (resource limits + AST scanning)

Directory Structure

workwit/
├── docker-compose.yml        # one-command deploy (backend service only)
├── litellm_config.yaml       # optional: reference config for the LiteLLM model gateway
├── .env.example              # env var template (copy to .env and fill in real values)
├── README.md
├── data/                     # runtime data (git-ignored, auto-generated on container start)
│   ├── app.db                #   SQLite main DB (auto-creates tables + seed data on first start)
│   ├── artifacts/            #   output dir for agent-generated artifacts
│   ├── uploads/              #   user uploads
│   ├── system_assets/        #   system assets
│   └── mcp.json              #   MCP connector config (may contain tokens - do not commit)
└── backend/
    ├── Dockerfile
    ├── requirements.txt
    ├── app.py                # FastAPI entrypoint, registers business routers
    ├── db.py                 # data layer + permission-bit registry (single source of truth)
    ├── auth.py               # login / permission gate
    ├── core.py               # business core (contract review / resume screening / artifact extraction)
    ├── agent.py              # ReAct agent loop (async generator, yields events one by one)
    ├── agent_endpoints.py    # agent API (planning / automation / memory / chat)
    ├── tools_build.py        # session tool assembly (DB def -> handler binding, MCP/sandbox branches)
    ├── tools_handlers.py     # tool handler implementations
    ├── llm_adapter.py        # multi-model client & capability wrapper
    ├── mcp_client.py         # MCP connector framework (streamable-http / stdio)
    ├── sandbox.py            # user-code sandbox execution (AST scanning + resource limits)
    ├── automation_runner.py  # scheduled automation runner
    ├── admin.py              # admin endpoints (models/orgs/depts/users/logs)
    ├── mgmt_endpoints.py     # admin endpoints (skills/tools/nav/system)
    ├── resume.py             # resume screening endpoints
    ├── search.py             # web search / web fetch
    ├── mailer.py             # email sending (SMTP)
    ├── builtin_skills/       # 40+ built-in skills (one SKILL.md each)
    ├── builtin_tools/        # built-in tool implementations
    └── static/               # frontend SPA (index.html)

Quick Start

Prerequisites

  • A Linux server (Ubuntu 22.04 recommended) with Docker (including the docker compose plugin) installed.
  • 4 OpenAI-compatible model endpoints (address + key) for chat / vision / embed / rerank. These can be local inference services (vLLM / Ollama) or fronted by a LiteLLM gateway.

Deployment Steps

# 1) Install Docker (if not already installed)
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
# verify after re-logging into the terminal: sudo docker run hello-world

# 2) Upload this repo to the server, e.g. ~/workwit
git clone <your-repo-url> ~/workwit
cd ~/workwit

# 3) Fill in the model config
cp .env.example .env
nano .env     # set the 4 MODEL_*_BASE / MODEL_*_KEY pairs to real addresses and keys
# BASE = model service address, e.g. http://192.168.1.50:8000/v1

# 4) Start
docker compose up -d --build
docker compose logs -f backend   # watch for errors

After startup, open http://<server-ip>:4001 in a browser. Default admin account: admin / admin123 (change it in production - entry: "System Management -> User Management").

If you want to aggregate multiple model backends with LiteLLM, you can spin up a LiteLLM container yourself referencing litellm_config.yaml and point the MODEL_*_BASE values in .env to it; docker-compose.yml currently only orchestrates the single backend service.

Upgrade / Rebuild

After code changes:

docker compose up -d --build

Configuration (.env)

Variable Description
MODEL_30B_BASE / MODEL_30B_KEY OpenAI-compatible address and key for the main inference model (chat role)
MODEL_VLM_BASE / MODEL_VLM_KEY Address and key for the multimodal model (vision role)
MODEL_EMBED_BASE / MODEL_EMBED_KEY Address and key for the embedding model (embed role)
MODEL_RERANK_BASE / MODEL_RERANK_KEY Address and key for the rerank model (rerank role)

On first start the 4 models are written to app.db as seed data from .env; afterwards the database is the source of truth and can be adjusted under "System Management -> Model Configuration".

Other overridable env vars (for ops tuning): DB_PATH, SKILL_CPU_SEC, SKILL_MEM_MB, SKILL_NPROC, SKILL_TIMEOUT, SKILL_ARTIFACT_ROOT, MCP_CONFIG_PATH.


Feature Modules

  • Contract Review: upload txt / docx / pdf, select your stance (Party A / Party B), and get structured risk points and revision suggestions (with truncated-JSON repair fallback when parsing fails).
  • Resume Screening: upload a resume + a job profile, and get the candidate's key fields, a match score, and a recommendation.
  • Agent: issue tasks in natural language; it auto-plans and invokes skills / tools to complete them. Supports sketch planning, user clarification, and sub-agent delegation.
  • Skills Marketplace / Tool Library: view, enable, and manage skills and tools; supports creating user-private skills and tools (sandboxed execution).
  • Automation: configure scheduled / recurring tasks, executed by the background scheduler.
  • My Memory / Conversation History: user-level long-term memory and cross-session retrieval.
  • System Management: models, organizations, departments, users, permissions, logs, SMTP, MCP, navigation, and basic info.

Security Notes

  • Secret isolation: .env (contains model keys) and data/ (contains the runtime DB and MCP tokens) are git-ignored - do not commit them to the repo.
  • Sandbox: user-defined code runs in a restricted subprocess, with AST static scanning, CPU / memory / process / timeout limits, privilege drop to nobody, and module and file-access guards.
  • Permissions: feature-level RBAC; admins are allowed by default, regular users get least-privilege permission bits; adding a new nav/feature only requires registering one line in db.FEATURE_REGISTRY and it takes effect automatically.
  • Production recommendations: change the default admin password; enable HTTPS (reverse proxy); keep sensitive config such as MCP tokens in data/mcp.json (not in the repo).

Contributing

Issues / PRs are welcome. Before submitting, please ensure:

  1. The .gitignore rules are applied and .env / data/ are not accidentally committed;
  2. If a new feature introduces a nav entry, register its permission bit in backend/db.py's FEATURE_REGISTRY;
  3. New built-in skills go under backend/builtin_skills/<name>/SKILL.md, following the existing when_to_use semantic-field convention.

License

This project is licensed under the MIT License. For other licenses (e.g., Apache-2.0, or proprietary/closed-source), please specify separately.


Roadmap (optional directions)

  • Visualization and monitoring for sub-agent orchestration;
  • More built-in skills / tools (spreadsheets, databases, BI, and more);
  • Multi-instance horizontal scaling (currently single-DB; DB persistence and hot-cache extension points are already reserved);
  • Frontend build tooling (currently zero-de

中文版 |

企业 AI 办公智慧助手(WorkWit)

一个面向企业的、可私有化部署的 AI Agent(智能体)平台。后端基于 FastAPI + SQLite,前端是一个零依赖的原生 JS 单页应用,整体用 Docker Compose 一键部署。

它不只是一个「合同审核小工具」——而是一个把 多模型推理、可扩展技能(Skills)、工具(Tools)、MCP 连接器、沙箱执行、多租户权限、定时自动化、长期记忆 整合在一起的统一办公智能体底座。开箱内置合同审核、简历筛选等办公场景,也支持通过「技能 + 工具」不断扩展新能力。


为什么选 WorkWit

WorkWit 是一个私有化、企业级的 AI 智能体平台,目标是让组织的办公更高效,同时不交出数据的控制权。

  • 完全开源 + 私有化部署(MIT)。 无订阅、无按席位收费、无厂商锁定。部署在你自己的服务器上,数据始终留在你自己的基础设施内。
  • 为组织而生,而非仅面向个人。 真正的多租户 RBAC(组织 / 部门 / 用户),权限位集中登记于 FEATURE_REGISTRY 单一真相源。
  • 办公能力开箱即用。 合同审核(支持甲方 / 乙方立场)与简历筛选(岗位画像匹配评分)作为内置模块随平台提供,无需自己拼装。
  • 部署与审计极简。 一条 docker compose up、单个后端容器、SQLite 存储、零依赖前端 —— 无构建步骤,易于阅读、fork 与加固。
  • 统一能力目录。 技能、工具与 MCP 连接器合并为一张目录并自动同步,新增一项能力只需一次登记,而非三次集成。
  • 默认安全。 用户代码在受限沙箱中执行(静态扫描 + 资源限额 + 降权),密钥留在 .env / data/(已被 .gitignore 忽略)。
  • 为扩展而生。 40+ 内置技能 + 技能广场 + 工具库 + MCP 连接器框架,让能力可持续生长。

✨ 核心特性

  • 通用 Agent 内核:ReAct(规划—执行)循环,支持工具调用、流式 SSE 输出、多步任务自动拆解与执行;模型「声称已生成文件」但实际未调用工具时会主动提示(防幻觉)。
  • 技能广场(Skills):文件化的技能(SKILL.md),内置 40+ 技能(PPT 生成、Word 排版、公众号/小红书写作、合同/法务、研报、地图合规、3D/视频、文档等);支持版本管理、回滚、可见性控制、安装/卸载。
  • 工具库(Tools):内置工具(联网搜索、网页抓取、图表、邮件、文生图/视频、PPT/Word 生成、合同风险分析等)+ 用户自定义工具(沙箱执行)+ 外部 MCP 连接器。
  • MCP 连接器框架:通过 data/mcp.json 接入标准 MCP 服务(支持 streamable-http 与 stdio 两种传输),外部工具自动同步进统一能力目录。
  • 沙箱执行:用户上传的 Python 代码在受限子进程中运行(AST 静态扫描 + CPU/内存/进程/超时限额 + 降权 + 模块与文件护栏)。
  • 多租户 & RBAC:组织 / 部门 / 用户三级结构,细粒度功能权限位(FEATURE_REGISTRY),管理员可集中管控模型、导航、SMTP、MCP 等。
  • 多模型接入:面向 OpenAI 兼容接口,区分 chat / vision / embed / rerank 四种角色;可直连 vLLM / Ollama,或用 LiteLLM 做统一网关(仓库附 litellm_config.yaml 参考配置)。
  • 自动化(Automations):后台调度器支持定时 / 周期性任务。
  • 长期记忆 & 历史对话:用户级长期记忆、跨会话历史检索。
  • 办公场景开箱即用:合同审核(可选立场)、简历筛选(岗位画像匹配评分)等。

🧱 技术栈

层 选型
后端 FastAPI(异步)、SQLite、Uvicorn
前端 原生 HTML/JS 单页(backend/static/index.html,零构建依赖)
模型接入 OpenAI 兼容 API(直连或经 LiteLLM 网关)
部署 Docker Compose(单后端容器,端口 4001:8000)
执行隔离 subprocess 沙箱(资源限额 + AST 扫描)

📂 目录结构

workwit/
├── docker-compose.yml        # 一键部署(仅 backend 一个服务)
├── litellm_config.yaml       # 可选:LiteLLM 模型网关参考配置
├── .env.example              # 环境变量模板(复制为 .env 后填入真实值)
├── README.md
├── data/                     # 运行时数据(已被 .gitignore 忽略,容器启动后自动生成)
│   ├── app.db                #   SQLite 主库(首次启动自动建表 + 种子数据)
│   ├── artifacts/            #   智能体生成的产物落盘目录
│   ├── uploads/              #   用户上传文件
│   ├── system_assets/        #   系统资源
│   └── mcp.json              #   MCP 连接器配置(可含令牌,勿提交)
└── backend/
    ├── Dockerfile
    ├── requirements.txt
    ├── app.py                # FastAPI 入口,注册各业务路由
    ├── db.py                 # 数据层 + 权限位注册表(单一真相源)
    ├── auth.py               # 登录 / 权限门禁
    ├── core.py               # 业务核心(合同审核 / 简历筛选 / 产物提取)
    ├── agent.py              # ReAct 智能体循环(异步生成器,逐事件 yield)
    ├── agent_endpoints.py    # 智能体 API(规划 / 自动化 / 记忆 / 对话)
    ├── tools_build.py        # 会话工具装配(DB 定义 → handler 绑定,MCP/沙箱分支)
    ├── tools_handlers.py     # 工具 handler 实现
    ├── llm_adapter.py        # 多模型客户端与能力封装
    ├── mcp_client.py         # MCP 连接器框架(streamable-http / stdio)
    ├── sandbox.py            # 用户代码沙箱执行(AST 扫描 + 资源限额)
    ├── automation_runner.py  # 定时自动化调度器
    ├── admin.py              # 管理后台端点(模型/组织/部门/用户/日志)
    ├── mgmt_endpoints.py     # 管理后台端点(技能/工具/导航/系统)
    ├── resume.py             # 简历筛选端点
    ├── search.py             # 联网搜索 / 网页抓取
    ├── mailer.py             # 邮件发送(SMTP)
    ├── builtin_skills/       # 40+ 内置技能(每个一个 SKILL.md)
    ├── builtin_tools/        # 内置工具实现
    └── static/               # 前端单页(index.html)

🚀 快速开始

前置条件

  • 一台 Linux 服务器(推荐 Ubuntu 22.04)并已安装 Docker(含 docker compose 插件)。
  • 4 个 OpenAI 兼容模型端点的 地址与密钥(chat / vision / embed / rerank)。可以是本地推理服务(vLLM / Ollama),也可以前置 LiteLLM 网关。

部署步骤

# 1) 安装 Docker(若未安装)
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
# 重新登录终端后验证:sudo docker run hello-world

# 2) 把本仓库传到服务器,例如 ~/workwit
git clone <your-repo-url> ~/workwit
cd ~/workwit

# 3) 填写模型配置
cp .env.example .env
nano .env     # 把 4 组 MODEL_*_BASE / MODEL_*_KEY 改成真实地址和密钥
# BASE 填模型服务地址,例如 http://192.168.1.50:8000/v1

# 4) 启动
docker compose up -d --build
docker compose logs -f backend   # 观察有无报错

启动后浏览器访问 http://服务器IP:4001。默认管理员账号:admin / admin123(生产环境务必修改,入口在「系统管理 → 用户管理」)。

若想用 LiteLLM 统一聚合多个模型后端,可参考 litellm_config.yaml 自行起一个 LiteLLM 容器,并把 .env 里的 MODEL_*_BASE 指向它;docker-compose.yml 当前只编排 backend 一个服务。

升级 / 重建

代码改动后:

docker compose up -d --build

⚙️ 配置说明(.env)

变量 说明
MODEL_30B_BASE / MODEL_30B_KEY 主推理模型(chat 角色)的 OpenAI 兼容地址与密钥
MODEL_VLM_BASE / MODEL_VLM_KEY 多模态模型(vision 角色)地址与密钥
MODEL_EMBED_BASE / MODEL_EMBED_KEY 嵌入模型(embed 角色)地址与密钥
MODEL_RERANK_BASE / MODEL_RERANK_KEY 重排序模型(rerank 角色)地址与密钥

首次启动会按 .env 把 4 个模型写入 app.db 作为种子;之后以数据库为准,可在「系统管理 → 模型配置」里调整。

其他可覆盖的环境变量(运维调参):DB_PATH、SKILL_CPU_SEC、SKILL_MEM_MB、SKILL_NPROC、SKILL_TIMEOUT、SKILL_ARTIFACT_ROOT、MCP_CONFIG_PATH。


🧩 功能模块

  • 合同审核:上传 txt / docx / pdf,选择我方立场(甲方 / 乙方),输出结构化的风险点与修改建议(JSON 解析失败时具备截断修复兜底)。
  • 简历筛选:上传简历 + 岗位画像,输出候选人关键字段、匹配评分与推荐结论。
  • 智能体(Agent):自然语言下达任务,自动规划并调用技能 / 工具完成;支持草图规划、用户澄清、子 Agent 委派。
  • 技能广场 / 工具库:查看、启用、管理技能与工具;支持创建用户私有技能与工具(沙箱执行)。
  • 自动化:配置定时 / 周期任务,由后台调度器执行。
  • 我的记忆 / 历史对话:用户级长期记忆与跨会话检索。
  • 系统管理:模型、组织、部门、用户、权限、日志、SMTP、MCP、导航、基础信息。

🔒 安全说明

  • 密钥隔离:.env(含模型密钥)与 data/(含运行库、MCP 令牌)已被 .gitignore 忽略,请勿提交到仓库。
  • 沙箱:用户自定义代码在受限子进程中执行,含 AST 静态扫描、CPU / 内存 / 进程 / 超时限额、降权到 nobody、模块与文件访问护栏。
  • 权限:功能级 RBAC,管理员默认放行,普通用户按权限位最小授权;新增导航/功能只需在 db.FEATURE_REGISTRY 注册一行即自动生效。
  • 生产建议:修改默认管理员密码;启用 HTTPS(反向代理);MCP 令牌等敏感配置放在 data/mcp.json(不入库)。

🤝 贡献

欢迎 Issue / PR。提交前请确保:

  1. 已执行 .gitignore 规则,未误提交 .env / data/;
  2. 新功能若引入导航入口,请在 backend/db.py 的 FEATURE_REGISTRY 登记权限位;
  3. 新增内置技能放到 backend/builtin_skills/<name>/SKILL.md,遵循现有 when_to_use 语义字段约定。

📜 许可证

本项目采用 MIT License。如需其他许可证(如 Apache-2.0、或私有闭源),请另行说明。


🗺️ 路线图(可选方向)

  • 子 Agent 编排的可视化与监控;
  • 更多内置技能 / 工具(表格、数据库、BI 等);
  • 多实例横向扩展(当前为单库,已预留 DB 持久化与热缓存扩展点);
  • 前端构建工具化(当前为零依赖原生 JS)。