Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 223 additions & 34 deletions 1_foundations/1_lab1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -96,9 +96,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Next it's time to load the API keys into environment variables\n",
"# If this returns false, see the next cell!\n",
Expand Down Expand Up @@ -141,9 +152,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OpenAI API Key exists and begins sk-proj-\n"
]
}
],
"source": [
"# Check the key - if you're not using OpenAI, check whichever key you're using! Ollama doesn't need a key.\n",
"\n",
Expand All @@ -159,7 +178,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -172,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -186,7 +205,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -197,9 +216,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2 + 2 equals 4.\n"
]
}
],
"source": [
"# And now call it! Any problems, head to the troubleshooting guide\n",
"# This uses GPT 4.1 nano, the incredibly cheap model\n",
Expand All @@ -216,7 +243,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -228,9 +255,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 18,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost?\n"
]
}
],
"source": [
"# ask it - this uses GPT 4.1 mini, still cheap but more powerful than nano\n",
"\n",
Expand All @@ -246,29 +281,52 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# form a new messages list\n",
"messages = [{\"role\": \"user\", \"content\": question}]\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 19,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Let's define:\n",
"\n",
"- \\( x \\) = cost of the ball (in dollars)\n",
"- The bat costs \\( x + 1.00 \\) dollars (since it's $1.00 more than the ball)\n",
"\n",
"The total cost is given as:\n",
"\\[\n",
"x + (x + 1.00) = 1.10\n",
"\\]\n",
"\n",
"Simplify:\n",
"\\[\n",
"2x + 1.00 = 1.10\n",
"\\]\n",
"\n",
"Subtract 1.00 from both sides:\n",
"\\[\n",
"2x = 0.10\n",
"\\]\n",
"\n",
"Divide both sides by 2:\n",
"\\[\n",
"x = 0.05\n",
"\\]\n",
"\n",
"**Answer:** The ball costs **5 cents**.\n"
]
}
],
"source": [
"# Ask it again\n",
"messages = [{'role': 'user', 'content': question}]\n",
"\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-4.1-mini\",\n",
" messages=messages\n",
")\n",
"\n",
"answer = response.choices[0].message.content\n",
"print(answer)\n"
"print(answer)"
]
},
{
Expand Down Expand Up @@ -318,29 +376,160 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 25,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Certainly! Below is a proposed **Agentic AI solution framework** specifically targeting the **Real-Time Disruption Management and Dynamic Recovery** pain-point in supply chain and logistics.\n",
"\n",
"---\n",
"\n",
"## Agentic AI Solution Framework: Autonomous Disruption Management Agent (ADMA)\n",
"\n",
"### 1. **Core Capabilities**\n",
"\n",
"- **Continuous Real-Time Monitoring:**\n",
" - Integrate with IoT sensors (vehicle GPS, warehouse robots), ERP systems, supplier portals, weather and geopolitical data feeds.\n",
" - Monitor key supply chain variables: shipment locations and statuses, inventory levels, production schedules, supplier performance metrics, external risk signals.\n",
"\n",
"- **Early Disruption Detection & Impact Analysis:**\n",
" - Use anomaly detection and predictive analytics to identify disruptions early (before visible delays).\n",
" - Evaluate cascading effects across suppliers, inventory nodes, transportation routes, and customer commitments.\n",
"\n",
"- **Dynamic Decision Making & Action Execution:**\n",
" - Autonomous multi-objective optimization balancing cost, service level, and speed.\n",
" - Trigger mitigation actions such as:\n",
" - Rerouting shipments via alternate carriers or transport modes.\n",
" - Adjusting inventory reorder points based on risk assessments.\n",
" - Engaging backup or alternative suppliers through automated negotiation protocols.\n",
" - Rescheduling production or warehousing tasks dynamically.\n",
" - Use reinforcement learning to improve decision policies from past disruption outcomes.\n",
"\n",
"- **Multi-Stakeholder Coordination:**\n",
" - AI-driven orchestration platform that communicates with all supply chain parties in real time.\n",
" - Automated stakeholder alerts, status updates, and collaborative adjustment proposals.\n",
" - Smart contracts or blockchain integration for trust and transparency between independent nodes.\n",
"\n",
"- **Learning & Adaptation:**\n",
" - Continually update models as new data arrives.\n",
" - Identify systemic supply chain vulnerabilities and recommend structural improvements.\n",
" - Provide scenario simulations to prepare for future disruptions.\n",
"\n",
"---\n",
"\n",
"### 2. **System Architecture**\n",
"\n",
"| Layer | Function |\n",
"|---------------------|-----------------------------------------------------------|\n",
"| **Data Integration** | Collects data from IoT devices, ERP, SCM systems, external APIs. |\n",
"| **Monitoring & Alerts** | Real-time data analytics, anomaly detection, and alert generation. |\n",
"| **Decision Engine** | AI planning, multi-objective optimization, negotiation agents. |\n",
"| **Execution & Communication** | Interfaces with logistics systems, suppliers, warehouses, transport providers; sends automated instructions and updates. |\n",
"| **Learning Module** | Reinforcement learning and predictive model updating. |\n",
"| **User Interface** | Dashboards for human supervisors to monitor, override, or analyze AI decisions. |\n",
"\n",
"---\n",
"\n",
"### 3. **Business Model**\n",
"\n",
"- **Target Customers:**\n",
" - Large manufacturers, retail chains, 3PL providers, industries with complex global supply chains (automotive, electronics, pharmaceuticals).\n",
"\n",
"- **Revenue Streams:**\n",
" - SaaS subscription for the ADMA platform with tiered pricing based on supply chain complexity.\n",
" - Implementation & integration consulting fees.\n",
" - Performance-based pricing tied to cost savings or service level improvements.\n",
" - Data insights and analytics reports as an add-on service.\n",
"\n",
"- **Value Proposition:**\n",
" - Minimize disruption costs by reducing delay times and overstock/stockout expenses.\n",
" - Increase supply chain agility and resilience.\n",
" - Reduce manual intervention and operational overhead.\n",
" - Improve customer satisfaction through reliable delivery commitments.\n",
"\n",
"- **Go-to-Market Strategy:**\n",
" - Pilot programs with key strategic customers to demonstrate ROI.\n",
" - Partnerships with ERP/SCM software vendors and 3PLs for integration.\n",
" - Thought leadership on supply chain resilience and AI-driven operations.\n",
"\n",
"---\n",
"\n",
"### 4. **Risks & Challenges**\n",
"\n",
"- Complexity of integrating heterogeneous data sources.\n",
"- Ensuring trust and transparency in autonomous decisions across stakeholders.\n",
"- Managing change resistance within organizations reliant on human decision-making.\n",
"- Handling failures or incorrect AI decisions – need for oversight and safe fallback mechanisms.\n",
"\n",
"---\n",
"\n",
"### 5. **Next Steps**\n",
"\n",
"- Develop a prototype focusing on critical disruption scenarios (e.g., transportation delays).\n",
"- Collect real-world data to train predictive models and simulate decision outcomes.\n",
"- Engage with target customers for requirements and pilot implementations.\n",
"- Design user interfaces emphasizing AI explainability and override capabilities.\n",
"\n",
"---\n",
"\n",
"Would you like me to help you with a detailed technical roadmap, a go-to-market plan, or a pitch deck for this solution?\n"
]
}
],
"source": [
"# First create the messages:\n",
"\n",
"messages = [{\"role\": \"user\", \"content\": \"Something here\"}]\n",
"question = \"Please choose a business area that might be worth exploring for an Agentic AI opportunity.\"\n",
"messages = [{\"role\": \"user\", \"content\": question}]\n",
"\n",
"# Then make the first call:\n",
"\n",
"response =\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-4.1-mini\",\n",
" messages=messages\n",
")\n",
"\n",
"# Then read the business idea:\n",
"\n",
"business_idea = response.\n",
"business_idea = response.choices[0].message.content\n",
"\n",
"# And repeat! In the next message, include the business idea within the message\n",
"\n",
"question = f\"Please present a pain-point in the {business_idea} industry.\"\n",
"messages = [{\"role\": \"user\", \"content\": question}]\n",
"\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-4.1-mini\",\n",
" messages=messages\n",
") \n",
"\n",
"pain_point = response.choices[0].message.content\n",
"\n",
"# And repeat! In the next message, include the business idea within the message"
"question = f\"Please propose an Agentic AI solution to the pain-point in the {business_idea} industry: {pain_point}\"\n",
"messages = [{\"role\": \"user\", \"content\": question}]\n",
"\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-4.1-mini\",\n",
" messages=messages\n",
") \n",
"\n",
"print(response.choices[0].message.content)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -359,7 +548,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
"version": "3.12.12"
}
},
"nbformat": 4,
Expand Down
Loading