---
config:
layout: dagre
look: neo
theme: redux
---
flowchart TD
subgraph Inputs["⚡ DATA NEXUS"]
Z{{"Input Agent"}}
Web{{"World Wide Web"}}
WikiSearch{{"Tavily Search"}}
DuckDuckGo{{"DuckDuckGo"}}
Newspaper4k{{"Newspaper4k"}}
SocialMedia{{"Social Media"}}
end
subgraph Analyst_Group["🔬 ANALYSIS MATRIX"]
C[/"Sustainability Assessment"/]
D[/"Sourcing Cost Analysis"/]
E[/"Logistics Evaluation"/]
F[/"Consumer Behavior Insights"/]
R[/"Regulatory Compliance"/]
P[/"Production Cost Modeling"/]
end
subgraph Processors["⚙️ CORE ENGINES"]
A[("Product Compatibility")]
B[("Materials Database")]
G[("Orchestration Layer")]
end
subgraph Explainability["🧠 NEURAL SYNTHESIS"]
EX(["Reasoning & Insights Generator"])
end
subgraph Details["📊 ANALYTICS DASHBOARD"]
Scores>"Performance Metrics"]
Tradeoffs>"Comparative Analysis"]
RegNotes>"Regulatory Intelligence"]
end
subgraph Outputs["🚀 SOLUTION MATRIX"]
H>"Top K Materials"]
Details
ResultsDB[("Knowledge Vault")]
end
Web -- User Intent Vector --> WikiSearch & DuckDuckGo & Newspaper4k & SocialMedia
WikiSearch -- Regulatory Corpus --> R
DuckDuckGo -- Market Pulse Data --> G
Newspaper4k -- Trend Signals --> G & E & F & D
SocialMedia -- Sentiment Vectors --> F
Z -- Core User Input --> A
A -- Material Compatibility Matrix --> B
B == Material Properties ==> C & D & E & F & R & P
C -- Sustainability Index --> G
D -- Cost Vectors --> G
E -- Logistics Metrics --> G
F -- Market Acceptance Probability --> G
P -- Production Feasibility Score --> G
R -- Compliance Risk Profile --> G
C --> SharedKB[("Shared Knowledge Base")]
D --> SharedKB
E --> SharedKB
F --> SharedKB
R --> SharedKB
P --> SharedKB
A --> SharedKB
SharedKB --> G & EX
G == Optimized Material Ranking ==> H
G -- Historical Pattern Storage --> ResultsDB
G <-. Contextual Framework .-> EX
H -- Performance Vectors --> Scores
H -- "Trade-off Matrix" --> Tradeoffs
H -- Regulatory Landscape --> RegNotes
EX -. Neural Feedback Loop .-> G
- Overview
- Key Innovations
- Architecture & Components
- Installation
- Usage
- Output Structure
- Error Handling & Resilience
- Contributing
- License
- Acknowledgments
This system is a LangGraph-driven, multi-agent orchestration for evaluating and ranking sustainable packaging materials. It integrates Google’s Gemini model for rich text reasoning, executes specialized tool calls, and produces slide-ready JSON reports with the help of Agno —automating end-to-end material selection across:
- 🌿 Environmental Impact
- 💰 Cost Analysis
- 📦 Logistics & Supply-Chain
- 👥 Consumer Behavior
- ⚖️ Regulatory Compliance
Innovative Self Context : Agno’s built-in Context store to declaratively share and merge structured agent state across parallel executions—allowing fine-grained, selective knowledge sharing—instead of multithreading’s manual, lock-based sharing of raw memory.
- LangGraph State Machine
Orchestrates flow using a directed graph of TypedDict states, transitions, and conditional branching. - Parallel Agent-Calling
Launches independent analysis agents concurrently (properties, logistics, cost, sustainability, consumer). - Parallel Tool-Calling
Uses Tavily,DuckDuckGo and Newspaper4k tools for enhanced research. - Gemini-Backed Prompting
Uses Google Gemini (v2.0-flash) for deep reasoning, withshow_tool_calls=Trueto trace tool invocations and aid debugging. - JSON-First Reporting
Each material summary is generated as a precise JSON schema—ideal for slides, dashboards, or APIs. - Dynamic Weighting & Scoring
The composite score calculation is guided by configurable weights, allowing users to prioritize specific goals—such as sustainability or cost-effectiveness. Normalized sub-scores and detailed breakdowns enhance transparency and explainability. - Regulatory Context Fetch
Live web-search integration to pull jurisdiction-specific regulation snippets for each material. - Robust Error Handling
Full error-capture, root-cause analysis via language model, and JSON error-reports for transparent troubleshooting. - Persistent Reporting
Automatically saves both “analysis” and “error” reports under a timestamped directory.
input.py- Asks for product name, location, target specs via CLI
- Validates & normalizes raw inputs
- Emits initial
AnalysisState.input_data
Product_compatibility.py- Evaluates material–product fit
- Checks basic constraints (e.g., mechanical, thermal compatibility)
- Populates
compatibility_analysis
MaterialDB_agent.py- Queries internal/external material catalogs
- Filters by compatibility criteria
- Returns candidate materials list
Each runs in parallel under a LangGraph “run_analyses” fork:
MaterialPropertiesAgent- Measures strength, barrier properties, thermal tolerance
LogisticCompatibilityAgent- Computes weight, bulk, transport losses
ProductionCostAgent- Estimates sourcing & manufacturing unit costs
EnvironmentalImpactAgent- Calculates carbon footprint, recyclability, biodegradability
ConsumerBehaviorAgent- Models market acceptance, packaging appeal
RegulationsAgent- Web-searches relevant directives (EU, FDA, BIS) via
show_tool_calls
- Web-searches relevant directives (EU, FDA, BIS) via
ExplainabilityAgent- Generates robust explanations with thinking tools.
Each module returns a standardized top-materials list with raw scores.
Orchestrator.py- Gathers all individual scores
- Applies configurable weights (default in code)
- Selects top-K materials by composite score
- For each, calls
generate_executive_summary():- Crafts a detailed prompt to Gemini
- Embeds original metrics, normalized scores, strategic bullets
- Injects regulatory snippet pulled from live search
- Parses the JSON response back into Python
- LangGraph Workflow
process_input → analyze_product_compatibility → query_material_database- If materials found → fork into 5 analysis nodes → join → orchestrate
- Else/Error → error handler node
- Slide-Ready JSON
- Schema includes:
executive_snapshotcomposite_score(raw + normalized + weighted)strengths&trade_offssupply_chain_implications&consulting_recommendationregulatory_contextsnippet
- Schema includes:
- File Saving
- Writes to
temp_KB/reports/analysis_report_<timestamp>.json - Error reports likewise saved with clear statuses
- Writes to
- Clone repo
pip install -r requirements.txt- Create
.envwithGOOGLE_API_KEY=… - Ensure directories:
mkdir -p temp_KB/reports logs
python main.pyFollow prompts for product name & location
Watch parallel tool-calls and state transitions in logs
Find JSON report in temp_KB/reports/
-Any node failure routes to handle_error
-LLM-driven root-cause analysis explains failures
-JSON error report saved alongside standard reports
-Logs include stack traces and tool-call histories
-Fork & branch
-Add tests for new agents or states
-Submit PR with clear changelog
-MIT © Blue Yonder Packaging Challenge
-LangGraph team for orchestration framework
Google Cloud for Gemini APIs
All open-source tool developers and community contributors
This expanded README surfaces your system’s novel features—parallel agent tool-calling, LangGraph state orchestration, LLM-driven JSON prompting, and robust error-handling with explanatory analysis—all in a slide- and API-friendly format. Let me know if you’d like any section refined!
{ "product_name": "SuperSnack Bar", "timestamp": "2025-05-09 21:04:45", "top_materials": [ { "material_name": "PLA Film", "composite_score": { /* 0–100 */ }, "strengths": [ /* … */ ], "trade_offs": [ /* … */ ], "supply_chain_implications": { /* … */ }, "consulting_recommendation": { /* … */ }, "regulatory_context": "EU Packaging Directive 94/62/EC excerpt…" } // … ], "report_path": "temp_KB/reports/analysis_report_2025-05-09_21-04-45.json" }