Skip to content

About

Final Project

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

68 Commits

Folders and files

Repository files navigation

Prompt2Mesh

AI-Powered 3D Modeling with Natural Language

Transform text prompts into 3D models using LangChain + LangGraph multi-agent system with Claude Sonnet 4.5 and Blender MCP.

🌐 Demo: http://a4492a6f36024441e8d6740b22fe8ee4-1878007781.us-east-1.elb.amazonaws.com:8501


πŸ—οΈ Architecture

Architecture Diagram

Multi-Agent System with Vision-Based Refinement:

Prompt Refinement Agent Workflow

Prompt Refinement Workflow

The Refinement Agent enhances user prompts with technical specifications before execution.

Artisan Agent Workflow (LangGraph)

Artisan Agent Workflow

The Artisan Agent autonomously plans, executes, and refines 3D modeling steps with vision-based quality assessment.


πŸš€ Quick Start - AWS EKS Deployment

Prerequisites

# Install required tools
winget install Amazon.AWSCLI
choco install eksctl
choco install kubernetes-cli

# Configure AWS credentials
aws configure

1. Create EKS Cluster

eksctl create cluster -f eks-cluster-config.yaml

2. Setup ECR & Build Images

# Create ECR repositories
.\infrastructure\ecr-setup.ps1

# Build and push Docker images
.\scripts\build-and-push-images.ps1

3. Deploy to Kubernetes

# Create namespace and secrets
kubectl create namespace prompt2mesh
kubectl create secret generic prompt2mesh-secrets -n prompt2mesh \
  --from-literal=db-password=<YOUR_PASSWORD> \
  --from-literal=jwt-secret=<YOUR_SECRET> \
  --from-literal=anthropic-api-key=<YOUR_KEY>

# Deploy all services
kubectl apply -f k8s/

4. Access Application

# Get LoadBalancer URL
kubectl get svc frontend -n prompt2mesh

Open the EXTERNAL-IP URL in your browser on port 8501.

πŸ“– Detailed Guide: See EKS Setup Guide for complete instructions.

✨ Key Features

πŸ€– LangChain + LangGraph Multi-Agent System

  • Artisan Agent: Autonomous 3D modeling with 8-node LangGraph workflow
  • Refinement Agent: Prompt enhancement with technical specifications with 5-node LangGraph workflow
  • Vision AI: Claude Sonnet 4.5 Vision for quality assessment
  • Iterative Refinement: Automatic quality scoring and improvement loops

πŸ”§ Technical Stack

  • LangChain: Tool abstraction over Blender MCP operations
  • LangGraph: StateGraph workflow with checkpointing
  • Claude Sonnet 4.5: Tool calling + vision analysis
  • Blender MCP: Model Context Protocol for Blender operations
  • Kubernetes: Per-user pod isolation on AWS EKS

🎯 Production Features

  • Multi-User: Isolated Blender pods per user
  • Persistent Storage: EBS volumes for user workspaces
  • Auto-Scaling: Dynamic resource allocation
  • Authentication: JWT-based user management
  • Cloud-Native: Full AWS EKS deployment

πŸ“‚ Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ artisan_agent/       # LangGraph autonomous modeling agent
β”‚   β”œβ”€β”€ refinement_agent/    # Prompt enhancement agent
β”‚   β”œβ”€β”€ backend/             # FastAPI + K8s session manager
β”‚   β”œβ”€β”€ frontend/            # Streamlit web interface
β”‚   └── addon/               # Blender MCP addon
β”œβ”€β”€ k8s/                     # Kubernetes manifests
β”œβ”€β”€ docker/                  # Docker configurations
β”œβ”€β”€ docs/                    # Comprehensive documentation
└── infrastructure/          # AWS/Terraform setup

πŸ“š Documentation

Core Documentation

Component Documentation

πŸ› οΈ Development

Local Testing with Docker Compose

cd docker
docker-compose up -d

Access: http://localhost:8501

Run Backend Locally

# Configure Python environment
python -m venv venv
.\venv\Scripts\activate
pip install -r requirements.txt

# Start FastAPI server
uvicorn src.backend.backend_server:app --reload

Run Frontend Locally

streamlit run src/frontend/streamlit_blender_chat.py

🎯 How It Works

1. User Submits Prompt

"Create a decorated Christmas tree"

2. Refinement Agent Enhances Prompt

"Create a 3D conical evergreen tree (height 5m, base 1.5m),
add 20 sphere ornaments in red/gold/silver, star topper at apex"

