[Week 1] StateGraph를 활용하여 알고리즘 도메인 특화 ReAct Agent 설계 및 구현#1
Open
pykido wants to merge 3 commits into
Open
Conversation
myeolinmalchi
requested changes
May 5, 2026
Member
myeolinmalchi
left a comment
There was a problem hiding this comment.
태윤님 너무 잘 봤습니다!
ipynb로 작성해주신건 좋은데, 나중에 고도화를 하기 위해선
파이썬 모듈로 작성을 해주시면 좋을 것 같아요
공식 문서 참고하셔서 폴더 구조 러프하게 세팅해서 커밋해주시면 감사하겠습니다!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
도메인 / 목표
create_agent같은 helper 없이StateGraph로 직접 ReAct loop 구성하였습니다.그래프 흐름 (노드/엣지)
flowchart TD START([START]) --> agent agent -->|tool_calls| tools[tools / ToolNode] agent -->|tools_condition: END→remap| format_answer[format_answer / with_structured_output] tools --> agent format_answer --> END([END])agent—bind_tools된 LLM, 도구 호출 여부 결정tools— 강의 06번대로langgraph.prebuilt.ToolNodetools_condition의END출구를 path_map 으로format_answer에 remapformat_answer—with_structured_output(ReActAnswer)로 Pydantic 정규화class AgentState(MessagesState): final_answer: Optional[ReActAnswer](강의 04번 패턴)도구
get_algorithm_pattern(name)recommend_problems(topic, level, problem_id)review_solution(problem_id, user_code)review_solution은 코드를 직접 채점하지 않고 rubric 만 반환한 뒤, LLM 이 user_code vs rubric 비교 (RAG 의 retrieval+generation 분리 결)응답 스키마: Pydantic
ReActAnswer(answer, used_tools, sources, confidence)테스트 4개 (노트북에 출력 박혀 있음)
get_algorithm_patternrecommend_problems(topic, level)pgs-43238 입국심사review_solutionO(max_t × M)원인 진단 → 이분 탐색O(M log(...))정답 코드 제시get_algorithm_pattern+recommend_problems병렬pgs-67258 보석 쇼핑통합