Agno는 memory, knowledge, reasoning을 갖춘 멀티 에이전트 시스템을 구축하기 위한 full stack framework
Agno를 사용하면 5단계 agent system을 만들 수 있다.
웹검색 Agent: 최신 뉴스 수집
재무 Agent: 주가 데이터 분석
리포트 Agent: 내용을 종합해 문서 작성
웹 뉴스 + 주식 데이터 + 분석을 합친 완성된 보고서 출력
사용자가 신고 접수 → 상태 저장 (step1)
사진 증거 검증 에이전트 실행 (step2)
규정과 대조해 보상 금액 산정 (step3)
최종 승인 및 결과 통보 (step4)
이 모든 과정이 정해진 순서와 조건에 따라 재현 가능하게 실행
주요 특징
추론을 구현하기 위해 세 가지 방법 지원
ReasoningTools를 붙여, 모델이 중간 사고 단계를 더 체계적으로 밟도록 유도사용자별 대회 맥락/선호/이전 결론을 저장해 다음 대화에 반영
JSON 형태 등 구조화된 결과 반환 가능
response_model={PydanticModel} 을 지정하면 됨use_json_mode=True 로 설정/docs (Swagger)에서 바로 호출/테스트하고, 운영, 배포까지 빠르게 할 수 있음http://localhost:8000/docs에서 바로 테스트 가능ag ws up으로 구동해 테스트 가능register_agent_routes(app, agent) 로 라우트 등록에이전트/팀/워크플로의 실시간 세션과 성능을 웹 대시보드 (app.agno.com)에서 확인할 수 있음
monitoring=True 라고 설정하면 에이전트의 세션이 대시보드에 올라감export AGNO_MONITOR=true 환경변수로 모든 에이전트의 모니터링을 활성화할 수도 있음pip install -U agno
# 1. Import
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
# 2. Agent 구성
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
tools=[DuckDuckGoTools()],
instructions="Use tables to display data. Don't include any other text.",
markdown=True,
)
# 3. 실행
agent.print_response("What is the stock price of Apple?", stream=True)
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
Agent: Agno의 핵심 객체. “모델 + 도구 + 지침”을 한 덩어리 에이전트로 묶음Claude: Anthropic의 LLM(여기선 claude-sonnet-4-20250514 모델)을 쓰기 위한 래퍼DuckDuckGoTools: DuckDuckGo 검색/뉴스를 실시간으로 조회하는 웹 도구Agno에서 제공하는 Tool
@tool 데코레이터 사용 또는 Toolkit 클래스를 상속해 만들 수 있음agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
tools=[DuckDuckGoTools()],
instructions="Use tables to display data. Don't include any other text.",
markdown=True,
)
model=Claude(...)id="claude-sonnet-4-20250514" : 사용할 Claude 버전tools=[...]DuckDuckGoTools(search=True, news=True) : 에이전트가 웹 검색/ 뉴스 검색을 수행하도록 함instructions="Use tables to display data." : 상위지침 가이드markdown=True : 에이전트 출력이 마크다운 형식임을 명시agent.print_response("What is the stock price of Apple?", stream=True)
DuckDuckGoTools 가 최신 뉴스 검색/요약stream=True: 모델의 토큰 생성 과정을 실시간으로 출력# 1. Import
from agno.agent import Agent
from agno.embedder.openai import OpenAIEmbedder
from agno.knowledge.url import UrlKnowledge
from agno.models.anthropic import Claude
from agno.storage.sqlite import SqliteStorage
from agno.vectordb.lancedb import LanceDb, SearchType
# 2. 지식베이스(RAG) 구성
knowledge = UrlKnowledge(
urls=["https://docs.agno.com/introduction.md"],
vector_db=LanceDb(
uri="tmp/lancedb",
table_name="agno_docs",
search_type=SearchType.hybrid,
# Use OpenAI for embeddings
embedder=OpenAIEmbedder(id="text-embedding-3-small", dimensions=1536),
),
)
# 3. 세션 저장소 설정
storage = SqliteStorage(table_name="agent_sessions", db_file="tmp/agent.db")
# 4. 에이전트 구성
agent = Agent(
name="Agno Assist",
model=Claude(id="claude-sonnet-4-20250514"),
instructions=[
"Search your knowledge before answering the question.",
"Only include the output in your response. No other text.",
],
knowledge=knowledge,
storage=storage,
add_datetime_to_instructions=True,
# Add the chat history to the messages
add_history_to_messages=True,
# Number of history runs
num_history_runs=3,
markdown=True,
)
# 5. 최조 인덱싱 + 실행
if __name__ == "__main__":
agent.knowledge.load(recreate=False)
agent.print_response("What is Agno?", stream=True)
knowledge.load()로 인덱스를 구축하고, 이후엔 주석 처리하여 재사용from agno.agent import Agent
from agno.embedder.openai import OpenAIEmbedder
from agno.knowledge.url import UrlKnowledge
from agno.models.anthropic import Claude
from agno.storage.sqlite import SqliteStorage
from agno.vectordb.lancedb import LanceDb, SearchType
Agent: Agno의 핵심 객체. “모델 + 도구 + 지침”을 한 덩어리 에이전트로 묶음OpenAIEmbedder: 임베딩 생성기UrlKnowledge: 지식베이스(RAG) 래퍼agno.knowledge에서는 url 외에도 csv, docx, langchain, pdf, text, markdown, webside, youtube 등을 지원함Claude: Anthropic의 LLM(여기선 claude-sonnet-4-20250514 모델)을 쓰기 위한 래퍼knowledge = UrlKnowledge(
urls=["https://docs.agno.com/introduction.md"],
vector_db=LanceDb(
uri="tmp/lancedb",
table_name="agno_docs",
search_type=SearchType.hybrid,
# Use OpenAI for embeddings
embedder=OpenAIEmbedder(id="text-embedding-3-small", dimensions=1536),
),
)
UrlKnowledge : 주어진 URL들의 콘텐츠를 다운로드 → 청크 분할 → 임베딩 → 벡터DB에 저장 하는 WrapperLanceDb: 로컬 벡터DBuri="tmp/lancedb" : 현재 프로젝트 폴더 아래 tmp/lancedb에 DB파일 생성table_name="agno_docs" : 테이블 이름. 같은 경로/이름이면 이후 실행에서 재사용함search_type=SearchType.hybrid : 하이브리드 검색 (키워드 + 벡터 유사도) 사용OpenAIEmbedder: 문서를 벡터화하는 모듈id="text-embedding-3-small" : OpenAI 임베딩 모델storage = SqliteStorage(table_name="agent_sessions", db_file="tmp/agent.db")
SqliteStorage : session/history/state를 로컬 SQLite로 저장db_file 을 사용하면 같은 세션을 이어갈 수 있음agent = Agent(
name="Agno Assist",
model=Claude(id="claude-sonnet-4-20250514"),
instructions=[
"Search your knowledge before answering the question.",
"Only include the output in your response. No other text.",
],
knowledge=knowledge,
storage=storage,
add_datetime_to_instructions=True,
# Add the chat history to the messages
add_history_to_messages=True,
# Number of history runs
num_history_runs=3,
markdown=True,
)
model=Claude(...)id="claude-sonnet-4-20250514" : 사용할 Claude 버전instrucuins=[...] : 상위 지침knowledge=knowledge : 위에서 만든 지식베이스(RAG)를 context 주입에 사용storage=storage : SQLite 세션 저장소 연결add_datetime_to_instructions=True : 시스템 지침에 현재 날짜/시간 포함add_history_to_messages=True, num_history_runs=3: 최근 3번의 history를 대화 메시지에 주입 → 맥락 유지markdown=True : 에이전트 출력이 마크다운 형식임을 명시if __name__ == "__main__":
agent.knowledge.load(recreate=False)
agent.print_response("What is Agno?", stream=True)
knowledge.load(recreate=False)print_response("What is Agno?", stream=True)stream=True 진행상황 바로바로 출력# 1. import
from agno.agent import Agent
from agno.memory.v2.db.sqlite import SqliteMemoryDb
from agno.memory.v2.memory import Memory
from agno.models.anthropic import Claude
from agno.tools.reasoning import ReasoningTools
from agno.tools.duckduckgo import DuckDuckGoTools
memory = Memory(
# Use any model for creating and managing memories
model=Claude(id="claude-sonnet-4-20250514"),
# Store memories in a SQLite database
db=SqliteMemoryDb(table_name="user_memories", db_file="tmp/agent.db"),
# We disable deletion by default, enable it if needed
delete_memories=True,
clear_memories=True,
)
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
tools=[
ReasoningTools(add_instructions=True),
DuckDuckGoTools(search=True, news=True),
],
# User ID for storing memories, `default` if not provided
user_id="ava",
instructions=[
"Use tables to display data.",
"Include sources in your response.",
"Only include the report in your response. No other text.",
],
memory=memory,
# Let the Agent manage its memories
enable_agentic_memory=True,
markdown=True,
)
if __name__ == "__main__":
# This will create a memory that "ava's" favorite stocks are NVIDIA and TSLA
agent.print_response(
"My favorite stocks are NVIDIA and TSLA",
stream=True,
show_full_reasoning=True,
stream_intermediate_steps=True,
)
# This will use the memory to answer the question
agent.print_response(
"Can you compare my favorite stocks?",
stream=True,
show_full_reasoning=True,
stream_intermediate_steps=True,
)
Memory
LLM이 문장을 분석 → 중요한 사실만 추출 → 표준 JSON 구조로 변환 → DB에 저장
"My favorite stocks are NVIDIA and TSLA"
{
"user": "ava",
"fact": "좋아하는 주식 = NVIDIA, TSLA",
"date": "2025-09-09"
}
ReasoningTools
ReasoningTools: 중간 사고 과정(계획/검증 등)을 잘 하도록 추론 보조 지침을 주입하는 툴ReasoningTools(add_instructions=True) : 추론 지침을 자동으로 prompt에 추가해 모델이 단계적을 사고하도록 함You have access to the `think` and `analyze` tools to work through problems step-by-step and structure your thought process. You must ALWAYS `think` before making tool calls or generating a response.
1. **Think** (scratchpad):
- Purpose: Use the `think` tool as a scratchpad to break down complex problems, outline steps, and decide on immediate actions within your reasoning flow. Use this to structure your internal monologue.
- Usage: Call `think` before making tool calls or generating a response. Explain your reasoning and specify the intended action (e.g., "make a tool call", "perform calculation", "ask clarifying question").
2. **Analyze** (evaluation):
- Purpose: Evaluate the result of a think step or a set of tool calls. Assess if the result is expected, sufficient, or requires further investigation.
- Usage: Call `analyze` after a set of tool calls. Determine the `next_action` based on your analysis: `continue` (more reasoning needed), `validate` (seek external confirmation/validation if possible), or `final_answer` (ready to conclude).
- Explain your reasoning highlighting whether the result is correct/sufficient.
## IMPORTANT GUIDELINES
- **Always Think First:** You MUST use the `think` tool before making tool calls or generating a response.
- **Iterate to Solve:** Use the `think` and `analyze` tools iteratively to build a clear reasoning path. The typical flow is `Think` -> [`Tool Calls` if needed] -> [`Analyze` if needed] -> ... -> `final_answer`. Repeat this cycle until you reach a satisfactory conclusion.
- **Make multiple tool calls in parallel:** After a `think` step, you can make multiple tool calls in parallel.
- **Keep Thoughts Internal:** The reasoning steps (thoughts and analyses) are for your internal process only. Do not share them directly with the user.
- **Conclude Clearly:** When your analysis determines the `next_action` is `final_answer`, provide a concise and accurate final answer to the user.