Skip to content

ghackenberg/agentbrick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentBrick - From Chat to CAD

AgentBrick Logo

AgentBrick is an open-source framework designed to bridge the gap between natural language and the LDraw standard. By leveraging LangChain agents and LangGraph workflows, AgentBrick transforms user prompts into valid, structured LDraw models, allowing for iterative refinement through conversational AI.

User guide

from agentbrick.workflows import main_workflow

main_workflow.invoke({
  "prompt": "House", # Initial model description
  "size_x": 5, # Size of the target voxel grid in x direction
  "size_y": 5, # Size of the target voxel grid in y direction
  "size_z": 5  # Size of the target voxel grid in z direction
})

Main workflow

Step 1: Model Description

Based on the initial user input (including the size of the discrete voxel grid), the agent derives a detailed description of the target model.

flowchart LR
  Promt["Prompt"] --> LLM
  Size["Grid size (x, y, z)"] --> LLM
  LLM --> Description["Detailed model description"]
  
  LLM@{ shape: cloud }
Loading

Step 2: Component Graph

Then, the agent extracts a list of logical components (i.e. groups of connected voxels) and their interfaces with other components (i.e. voxels).

Step 2.1: Extract components

flowchart LR
  Promt["Prompt"] --> LLM
  Size["Grid size (x, y, z)"] --> LLM
  Description[Detailed model description] --> LLM
  LLM --> Components[List of components]

  LLM@{ shape: cloud }
Loading

Step 2.2: Extract interfaces

flowchart LR
  Promt["Prompt"] --> LLM
  Size["Grid size (x, y, z)"] --> LLM
  Description[Detailed model description] --> LLM
  Components[List of components] --> LLM
  LLM --> Interfaces[List of interfaces]

  LLM@{ shape: cloud }
Loading

Step 2.3: Visualize components and interfaces

Step 3: Voxel Model

Finally, the agent iterates over the individual voxels of the voxel grid and determines the contents of each voxel (i.e. empty or assigned to component).

Step 3.1: Define voxel model

flowchart LR
  subgraph X["Define voxel content"]
    direction LR
    Promt["Prompt"] --> LLM
    Size["Grid size (x, y, z)"] --> LLM
    Description[Detailed model description] --> LLM
    Components[List of components] --> LLM
    Interfaces[List of interfaces] --> LLM
    Grid[Current voxel model] --> LLM
    Cell["Next voxel coordinate (x, y, z)"] --> LLM
    LLM --> Content["Voxel content (empty | component)"]
  end

  X --repeat--> X

  LLM@{ shape: cloud }

  style Cell white-space:nowrap;
  style Content white-space:nowrap;
Loading

Step 3.2: Visualize voxel model

Project structure

Developer guide

Install dependencies

pip install -r requirements.txt

Linting

black .

Static type checking

pyright

About

Build and refine LDraw models using LangChain agents and LangGraph workflows.

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages