name: neatlogs-py-agno
description: Use when adding neatlogs observability to a Python project that uses the Agno agent framework (imports agno, constructs Agno Agents).
compatibility: Neatlogs Wizard Agent
metadata:
author: neatlogs
version: "1.0"
language: python
framework: agno
Neatlogs Python Setup — Agno
This project uses Agno (agno.agent.Agent, Team, Workflow). Neatlogs instruments it with neatlogs.wrap(agent).
Core mechanism — neatlogs.wrap(entity)
neatlogs.wrap() patches run/arun (incl. streaming) on the Agent/Team/Workflow and installs class-level model (LLM) + tool (TOOL) hooks. Span tree:
AGENT / TEAM / WORKFLOW (run / arun, incl. streaming)
↳ LLM (model invocation)
↳ TOOL (each tool call)
Combine with @neatlogs.span / neatlogs.trace / neatlogs.log for your own orchestration.
Steps
- Install →
references/1-install.md - Add init() →
references/2-add-init.md - Set environment variables →
references/3-set-env.md - Wrap the Agent with neatlogs.wrap() →
references/4-wrap-agent.md - Add @span / trace / log to orchestration →
references/5-spans-trace-log.md - Lifecycle (flush/shutdown) →
references/6-flush-shutdown.md
Rules (apply to ALL steps)
neatlogs.init()MUST run BEFORE importingagno(class-level model/tool hooks patch at import time).load_dotenv()runs beforeinit().- Wrap each Agent/Team/Workflow you want traced:
agent = neatlogs.wrap(agent). Returns the same instance. wrap()creates the AGENT/LLM/TOOL spans — do NOT also wrap a singleagent.run()in@span/trace. Use@spanfor YOUR orchestration only.- Never hardcode API keys — use
os.getenv(). import neatlogsat module top level.
Reference
- Combining wrap() with @span/trace/log →
references/5-spans-trace-log.md - Span kinds reference →
references/span-kinds.md