File size: 2,116 Bytes
bb8104d
1cb1196
bb8104d
 
 
 
 
 
 
 
 
 
1cb1196
bb8104d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Description - 

InfraResilience Agent is a Memory + Chain-of-Thought + Persona (MCP) powered LangChain agent designed for infrastructure modernization and resilience test planning.
It accepts a description of a legacy technology stack and an optional outage scenario, then generates:

Modernization Plan β€” technology upgrades, migration paths, best practices

Resilience Strategy β€” test scenarios, fault-injection drills, disaster recovery ideas

Reasoning Summary β€” short, human-readable rationale

Features - 

MCP: Conversation memory for multi-turn context

LangChain Agent: Tool-using agent with deterministic helpers

Toolbelt Included:

Modernization suggestions

Event decoupling (SQS/SNS)

API hardening (Gateway/WAF)

Caching strategies (Redis/ElastiCache)

Resilience drills (Oracle, Kafka, S3, Redis)

FastAPI HTTP interface for easy integration

Reusable template for agentic AI projects

Example Input:

{
  "legacy_stack": {
    "scheduler": "Autosys",
    "language": "Java 8",
    "architecture": "monolith",
    "dependencies": ["Oracle DB", "FTP transfer"],
    "use_case": "end-of-day batch risk reporting"
  },
  "outage_scenario": "Oracle DB unavailable for 30 minutes"
}
Example Output:

{
  "modernization_plan": [
    "Replace Autosys with Apache Airflow or AWS Step Functions",
    "Upgrade Java 8 β†’ Java 17 and containerize workloads",
    "Refactor monolith into microservices and add API Gateway"
  ],
  "resilience_strategy": [
    "Test RDS Multi-AZ failover for Oracle DB",
    "Implement circuit breaker on DB calls",
    "Run DR simulation and validate RTO/RPO"
  ],
  "reasoning_summary": "Legacy stack has aging orchestration, outdated language, and tight coupling..."
}
Quick Start
Install dependencies:


pip install fastapi uvicorn langchain langchain-openai openai pydantic
Export your LLM API key:


export OPENAI_API_KEY=sk-...
Run API:

uvicorn main:app --reload --port 8000
POST to /analyze-stack with JSON payload.

Project Structure
agent.py    β†’ LangChain agent w/ MCP + CoT
tools.py    β†’ Modernization + resilience toolbelt
main.py     β†’ FastAPI HTTP API