💡 Inspiration

As a final-year Mechanical Engineering student, I know firsthand that designing functional mechanical linkages—like windshield wipers, automated assembly arms, or conveyor mechanisms—requires hours of trial-and-error in CAD software like Solid Edge. Engineers must manually calculate transmission angles and ensure the geometry satisfies Grashof's theorem to avoid catastrophic jamming. I wanted to build an AI copilot that bridges the gap between natural language, visual sketches, and deterministic physics to automate this grueling process.

⚙️ What it does

KineForge AI is a multimodal Agent that translates text prompts and CAD sketches into mathematically verified, fully dimensioned mechanical linkages.

When a user asks for a specific motion (e.g., "Design a crank-rocker mechanism for a 300mm footprint"), the AI doesn't just hallucinate numbers. It extracts the boundary conditions and routes them through a custom physics engine to calculate the exact millimeter lengths required for the Crank, Coupler, Rocker, and Ground links.

📐 The Math Behind the Magic

KineForge utilizes Grashof's Theorem, a fundamental principle in kinematics which states that for a four-bar linkage to have at least one link capable of full continuous rotation, the sum of the shortest and longest links must be less than or equal to the sum of the remaining two links.

The AI's deterministic tool evaluates this inequality: $$S + L \le P + Q$$ Where:

  • $S$ = length of the shortest link
  • $L$ = length of the longest link
  • $P$ and $Q$ = lengths of the intermediate links

If the condition $S + L \le P + Q$ is satisfied, the AI synthesizes the exact dimensions required for either a Crank-Rocker or Double-Crank mechanism based on the user's footprint constraints.

🛠️ How we built it

  • The Brain: I utilized Google's Gemini 2.5 Flash model via the google-genai SDK, taking advantage of its Agent Tool-Calling and Multimodal Vision capabilities.
  • The Physics Engine: I wrote a custom Python script (kinematics_engine.py) that acts as a deterministic mathematical tool for the LLM to execute.
  • The UI: I built the frontend using Streamlit, heavily injecting custom CSS to bypass the default layout and create a sleek, dark-mode, enterprise-grade SaaS interface that mimics the official Gemini environment.

⚠️ Challenges we ran into

Integrating a stateless web framework (Streamlit) with stateful AI agent connections was a major hurdle. Every time a user submitted a prompt, the app would re-run and sever the API connection to Gemini, resulting in a "client has been closed" error. I overcame this by engineering a robust session-state management system that securely holds the genai.Client in memory across re-runs.

🏆 Accomplishments that we're proud of

I successfully built an AI tool that proves real-world, industrial value. Instead of building a generic text bot, KineForge actively solves a complex mechanical engineering problem by merging Generative AI with rigid-body kinematics.

📚 What we learned

I deepened my understanding of Agent Architecture, specifically how to write strict, deterministic Python tools that an LLM can reliably call to ground its answers in factual mathematics.

🚀 What's next for KineForge AI

The next step is to integrate the agent directly into CAD software APIs (like Solid Edge or AutoCAD). Instead of just outputting the dimensions on a web interface, KineForge will automatically generate the 2D sketches inside the user's CAD workspace!

Built With

  • google-gemini
  • google-genai-sdk
  • pillow
  • python
  • streamlit
Share this project:

Updates