Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 104 additions & 106 deletions docs/en/observability/neatlogs.mdx
Original file line number Diff line number Diff line change
@@ -1,134 +1,132 @@
---
title: Neatlogs Integration
description: Understand, debug, and share your CrewAI agent runs
description: Collaborative debugging and observability for your CrewAI agents
icon: magnifying-glass-chart
mode: "wide"
---

# Introduction

Neatlogs helps you **see what your agent did**, **why**, and **share it**.

It captures every step: thoughts, tool calls, responses, evaluations. No raw logs. Just clear, structured traces. Great for debugging and collaboration.

## Why use Neatlogs?

CrewAI agents use multiple tools and reasoning steps. When something goes wrong, you need context — not just errors.

Neatlogs lets you:

- Follow the full decision path
- Add feedback directly on steps
- Chat with the trace using AI assistant
- Share runs publicly for feedback
- Turn insights into tasks

All in one place.

Manage your traces effortlessly

![Traces](/images/neatlogs-1.png)
![Trace Response](/images/neatlogs-2.png)

The best UX to view a CrewAI trace. Post comments anywhere you want. Use AI to debug.

![Trace Details](/images/neatlogs-3.png)
![Ai Chat Bot With A Trace](/images/neatlogs-4.png)
![Comments Drawer](/images/neatlogs-5.png)

## Core Features

- **Trace Viewer**: Track thoughts, tools, and decisions in sequence
- **Inline Comments**: Tag teammates on any trace step
- **Feedback & Evaluation**: Mark outputs as correct or incorrect
- **Error Highlighting**: Automatic flagging of API/tool failures
- **Task Conversion**: Convert comments into assigned tasks
- **Ask the Trace (AI)**: Chat with your trace using Neatlogs AI bot
- **Public Sharing**: Publish trace links to your community

## Quick Setup with CrewAI

