LangChain 핵심 구성 요소 해설
LLM, 프롬프트, 체인, 에이전트를 포함한 LangChain의 핵심 구성 요소와 이들이 상호작용하는 방식을 배웁니다.
LangChain 핵심 구성 요소 해설은(는) CoddyKit의 무료 AI Agents with LangChain & Autonomous Workflows 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 AI Agents with LangChain & Autonomous Workflows 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. AI Agents with LangChain & Autonomous Workflows 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Welcome to LangChain Core!
Now meet LangChain, a framework for building agents. It gives you modular components you snap together like LEGO bricks.
The Brain: Large Language Models (LLMs)
The agent's brain is the LLM — a model trained on vast text to understand and generate language. LangChain makes it easy to plug into GPT or open-source models.
LLM in Action: A Simple Call
Here's a basic LLM call in LangChain, using a fake model so it runs without any API key.
from langchain_core.llms import FakeListLLM
# Our 'brain' that gives predefined answers
llm = FakeListLLM(responses=[
"The capital of France is Paris.",
"Hello! How can I help you today?"
])
# Ask the LLM a question
response = llm.invoke("What is the capital of France?")
print(response)Guiding the Brain: Prompts
An LLM needs instructions, and those are your prompts — the input text you feed it. Good prompts are crucial for getting the output you want.
Dynamic Prompts: Prompt Templates
For input that changes, use a prompt template: a reusable blueprint with placeholders you fill in at runtime.
from langchain_core.prompts import PromptTemplate
# Define a template with a placeholder '{topic}'
qa_template = """
Answer the following question about {topic}:
Question: {question}
"""
# Create a PromptTemplate object
prompt = PromptTemplate.from_template(qa_template)
# Format the prompt with specific values
formatted_prompt = prompt.format(
topic="Python programming",
question="What is a variable?"
)
print(formatted_prompt)Connecting Steps: Chains
Most agent tasks take several steps. A chain is a predefined sequence that wires LLMs, prompts, and utilities together, passing each output into the next step.
Building a Simple Chain
Here's a simple chain: a prompt template piped into an LLM using LangChain's Runnable interface. The prompt's output feeds straight into the model.
from langchain_core.llms import FakeListLLM
from langchain_core.prompts import PromptTemplate
# 1. Our 'brain'
llm = FakeListLLM(responses=["A variable is a named storage location."])
# 2. Our prompt template
qa_template = """
Explain {concept} in simple terms.
"""
prompt = PromptTemplate.from_template(qa_template)
# 3. Combine them into a chain using '|' operator
# The prompt output goes into the LLM as input
chain = prompt | llm
# Invoke the chain with the input for the template
response = chain.invoke({"concept": "variable"})
print(response)The Orchestrator: Agents
Chains run fixed steps; agents are dynamic. An agent decides which action to take, runs it, observes the result, and repeats until the goal is met.
How Agents Use Components
Agents tie it all together: LLMs for reasoning, prompts to guide thinking, chains for multi-step work, and tools to act on the real world.
Putting it All Together
Picture a smart assistant: a prompt sets the task, the LLM reasons, a chain processes input, and the agent picks a weather tool — then the LLM formats the answer.
Quick Check: Core Components
Which LangChain component is primarily responsible for dynamic decision-making and tool selection in an AI application?
Recap & Next Steps
Recap: the four LangChain building blocks — LLMs (the brain), prompts (instructions), chains (sequences), and agents (dynamic deciders). Next: build one.
자주 묻는 질문
“LangChain 핵심 구성 요소 해설” 강의는 무료인가요?
네 — “LangChain 핵심 구성 요소 해설” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 AI Agents with LangChain & Autonomous Workflows 강의 전체를 잠금 해제할 수 있습니다. AI Agents with LangChain & Autonomous Workflows 강의에는 총 4개의 강의가 포함되어 있습니다.
“LangChain 핵심 구성 요소 해설”에서 뭘 배우나요?
LLM, 프롬프트, 체인, 에이전트를 포함한 LangChain의 핵심 구성 요소와 이들이 상호작용하는 방식을 배웁니다. 브라우저에서 직접 실행하는 실습 코드로 AI Agents with LangChain & Autonomous Workflows을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
AI Agents with LangChain & Autonomous Workflows을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 AI Agents with LangChain & Autonomous Workflows은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.
“LangChain 핵심 구성 요소 해설” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 AI Agents with LangChain & Autonomous Workflows 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 AI Agents with LangChain & Autonomous Workflows 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 인공지능 에이전트와 LLM 이해하기
- LangChain 핵심 구성 요소 해설
- 첫 번째 간단한 에이전트 구축
- 에이전트에 메모리와 대화 상태 부여하기