3. Artisan Agent Executes (LangGraph Workflow)

analyze_scene β†’ plan (5-12 steps) β†’ execute_step β†’ capture_screenshot
β†’ assess_quality (Claude Vision scores 1-10)
β†’ refine_step (if score < 6) β†’ evaluate_progress β†’ complete

4. Vision-Based Refinement Loop

  • Each step scored by Claude Sonnet 4.5 Vision
  • Quality threshold: β‰₯6 (normal steps), β‰₯7 (critical steps)
  • Max 2 refinement attempts per step
  • Automatic improvement code generation

5. Final Output

  • Fully modeled 3D asset in Blender
  • Saved .blend file with execution logs
  • Quality scores and refinement history

πŸ” Example Workflow

# 1. User prompt
user_input = "Create a medieval castle tower"

# 2. Refinement Agent
refined_prompt = refinement_agent.refine(user_input)
# Output: "Create cylindrical stone tower (height 15m, radius 3m),
#          crenellated top, 4 narrow window slits, wooden door..."

# 3. Artisan Agent (LangGraph)
result = artisan_agent.invoke({
    "user_prompt": refined_prompt
})

# 4. Execution Steps (example)
# Step 1: Create cylinder β†’ Screenshot β†’ Quality: 8/10 βœ“
# Step 2: Add material β†’ Screenshot β†’ Quality: 5/10 β†’ Refine β†’ 7/10 βœ“
# Step 3: Create windows β†’ Screenshot β†’ Quality: 9/10 βœ“
# ...
# Complete: 8 steps, 2 refinements, avg quality 7.8/10

🎨 Example Results

Big Ben - London Clock Tower

Big Ben - London Clock Tower

Urban House

Urban House

Christmas Tree

Christmas Tree

🌟 Key Innovations

  • Vision-Based Quality Control: First autonomous 3D modeling system with screenshot analysis
  • Iterative Refinement: Self-improving agent that detects and fixes quality issues
  • State Checkpointing: Resume workflows after interruptions or rate limits
  • Multi-User Cloud Architecture: Scalable Kubernetes deployment with per-user isolation
  • Transparent Execution: Full MCP tool call logs and quality scores

⚠️ Challenges & Trade-offs

Recursion Limit vs Cost

  • Higher Recursion Limits (e.g., 50-100 iterations):

    • βœ… Better Results: More refinement attempts lead to higher quality 3D models
    • βœ… Complex Scenes: Can handle intricate multi-object compositions
    • ❌ High Cost: Each iteration calls Claude Sonnet 4.5 Vision API (screenshot analysis)
    • ❌ Extended Runtime: Quality assessment on every step increases execution time
  • Lower Recursion Limits (e.g., 15-25 iterations):

    • βœ… Cost-Effective: Fewer API calls reduce operational expenses
    • βœ… Faster Execution: Quicker turnaround for simple models
    • ❌ Limited Refinement: May terminate before achieving optimal quality
    • ❌ Incomplete Complex Scenes: Multi-step workflows may hit recursion limit

Production Recommendation: Configure recursion limits based on use case:

  • Demo/Testing: 15-20 iterations (cost-efficient)
  • Production Quality: 40-60 iterations (balanced)
  • High-Fidelity Work: 80-100 iterations (premium quality, higher cost)

Configure via max_iterations in LangGraph agent configuration.


πŸ“‹ Disclosures

Work Declaration

We attest that we haven't used any other students' work in our assignment and abide by the policies listed in the student handbook.

Team Contributions:

  • Reky George Philip: 50%
  • Mycline Shareena John Peter Kennedy: 50%

AI Usage Disclosure

This project extensively uses AI tools as core architectural components:

Claude Sonnet 4.5 (Anthropic API):

  • Tool Calling Agent: Powers the BlenderChatAgent for MCP tool orchestration
  • Vision API: Screenshot analysis and quality assessment (1-10 scoring)
  • Prompt Refinement: Enhances user prompts with technical specifications
  • Code Generation: Generates Blender Python code for 3D modeling operations
  • Iterative Refinement: Autonomous quality improvement and self-correction

LangChain + LangGraph:

  • Multi-agent workflow orchestration
  • State management and checkpointing
  • Tool abstraction layer over Blender MCP

Development Assistance:

  • GitHub Copilot: Code completion and boilerplate generation
  • Claude/ChatGPT: Documentation writing, debugging assistance, architecture design discussions

About

Final Project

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages