This project was conducted by the Natural Language Processing Team 2 as part of the 2025 Fall modeling project at Data Science Lab, Yonsei University.
λ³μ μμ½ μμ€ν μ μν LangGraph κΈ°λ° Multi-Agent Chat Systemμ λλ€.
| Cohort | Members |
|---|---|
| 12th | Eunhee Kim, Kunwoo Kim |
| 13th | Sehyun Park (Leader) |
| 14th | Dongjun Shin, Junho Yeo |
# 1. Install dependencies
pip install -r requirements.txt
pip install langgraph-cli
# 2. Set up environment variables
cp env_example.txt .env
# Edit .env file with your API keys (OPENAI_API_KEY, TAVILY_API_KEY, etc.)
# 3. Start the RAG server (in first terminal)
cd rag_doctor_agent && python a2a_wrapper.py
# 4. Run LangGraph (in second terminal)
cd ../ && langgraph dev
# 5. (Optional) Use custom chat interface (in third terminal)
# LangGraph Studio UI automatically launches in the browser when you run `langgraph dev`
# But you can also use the custom terminal interface:
python chat_interface.pyμ μ μ 보:
- LangGraph Studio UI:
http://localhost:8123(μλμΌλ‘ λΈλΌμ°μ μμ μ΄λ¦Ό) - Chat Interface: ν°λ―Έλμμ
python chat_interface.pyμ€ν
μ¬μ©μ μ
λ ₯
β
μμ΄μ νΈ1(κ΄λ¦¬μ) π―
ββ μμ½ κ΄λ ¨ β μμ΄μ νΈ2(μμ½) π
ββ μ¦μ-μλ£μ§ λ§€ν β μμ΄μ νΈ3(RAG) π§
ββ λ³μ μ 보 β Tavily κ²μ ν΄ π
μμ΄μ νΈ2(μμ½) π
ββ μ¬μ©μ μ 보 μμ§ (LLM κΈ°λ°)
ββ μ¦μ μμ§ β μμ΄μ νΈ3 νΈμΆ
ββ Supabase ν΄λ€ (μ‘°ν/μμ±/λ³κ²½)
μμ΄μ νΈ3(RAG) π§
ββ κΈ°μ‘΄ rag_doctor_agent νμ©
medical_reservation_agent/
βββ chat_interface.py # π¬ ν°λ―Έλ μ±ν
μΈν°νμ΄μ€
βββ graph.py # π LangGraph μ§μ
μ
βββ langgraph.json # LangGraph Studio μ€μ νμΌ
βββ main/
β βββ agents/ # π€ μμ΄μ νΈλ€
β β βββ agent1_manager.py # κ΄λ¦¬μ μμ΄μ νΈ
β β βββ agent2_reservation.py # μμ½ μμ΄μ νΈ
β β βββ agent3_rag.py # RAG μμ΄μ νΈ
β βββ tools/ # π§ ν΄λ€
β β βββ tavily_search.py # Tavily μΉκ²μ ν΄
β β βββ supabase_mcp_tool.py # Supabase MCP ν΄
β βββ langgraph_workflow.py # LangGraph μν¬νλ‘μ° μ μ
β βββ langgraph_state.py # μν λͺ¨λΈ μ μ
βββ rag_doctor_agent/ # π§ RAG μλ²
β βββ a2a_wrapper.py # Agent-to-Agent λνΌ
β βββ main/ # RAG νμ΄νλΌμΈ
βββ test/ # π§ͺ ν
μ€νΈ νμΌλ€
.env νμΌ μμ± ν λ€μ API ν€λ€μ μ€μ νμΈμ:
νμ:
OPENAI_API_KEY: OpenAI API ν€ (LLM μ¬μ©)TAVILY_API_KEY: Tavily κ²μ API ν€ (λ³μ μ 보 κ²μ)
μ νμ¬ν:
LANGSMITH_*: LangSmith μΆμ (μν¬νλ‘μ° λλ²κΉ )- LangSmith κ³μ : https://smith.langchain.com/
SUPABASE_*: Supabase λ°μ΄ν°λ² μ΄μ€ (μμ½ κ΄λ¦¬)- Supabase νλ‘μ νΈμμ URLκ³Ό ν€ λ°κΈ
langgraph dev- λΈλΌμ°μ μμ μλμΌλ‘
http://localhost:8123μ΄λ¦Ό - κ·Έλν½ μΈν°νμ΄μ€λ‘ μν¬νλ‘μ° μκ°ν
- μ€μκ° λλ²κΉ λ° μΆμ κ°λ₯
python chat_interface.pyμ£Όμ κΈ°λ₯:
- π¬ μ€μκ° λν μΈν°νμ΄μ€
- π μΈμ κ΄λ¦¬ λ° μ»¨ν μ€νΈ μ μ§
- π§ μμ€ν
λͺ
λ Ήμ΄ (
/help,/status,/history,/saveλ±) - π― λ€μ€ ν΄ μμ½ νλ‘μ°
- πΎ λν μ μ₯/λΆλ¬μ€κΈ°
μ¬μ© μμ:
π€ μ¬μ©μ: μμ½νκ³ μΆμ΄μ
π€ μ΄μμ€ν΄νΈ: π **μμ½ μ 보 μμ§ μ€**
λλ½λ μ 보: νμλͺ
, μ νλ²νΈ
π€ μ¬μ©μ: νκΈΈλμ
λλ€. 010-1234-5678μ΄μμ
π€ μ΄μμ€ν΄νΈ: β
**μμ½ μ 보 μμ§ μλ£**
μ΄λ€ μ¦μμΌλ‘ μμ½νμλμ?
μμΈν μ¬μ©λ²: CHAT_GUIDE.md μ°Έκ³
# κ° μμ΄μ νΈ κ°λ³ ν
μ€νΈ
python test/test_agent1_routing.py # Agent1 λΌμ°ν
ν
μ€νΈ
python test/test_rag_agent.py # RAG Agent ν
μ€νΈ
# ν΅ν© ν
μ€νΈ
python test/test_full_system.py # μ 체 μμ€ν
ν΅ν© ν
μ€νΈ
python test/test_multi_turn_conversation.py # λ€μ€ ν΄ λν ν
μ€νΈ
python test/test_schedule_booking.py # μμ½ νλ‘μ° ν
μ€νΈ
# ν΄ ν
μ€νΈ
python test/test_tool_calling.py # Supabase MCP ν΄ ν
μ€νΈlanggraph dev μ€ν ν λΈλΌμ°μ μμ:
medical_reservationκ·Έλν μ ν- μν¬νλ‘μ° μκ°ν νμΈ
- κ° λ Έλλ³ μ€ν μν λͺ¨λν°λ§
- μ€μκ° λλ²κΉ
- μν : LLM κΈ°λ° μ¬μ©μ μ λ ₯ λΆμ λ° μ§λ₯ν λΌμ°ν
- λΆκΈ° λ‘μ§:
- μμ½ κ΄λ ¨ μμ² β μμ΄μ νΈ2(μμ½)
- μ¦μ-μλ£μ§ λ§€ν μμ² β μμ΄μ νΈ3(RAG)
- λ³μ μ 보 μμ² β Tavily κ²μ ν΄
- νΉμ§: ν둬ννΈ κΈ°λ° μλ λΆλ₯, LLMμ νμ©ν μ§λ₯ν νλ¨
- μν : LLM κΈ°λ° μμ½ κ΄λ ¨ λͺ¨λ μ²λ¦¬ (μμ±, νμΈ, μ·¨μ)
- κΈ°λ₯:
- ν둬ννΈ κΈ°λ° μ¬μ©μ μ 보 μμ§ (μ΄λ¦, μ±λ³, μ°λ½μ²)
- λλ½λ μ 보μ λν μΉμ ν μ¬μμ²
- μ¦μ μμ§ ν μμ΄μ νΈ3 νΈμΆ
- Supabase ν΄μ μ¬μ©ν μμ½ κ΄λ¦¬
- νΉμ§: LLMμ΄ μ¬μ©μ μ λ ₯μ μ΄ν΄νκ³ μ μ ν μλ΅
- μν : μ¦μμ κΈ°λ°μΌλ‘ μ μ ν μλ£μ§ μΆμ²
- κΈ°λ₯:
- κΈ°μ‘΄
rag_doctor_agentνμ© - μ¦μ λΆμ λ° μ§λ£κ³Ό λ§€ν
- μλ£μ§ μΆμ² λ° μ λ’°λ μ 곡
- κΈ°μ‘΄
- νΉμ§: κΈ°μ‘΄ RAG νμ΄νλΌμΈ μ¬μ¬μ©
- μ©λ: λ°λ₯Έλ§λλ³μ μΉμ¬μ΄νΈ(https://barunjoint.kr/) μ μ© κ²μ
- μ νμ¬ν: λ°λμ ν΄λΉ λλ©μΈμμλ§ κ²μ
- κ²μ μ ν: ν΄λ¬΄μΌ, μ΄μμκ°, μ°λ½μ², μμΉ λ±
- supabase_read_tool: μμ½ λ°μ΄ν° μ‘°ν (μ¬λ‘― μ‘°ν, νμ μμ½ λͺ©λ‘)
- supabase_create_tool: μ μμ½ μμ±
- supabase_update_tool: μμ½ μ 보 μμ
- supabase_delete_tool: μμ½ μ·¨μ
- νΉμ§: κ° μμ λ³λ‘ μ λ¬Ένλ λ³λ ν΄, ν둬ννΈ κΈ°λ° μλ μ ν
- μ¬μ©μ μ λ ₯ β μμ΄μ νΈ1(κ΄λ¦¬μ)
- μλ λΆμ β μ μ ν μμ΄μ νΈ/ν΄ μ ν
- λΌμ°ν
:
- μμ½ β μμ΄μ νΈ2 β νμμ μμ΄μ νΈ3 νΈμΆ β Supabase MCP ν΄
- μλ£μ§ μΆμ² β μμ΄μ νΈ3 β RAG νμ΄νλΌμΈ
- λ³μ μ 보 β Tavily κ²μ ν΄
- μλ΅ μμ± β μ¬μ©μμκ² κ²°κ³Ό μ λ¬
- β Multi-Agent Orchestration - 3κ° μμ΄μ νΈμ νμ μμ€ν
- β LangGraph μν¬νλ‘μ° - μν κΈ°λ° μν¬νλ‘μ° κ΄λ¦¬
- β RAG κΈ°λ° μλ£μ§ μΆμ² - μ¦μ λΆμ λ° μ μ ν μλ£μ§ λ§€ν
- β μ€μκ° μ±ν μΈν°νμ΄μ€ - ν°λ―Έλ λ° LangGraph Studio UI
- β μΈμ κ΄λ¦¬ - μ¬μ©μλ³ λν 컨ν μ€νΈ μ μ§
- β Supabase MCP ν΅ν© - μμ½ λ°μ΄ν° κ΄λ¦¬
- β Tavily μΉ κ²μ - λ³μ μ 보 μ€μκ° κ²μ
- β LangSmith μΆμ - μν¬νλ‘μ° λλ²κΉ λ° μ±λ₯ λΆμ
LangGraph Studioμμ μν¬νλ‘μ° μ€νμ μΆμ νκ³ λλ²κΉ ν μ μμ΅λλ€:
- LangSmith λμ보λ: https://smith.langchain.com
- λͺ¨λ LLM νΈμΆ, μμ΄μ νΈ μ€ν, λꡬ μ¬μ© μΆμ
- μ±λ₯ λΆμ λ° μ΅μ ν
κ° μμ΄μ νΈ μ€ν μ μμΈν λ‘κ·Έκ° μ½μμ μΆλ ₯λ©λλ€:
π― Agent1: μ¬μ©μ μλ λΆμ μ€...
π
Agent2: μμ½ μ 보 μμ§ μ€...
π§ Agent3: RAG κΈ°λ° μλ£μ§ μΆμ²...
β
μν¬νλ‘μ° μλ£
- CHAT_GUIDE.md: μ±ν μΈν°νμ΄μ€ μμΈ μ¬μ©λ²
- LANGGRAPH_STUDIO_SETUP.md: LangGraph Studio μ€μ κ°μ΄λ
- MCP_SERVER_SETUP.md: MCP μλ² μ€μ λ°©λ²
- test/TEST_GUIDE.md: ν μ€νΈ μ€ν κ°μ΄λ
λ¬Έμ κ° λ°μνλ©΄ λ€μμ νμΈν΄μ£ΌμΈμ:
- λͺ¨λ μμ‘΄μ±μ΄ μ€μΉλμλμ§ νμΈ (
pip install -r requirements.txt) - RAG μλ²κ° μ€ν μ€μΈμ§ νμΈ (
python rag_doctor_agent/a2a_wrapper.py) - νκ²½ λ³μκ° μ¬λ°λ₯΄κ² μ€μ λμλμ§ νμΈ (
.envνμΌ) - LangGraph Studioμμ μν¬νλ‘μ° μν νμΈ
- LangSmithμμ μλ¬ λ‘κ·Έ νμΈ
This project is part of the Data Science Lab, Yonsei University modeling project.