How ghbalf/freecad-ai works
FreeCAD AI is a FreeCAD workbench for turning chat requests into 3D modeling operations. The primary workflow runs from the chat dock through conversation and LLM tool/code handling, then into FreeCAD execution; Plan mode adds user review before code runs. Other documented branches include reusable skills and their optimizer, MCP tools, hooks, attachments and vision support, and configuration. The graph uses the SOURCE INDEX and excerpts for internal links; unsampled feature links are omitted where their callers are not established.
Main entry points: chat_widget.py Chat dock · executor.py Code executor · client.py LLM client · registry.py Tool registry
Components 25
Workbench UI
- Workbench startup
InitGui.py - Chat dock
freecad_ai/ui/chat_widget.py - Code review
freecad_ai/ui/code_review_dialog.py - Settings UI
freecad_ai/ui/settings_dialog.py
Conversation runtime
- Conversation and sessions
freecad_ai/core/conversation.py - Document context
freecad_ai/core/context.py
Modeling execution
- Tool registry
freecad_ai/tools/registry.py - Tool reranker
freecad_ai/tools/reranker.py - FreeCAD operations
freecad_ai/tools/freecad_tools.py - Code executor
freecad_ai/core/executor.py - Active document
freecad_ai/core/active_document.py
Extensions
- Skills
freecad_ai/extensions/skills.py - Skill optimizer
freecad_ai/tools/optimize_tools.py - Skill evaluator
freecad_ai/extensions/skill_evaluator.py - Lifecycle hooks
freecad_ai/hooks/registry.py - User tools
freecad_ai/extensions/user_tools.py
Providers and MCP
- LLM client
freecad_ai/llm/client.py - Fallback profiles
freecad_ai/llm/fallback.py - Configuration
freecad_ai/config.py - MCP manager
freecad_ai/mcp/manager.py - MCP client
freecad_ai/mcp/client.py - MCP server
freecad_ai/mcp/server.py
Other components
- FreeCAD user
- LLM provider
- MCP service
Connections 26
- FreeCAD user → Chat dock: sends requests
README.md - Workbench startup → Chat dock: opens dock
InitGui.py - Chat dock → Conversation and sessions: manages turns
freecad_ai/ui/chat_widget.py - Chat dock → Document context: builds context
- Chat dock → LLM client: sends prompts
freecad_ai/ui/chat_widget.py - Chat dock → Fallback profiles: tries profiles
freecad_ai/ui/chat_widget.py - Chat dock → Tool registry: dispatches tools
- Chat dock → Tool reranker: filters tools
freecad_ai/ui/chat_widget.py - Chat dock → Code review: requests review
freecad_ai/ui/chat_widget.py - Code review → Code executor: executes code
freecad_ai/ui/code_review_dialog.py - Chat dock → Code executor: runs code
freecad_ai/ui/chat_widget.py - Code executor → Active document: targets document
freecad_ai/core/executor.py - Code executor → FreeCAD operations: exposes operations
freecad_ai/tools/freecad_tools.py - LLM provider → LLM client: serves requests
README.md - Settings UI → Configuration: edits settings
freecad_ai/ui/settings_dialog.py - LLM client → Configuration: loads provider setup
freecad_ai/llm/client.py - MCP manager → MCP client: creates clients
freecad_ai/mcp/manager.py - MCP manager → Tool registry: registers tools
freecad_ai/mcp/manager.py - MCP client → MCP service: calls service
- MCP server → Tool registry: registers tools
freecad_ai/mcp/server.py - Chat dock → Skills: invokes skills
freecad_ai/ui/chat_widget.py - Skill optimizer → Skill evaluator: evaluates changes
freecad_ai/tools/optimize_tools.py - Skill optimizer → LLM client: requests revisions
freecad_ai/tools/optimize_tools.py - Skill evaluator → Tool registry: runs evaluation tools
freecad_ai/extensions/skill_evaluator.py - Chat dock → Lifecycle hooks: runs lifecycle hooks
freecad_ai/ui/chat_widget.py - Settings UI → User tools: configures tools