Skip to content

yycyyv/M-Cube

Repository files navigation

M-Cube Icon M-Cube (M³) — Multi-thinking, Multimodal, Multi-verification Patent Drafting Assistant

License: MIT Backend: FastAPI Frontend: React Desktop: Tauri Orchestration: LangGraph

M-Cube is a multi-thinking, multimodal, and multi-verification multi-agent collaborative patent drafting assistant. It relies on LangGraph for multi-agent orchestration, introducing multiple AI Agents to conduct multi-step reasoning. At different stages, it accomplishes various functions—including patent drafting, Office Action (OA) responses, prior art comparison, and claim polishing—based on the multimodal information of patent text and drawings. Throughout the process, it incorporates multiple verifications, such as specification support checks and prior art text-to-image logical verifications, ultimately outputting patent documents with self-consistent technical solutions, robust claims, and mutually corroborating drawings and text.

✨ Core Features

M-Cube's technical moat is built upon three core features:

  • 🧠 Multi-thinking

    Based on LangGraph for multi-agent orchestration. Each function possesses a complete working chain of thought, utilizing multiple agents for in-depth analysis and reasoning of documents. It automatically executes multiple rounds of internal adversarial checks, chain-of-thought expansions, and logical reviews during specification drafting, OA responses, patent comparisons, and patent polishing.

  • 👁️ Multimodal

    Leveraging underlying libraries like PyMuPDF and Pillow, alongside Vision LLMs, M-cube can directly read and dissect complex mechanical topological diagrams and prior art drawings. This achieves precise cross-mapping and verification between patent text and images.

  • 🛡️ Multi-verification

    Built-in multiple legal compliance audits and anti-hallucination verifications. All output features must have concrete anchors in the technical disclosure or drawings. Human-in-the-Loop (HITL) mechanisms are introduced at critical nodes to ensure complete avoidance of Article 33 (modifying beyond the original scope) red-line risks.

💼 Workflows

The workflows of M-Cube are illustrated below:

M-Cube Workflows

M-Cube deeply abstracts the core working scenarios of patent attorneys, providing four industrial-grade workflows:

  1. 📝 Patent Drafting: Performs atomic-level feature breakdown and drawing analysis based on technical disclosures. It drafts claims and specifications through multi-agent collaboration, providing traceability checks and logical reviews against the disclosure.
  2. ⚔️ Office Action (OA) Response: Deeply parses official examination opinions and analyzes the current case against prior art. It determines modification strategies based on the OA, mines fallback features from the specification, conducts feature verification, and ultimately generates the arguments and A33-compliant replacement sheets.
  3. 🔍 Prior Art Comparison: Analyzes the text and drawings of the current case and prior art documents. It compares features and connection relationships, outputting novelty/inventive step risk grading and subsequent modification suggestions.
  4. Claim Polishing: Reconstructs the application document, troubleshooting formal defects in the claims such as unclear preambles, lack of antecedent basis, and non-technical features. It also conducts a logical review of the modified documents.

🏗️ Architecture

M-Cube adopts a high-performance hybrid architecture of FastAPI + React + Tauri, supporting both cloud SaaS deployment and local geek-style offline execution.

  • Backend Engine: Python 3.10+, FastAPI, Uvicorn, LangGraph, Pydantic v2, sse-starlette.
  • Frontend Web: React 18, TypeScript, Vite 5, Tailwind CSS, Zustand.
  • Native Desktop: Tauri 2, Rust 2021 (Supports compiling Windows .exe and macOS .dmg).

🚀 Getting Started

Prerequisites

0. Clone and Initialize

Under the project directory:

Windows (PowerShell):

copy .env.example .env

macOS/Linux:

cp .env.example .env

Please fill in at least one available model API Key (e.g., OPENAI_API_KEY, DASHSCOPE_API_KEY) in the .env file. Now you can choose the option that works best for you:

1. Docker Deployment

Prerequisites:

  • Docker installed and running.
  • Prepare the .env file in the project root directory and fill in the model API Keys as needed.

Start:

docker compose up --build

Access:

  • Frontend: http://127.0.0.1:1420
  • Backend: http://127.0.0.1:8000

View Logs:

docker compose logs -f backend
docker compose logs -f frontend

Stop:

docker compose down

2. Local Web Development

Terminal 1 (Start Backend Engine):

pip install -r requirements.txt
python -m uvicorn main:app --host 127.0.0.1 --port 8000 --reload

Terminal 2 (Start Frontend Service):

npm install --prefix frontend
npm --prefix frontend run dev

Network Service Access:

  • Frontend UI: http://localhost:1420
  • Backend API: http://127.0.0.1:8000

3. Desktop Development (Tauri)

Note: The tauri:dev command only launches the native desktop shell and will not automatically start the Python backend. Please ensure the backend service is running first according to Step 1 (Terminal 1).

npm install --prefix frontend
npm --prefix frontend run tauri:dev

4. Local Desktop App

npm --prefix frontend run tauri:build

Note: If you encounter a missing PyInstaller error during local building, you can run:

pip install pyinstaller

📄 License

M-Cube is licensed under the MIT License.

About

M-Cube (M³) — Multi-thinking, Multimodal, Multi-verification Patent Drafting Assistant

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors