Inspiration
The inherent complexity of creating accurate Feynman diagrams presents a significant barrier to entry for many in the fields of particle physics education and research. Our project was motivated by the need to streamline this process, enabling users to generate precise visual representations through a simple, natural language interface. This initiative leverages the Google Agent Development Kit to explore a novel multi-agent architecture for scientific applications.
What it does
Our Feynman diagram Agent is a sophisticated, multi-agent AI framework built on the Google Agent Development Kit. It serves as an intelligent bridge, transforming a user's natural language input—like "electron-positron annihilation producing two photons"—directly into ready-to-use, compilable TikZ-Feynman LaTeX code. The system's innovative design employs a team of six specialized agents who work together to guarantee that every generated diagram is both physically correct and technically flawless. It verifies interactions against the Particle Data Group database, leverages a curated library of over 150 examples, and features a robust self-correction mechanism with up to three refinement attempts, ensuring a remarkable 95%+ success rate.
How we built it
We architected a sophisticated multi-agent system using Google's Agent Development Kit (ADK) 1.0.0 with Gemini 2.0 Flash as the core language model. The system integrates six specialized agents: PlannerAgent: Natural language parsing KBRetrieverAgent: Vector-based knowledge search using Annoy indexing PhysicsValidatorAgent: Physics rule enforcement via Model Context Protocol (MCP) DiagramGeneratorAgent: TikZ code generation TikZValidatorAgent: Syntax checking only for TikZ-Feynman code (not full compilation) FeedbackAgent: Result synthesis and iterative refinement
Challenges we ran into
LaTeX Complexity: TikZ-Feynman syntax validation required building a robust local compilation environment with detailed error parsing and reporting mechanisms. Physics Accuracy: Balancing comprehensive validation with runtime efficiency required careful design of MCP server calls and local rule checks. Multi-Agent Coordination: Optimal sequencing and inter-agent communication was non-trivial; sequential validation loops significantly outperformed parallel processing. Unrelated Histories: Integrating multiple Git branches from divergent development cycles created merge complexity.
Accomplishments that we're proud of
Industry-First Implementation: First known scientific use of Google’s ADK, pioneering multi-agent collaboration in physics tooling Exceptional Reliability: 95%+ success rate for LaTeX-validated diagram generation Physics Integration: Real-time validation using PDG data through custom MCP protocols Performance Excellence: Sub-30s generation for multi-particle diagrams with high code quality
What we learned
Multi-Agent Architecture: Sequential execution with validation loops yields better results for technical generation (95% vs 70% success rate over parallel) Vector Search Optimization: Using curated example databases with semantic retrieval drastically reduces hallucinations MCP Protocol Advantages: Provides clean standardization for connecting physics databases and logic validation tools Error Recovery Systems: Iterative auto-correction mechanisms greatly enhance robustness and UX Scientific AI Viability: With authoritative data and modular logic, AI agents can effectively handle specialized domains
What's next for Feynman diagram
Expanded Physics Domains: Add support for decay chains, nuclear interactions, energy level diagrams, etc. Interactive Capabilities: Build real-time diagram editing and collaborative tooling Research Integration: Enable batch generation for publications and automated figure embedding for arXiv/journal workflows Educational Platform: Launch step-by-step explanation modules and curriculum integration for teaching Community Expansion: Open-source more components, develop additional MCP servers, and help standardize physics-AI interoperability
Log in or sign up for Devpost to join the conversation.