<Steps>
<Step title="Sign Up & Get API Key">
Visit [neatlogs.com](https://neatlogs.com/?utm_source=crewAI-docs), create a project, copy the API key.
</Step>
<Step title="Install SDK">
```bash
pip install neatlogs
```
(Latest version 0.8.0, Python 3.8+; MIT license)
</Step>
<Step title="Initialize Neatlogs">
Before starting Crew agents, add:

```python
import neatlogs
neatlogs.init("YOUR_PROJECT_API_KEY")
```

Agents run as usual. Neatlogs captures everything automatically.

</Step>
</Steps>



## Under the Hood

According to GitHub, Neatlogs:

- Captures thoughts, tool calls, responses, errors, and token stats
- Supports AI-powered task generation and robust evaluation workflows

All with just two lines of code.



## Watch It Work

### 🔍 Full Demo (4 min)
[Neatlogs](https://neatlogs.com/?utm_source=crewAI-docs) is a collaborative debugging workspace for AI agent teams. It captures every LLM call, tool invocation, token count, and latency and surfaces it all in a shared dashboard your whole team can search, comment on, and act from.

<iframe
className="w-full aspect-video rounded-xl"
src="https://www.youtube.com/embed/8KDme9T2I7Q?si=b8oHteaBwFNs_Duk"
title="NeatLogs overview"
src="https://www.youtube.com/embed/dfVGAp7xVC8"
title="Neatlogs overview"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
></iframe>
/>

### ⚙️ CrewAI Integration (30 s)
## What is Neatlogs?

{/* ADD YOUTUBE VIDEO HERE - team to provide URL */}
{/*
<iframe
className="w-full aspect-video rounded-xl"
src="https://www.loom.com/embed/9c78b552af43452bb3e4783cb8d91230?sid=e9d7d370-a91a-49b0-809e-2f375d9e801d"
title="Loom video player"
src="https://www.youtube.com/embed/YOUR_VIDEO_ID"
title="What is Neatlogs"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
></iframe>

/>
*/}
Comment on lines +21 to +31
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove commented-out TODO code from production documentation.

The commented placeholder and TODO note should be removed. A YouTube video is already embedded in the hero section above (lines 10-17), making this TODO obsolete and confusing.

🧹 Proposed cleanup
 ## What is Neatlogs?
 
-{/* ADD YOUTUBE VIDEO HERE - team to provide URL */}
-{/*
-<iframe
-  className="w-full aspect-video rounded-xl"
-  src="https://www.youtube.com/embed/YOUR_VIDEO_ID"
-  title="What is Neatlogs"
-  frameBorder="0"
-  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
-  allowFullScreen
-/>
-*/}
-
 Agent failures rarely throw exceptions. They produce wrong outputs, miss tool calls, or hallucinate. Neatlogs gives your team the full picture: what the agent decided, why, and where it went wrong.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* ADD YOUTUBE VIDEO HERE - team to provide URL */}
{/*
<iframe
className="w-full aspect-video rounded-xl"
src="https://www.loom.com/embed/9c78b552af43452bb3e4783cb8d91230?sid=e9d7d370-a91a-49b0-809e-2f375d9e801d"
title="Loom video player"
src="https://www.youtube.com/embed/YOUR_VIDEO_ID"
title="What is Neatlogs"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
></iframe>
/>
*/}
## What is Neatlogs?
Agent failures rarely throw exceptions. They produce wrong outputs, miss tool calls, or hallucinate. Neatlogs gives your team the full picture: what the agent decided, why, and where it went wrong.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/en/observability/neatlogs.mdx` around lines 21 - 31, Remove the
commented-out TODO placeholder block that contains "ADD YOUTUBE VIDEO HERE" and
the commented iframe JSX (the multi-line {/* ... */} block containing <iframe
... />) from the docs page; simply delete that entire commented block so the
obsolete placeholder and comments are not left in
docs/en/observability/neatlogs.mdx (the iframe/comment block is the unique
identifier to locate and remove).


Agent failures rarely throw exceptions. They produce wrong outputs, miss tool calls, or hallucinate. Neatlogs gives your team the full picture: what the agent decided, why, and where it went wrong.

<CardGroup cols={2}>
<Card title="Trace Viewer" icon="list-tree">
Follow every thought, tool call, and decision in sequence. Token counts and latency included.
</Card>
<Card title="AI-Powered Search" icon="sparkles">
Find traces, runs, and patterns in plain English. No query language needed.
</Card>
<Card title="Inline Comments" icon="message">
Tag teammates on any trace step. Threads keep investigation in one place.
</Card>
<Card title="Feedback & Evaluation" icon="thumbs-up">
Mark outputs correct or incorrect. Build eval datasets straight from production traces.
</Card>
<Card title="Ask the Trace" icon="robot">
Chat with your trace using the built-in AI assistant to surface root causes fast.
</Card>
<Card title="Public Sharing" icon="share-nodes">
Publish trace links to your community or stakeholders for async review.
</Card>
</CardGroup>

## Quick Setup

<Steps>
<Step title="Sign up and get your API key">
Go to [neatlogs.com](https://neatlogs.com/?utm_source=crewAI-docs), create a project, and copy the API key from your dashboard.
</Step>
Comment on lines +59 to +61
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What parameters are required for neatlogs.init() and where do users get the endpoint value for the Neatlogs Python SDK?

💡 Result:

The neatlogs.init function in the Neatlogs Python SDK is used to initialize the SDK and configure tracking for your application [1][2]. It should be called at the very beginning of your entrypoint script, before importing any instrumented libraries (such as LangChain or OpenAI), to ensure the SDK can properly patch and trace those libraries [3][1]. Required and Optional Parameters: The primary required parameter is: - api_key (str): Your Neatlogs API key [1][2]. Common optional parameters include: - endpoint (str): A custom API endpoint URL. If you need to override the default, the typical value used in documentation is https://api.neatlogs.com/v4/batch [1]. - instrumentations (list[str]): A list of frameworks to automatically instrument (e.g., ["openai", "langchain", "crewai"]) [3][1]. - workflow_name (str): A name for the workflow or project [3][1]. - metadata (dict): A dictionary for global metadata (e.g., {"env": "production"}) [1]. - tags (list[str]): A list of tags to associate with the traces [2]. - auto_session (bool): Set to True to enable automatic session grouping for traces [4]. Regarding the endpoint value: For most standard use cases, you do not need to provide an endpoint parameter at all; the SDK defaults to the official Neatlogs platform [1]. If you are required to use a specific or custom endpoint (such as for on-premise installations or proxying), this value is provided by your Neatlogs account administrator or via your organization's internal documentation [1][5]. The default value often cited in SDK examples is https://api.neatlogs.com/v4/batch [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="docs/en/observability/neatlogs.mdx"

echo "== File: $FILE =="
wc -l "$FILE"
# Print lines around 45-90 to capture Step 1 and the init snippet
nl -ba "$FILE" | sed -n '40,110p'

Repository: crewAIInc/crewAI

Length of output: 207


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="docs/en/observability/neatlogs.mdx"

echo "== Lines 45-90 =="
cat -n "$FILE" | sed -n '45,90p'

echo
echo "== Lines 90-130 =="
cat -n "$FILE" | sed -n '90,130p'

Repository: crewAIInc/crewAI

Length of output: 4438


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n "NEATLOGS_ENDPOINT" -S . || true
rg -n "endpoint\s*=" -S docs/en/observability/neatlogs.mdx || true
rg -n "NEATLOGS_API_KEY|NEATLOGS_ENDPOINT" -S docs/en/observability/neatlogs.mdx || true

Repository: crewAIInc/crewAI

Length of output: 307


Document NEATLOGS_ENDPOINT setup (or remove it from the Quick Setup example).

“Sign up and get your API key” (lines 59-61) only tells users to copy NEATLOGS_API_KEY, but the init snippet later requires endpoint=os.environ["NEATLOGS_ENDPOINT"] (line 76). The guide doesn’t explain where to get/set NEATLOGS_ENDPOINT, and with the current os.environ[...] access users will hit a KeyError unless it’s set. Either add explicit instructions for obtaining the endpoint (and/or mention the SDK default) or drop the endpoint argument from the example so users can follow the steps without extra env vars.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/en/observability/neatlogs.mdx` around lines 59 - 61, The docs currently
instruct users to copy NEATLOGS_API_KEY but the Quick Setup example calls
neatlogs.init(... endpoint=os.environ["NEATLOGS_ENDPOINT"], ...), which will
raise a KeyError and doesn't explain where to get NEATLOGS_ENDPOINT; either
remove the endpoint argument from the neatlogs.init example (so the SDK uses its
default endpoint) or update the guide to add a short step explaining how to
obtain/set NEATLOGS_ENDPOINT (include the env var name NEATLOGS_ENDPOINT and an
example value such as the provider default like
https://api.neatlogs.com/v4/batch) and change the code to safely read the env
var (or document that it’s optional).

<Step title="Install the SDK">
```bash
pip install neatlogs
```
</Step>
<Step title="Add this before your Crew runs">
Call `neatlogs.init()` before importing CrewAI so the auto-instrumentation patches land first.

## Links & Support
```python
import os
import neatlogs

- 📘 [Neatlogs Docs](https://docs.neatlogs.com/)
- 🔐 [Dashboard & API Key](https://app.neatlogs.com/)
- 🐦 [Follow on Twitter](https://twitter.com/neatlogs)
- 📧 Contact: hello@neatlogs.com
- 🛠 [GitHub SDK](https://github.com/NeatLogs/neatlogs)
neatlogs.init(
api_key=os.environ["NEATLOGS_API_KEY"],
endpoint=os.environ["NEATLOGS_ENDPOINT"],
workflow_name="my-agent",
instrumentations=["crewai"],
)

# Now import and run your crew as normal
from crewai import Crew, Agent, Task
```

That's it — no changes to the rest of your code.
</Step>
<Step title="Traces logged directly in your dashboard">
Every tool call, agent run, and LLM call is captured and surfaced in your Neatlogs dashboard automatically. Tag teammates and leave comments directly on any trace step — no context switching, no Slack threads, no copy-pasting outputs.

## TL;DR
<video autoPlay loop muted playsInline className="w-full rounded-xl">
<source src="/images/neatlogs-traces.mp4" type="video/mp4" />
</video>
Comment on lines +90 to +92
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that all referenced video files exist in the repository

echo "Checking for video files..."
for video in neatlogs-traces.mp4 neatlogs-experiments.mp4 neatlogs-codefixes.mp4 neatlogs-evals.mp4; do
  if fd -t f "^${video}$" docs/images/; then
    echo "✓ Found: ${video}"
  else
    echo "✗ Missing: ${video}"
  fi
done

Repository: crewAIInc/crewAI

Length of output: 314


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking exact file paths:"
for video in neatlogs-traces.mp4 neatlogs-experiments.mp4 neatlogs-codefixes.mp4 neatlogs-evals.mp4; do
  p="docs/images/$video"
  if [ -f "$p" ]; then
    echo "✓ Present: $p"
  else
    echo "✗ Missing: $p"
  fi
done

Repository: crewAIInc/crewAI

Length of output: 266


Fix missing video asset for neatlogs-traces.

/images/neatlogs-traces.mp4 (referenced at lines 90-92 and also 97-99) is missing from docs/images/ (docs/images/neatlogs-traces.mp4 not found). Add it to docs/images/ (or update the src to the correct existing path). The other referenced videos (neatlogs-experiments.mp4, neatlogs-codefixes.mp4, neatlogs-evals.mp4) are present.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/en/observability/neatlogs.mdx` around lines 90 - 92, The markdown
references a missing video asset src="/images/neatlogs-traces.mp4" inside the
<video> element (seen in the <video autoPlay loop muted playsInline
className="w-full rounded-xl"> block); fix this by either adding the missing
file neatlogs-traces.mp4 into the docs/images/ directory or updating the src
attribute to the correct existing asset path (matching how
neatlogs-experiments.mp4, neatlogs-codefixes.mp4, and neatlogs-evals.mp4 are
referenced) so the <source src="..."> points to a present file.

</Step>
<Step title="Experiments — version control for your prompts">
Iterate on prompts without touching production. Neatlogs gives you version control for every prompt in your crew and a playground to test changes side by side — so you can improve agent behaviour safely before it goes anywhere near your live system.

With just:
<video autoPlay loop muted playsInline className="w-full rounded-xl">
<source src="/images/neatlogs-experiments.mp4" type="video/mp4" />
</video>
</Step>
<Step title="Code fixes directly in your IDE">
Get agent improvement suggestions and code fixes surfaced straight into Cursor, Codex, Claude Code, and other AI-native editors. Debug and improve your crew without leaving the tools you already work in.

```bash
pip install neatlogs
<video autoPlay loop muted playsInline className="w-full rounded-xl">
<source src="/images/neatlogs-codefixes.mp4" type="video/mp4" />
</video>
</Step>
<Step title="Human evaluations">
Bring your team in to review agent outputs, mark runs as correct or incorrect, and build evaluation datasets straight from production traces. Close the loop between what your agents produce and what they should produce.

import neatlogs
neatlogs.init("YOUR_API_KEY")
<video autoPlay loop muted playsInline className="w-full rounded-xl">
<source src="/images/neatlogs-evals.mp4" type="video/mp4" />
</video>
</Step>
</Steps>

You can now capture, understand, share, and act on your CrewAI agent runs in seconds.
No setup overhead. Full trace transparency. Full team collaboration.
```
## Resources

<CardGroup cols={2}>
<Card title="Neatlogs Docs" icon="book" href="https://docs.neatlogs.com/">
Full SDK reference and integration guides
</Card>
<Card title="Dashboard & API Key" icon="key" href="https://neatlogs.com/?utm_source=crewAI-docs">
Create a project and get your API key
</Card>
<Card title="GitHub SDK" icon="github" href="https://github.com/NeatLogs/neatlogs">
MIT licensed · Python 3.8+
</Card>
<Card title="Contact" icon="envelope" href="mailto:hello@neatlogs.com">
hello@neatlogs.com
</Card>
</CardGroup>
Binary file modified docs/images/neatlogs-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/neatlogs-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/neatlogs-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/neatlogs-codefixes.mp4
Binary file not shown.
Binary file added docs/images/neatlogs-evals.mp4
Binary file not shown.
Binary file added docs/images/neatlogs-experiments.mp4
Binary file not shown.