- 이 성과는 2025년도 과학기술정보통신부의 재원으로 정보통신기획평가원의 지원을 받아 수행된 연구임(
IITP-2025-SW마에스트로과정) - This work was supported by the Institute of Information & Communications Technology Planning & Evaluation(IITP) grant funded by the Ministry of Science and ICT(MSIT) (
IITP-2025-SW Maestro Training course)
스타트업이 빠르게 AWS Well-Architected 베이스라인을 생성
사용자의 자연어 질의를 받아서 인프라 아키텍처를 설계
- 각자에게 알맞는 인프라 설계에 대한 뚜렷한 벤치마크나 기준이 없기 때문에 실험과 시행착오를 통해 직접 최적화 필요
- 인프라 설계 오류는 즉시 드러나지 않을 가능성이 있고, 난이도가 있기 때문에 장애 대응이 어려움
- 클라우드 제공업체와 서드파티 리소스의 지속적인 업데이트로 인해 변화하는 성능에 맞추어 대응하기 어려움
- API server: 클라이언트 요청을 받아 비즈니스 로직 처리
- Agent server: AI Agent 기반 workflow 처리
- SSE server: 클라이언트와 sse 실시간 통신 기반 챗봇 처리
- Monitoring server: 클라이언트의 AWS 인프라 리소스 모니터링 처리
- k8s manifests: ArgoCD 기반 전체 서비스 인프라 처리
- Zipkin-server: 각 서버간의 분산 트랜잭션 추적
- Redis-server: 메시징을 위한 키 캐시와 메시지 채널을 위한 메시지 큐
-
사용자의 채팅 요청을 수신하는 경우
Redis Streams기반 통신- 채팅 요청은 누락되거나 소실된 경우 재처리 필요
- 메시지 처리 순서 보장이 필요
- 멀티 인스턴스 환경에서 한번만 처리 필요
-
LLM 결과는 스트림 형식으로
Redis Pub/Sub기반 사용자 클라이언트에 즉시 전송- 실시간 통신 필요
- 멀티 인스턴스 환경에서 메시지 내 포함된
client id기반으로 해당 커넥션 보유 인스턴스만 메시지 처리
- LangGraph State
class State(TypedDict):
messages: Annotated[list, add_messages]
scripts: Annotated[list, add_messages]
srs: Annotated[list, add_messages]
hld: Annotated[list, add_messages]
code: Annotated[list, add_messages]
max_iteration: int
iteration: int
account_id: str
project_id: str
chat_id: str
conversation_id: str- LangGraph Workflow
workflow = StateGraph(State)
workflow.add_node("DevOps Consultant", devops_consultant_agent.information_gathering)
workflow.add_node("Prompt Generator", devops_consultant_agent.conclude_conversation)
workflow.add_node("DevOps Engineer", devops_engineer_agent.generate_scripts)
workflow.add_node("DevOps Lead", devops_lead_agent.approver)
workflow.add_edge(START, "DevOps Consultant")
workflow.add_conditional_edges(
"DevOps Consultant",
devops_consultant_agent.is_clarified,
{"yes": "Prompt Generator", "no": END}
)
workflow.add_edge("Prompt Generator", "DevOps Engineer")
workflow.add_conditional_edges(
"DevOps Lead",
devops_lead_agent.is_approved,
{"approved": END, "enhance": "DevOps Engineer"}
)
workflow.add_edge("DevOps Engineer", "DevOps Lead")
graph = workflow.compile(checkpointer=memory)- 사용자의 질의를 받아서
Terraform코드생성 - 기본적인 리소스에 대해서만 가능(모든 리소스를 한번의 질의로 생성)
- 초기버전은 문법 오류와 오랜 지연 시간 문제 발생
- LangGraph State
class Config(TypedDict):
ticket: str
account_id: str
project_id: str
chat_id: str
chat_message_id: str
class Trace(TypedDict):
trace_id: str
span_id: str
sampled: str
class State(TypedDict):
config: Config
trace: Trace
messages: Annotated[list, add_messages]
scripts: list
gathered_requirements: dict
resource_plan: dict
terraform_validated: bool
validation_output: str
final_script: str
final_response: str- LangGraph Workflow
workflow = StateGraph(State)
workflow.add_node("route", self.router_agent.invoke)
workflow.add_node("requirement_gatherer", self.requirement_gatherer_agent.invoke)
workflow.add_node("resource_planner", self.resource_planner_agent.invoke)
workflow.add_node("level_executor", self.level_based_executor.invoke)
workflow.add_node("resource_combiner", self.resource_combiner_agent.invoke)
workflow.add_node("terraform_fixer", self.terraform_fixer_agent.invoke)
workflow.add_node("invalid_request", self._handle_invalid_request)
workflow.set_entry_point("route")
workflow.add_conditional_edges(
"route",
self.router_agent.route_decision,
{
"terraform_generator": "requirement_gatherer",
"invalid": "invalid_request",
"end": END
}
)
workflow.add_conditional_edges(
"requirement_gatherer",
self.requirement_gatherer_agent.after_gathering_decision,
{
"complete": "resource_planner",
"end": END
}
)
workflow.add_edge("resource_planner", "level_executor")
workflow.add_edge("level_executor", "resource_combiner")
workflow.add_edge("resource_combiner", "terraform_fixer")
workflow.add_edge("terraform_fixer", END)
graph = workflow.compile(checkpointer=memory)- 사용자에게 필요한 정보를 재요구(
UI/UX Negotitaion) - 올바르지 않은 입력 처리(
Guard) - 리소스 별로 요구사항에 맞게 병렬로 각각 생성
- 문법 오류 방지 및 검토
Zipkin기반 분산 트랜잭션 추적
- 기존 AWS 인프라를 자동으로 스캔하고 시각적 다이어그램으로 변환
Terraformer오픈소스를 활용해서 인프라 리소스를Terraform으로 추출- LLM을 활용해서 렌더링 가능한 구조로 변환
- 클라이언트 측에서
WASM엔진으로 인터랙티브한 다이어그램 생성
- 인프라 코드의 버전관리와 변경 이력 추적 제공
- 사용자의 Github OAuth 연동을 통해 사용자 계정으로 직접 관리 가능
- 자연어를 통해 LLM 소통
UI/UX Negotitation을 활용한 사용자 정보 수집- 수집한 정보를 토대로 IaC 인프라 설계
- 사용자가 프로젝트 생성시 등록한 AWS 계정 리전을 스캔
- 프로젝트 식별 태그 여부를 확인, 이후 태그 생성 및 수정 관리 가능
- 자동 스캔 또는 선택적 일괄 태그 적용 가능
- 자동 스캔 대상: VPC 내부(EC2, RDS, Lambda), S3, ElastiCache, 네트워크 리소스(ELB, NAT Gateway) 등
- 사용자 인프라 리소스에 대한 메트릭을 수집
- 수집한 메트릭을 기반으로 LLM 인사이트 제공