<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it--y7cy3z8sh" -->

---
title: Building a Bulletproof Multi-Agent Data Analyst with...
description: A hands-on experiment building a 5-agent CrewAI pipeline for autonomous Exploratory Data Analysis on a messy 12,500-row retail dataset. The key architectural...
canonical: https://daily.dev/posts/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it--y7cy3z8sh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building a Bulletproof Multi-Agent Data Analyst with CrewAI (and Why Small LLMs Fail at It) | daily.dev
og:description: A hands-on experiment building a 5-agent CrewAI pipeline for autonomous Exploratory Data Analysis on a messy 12,500-row retail dataset. The key architectural...
og:url: https://daily.dev/posts/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it--y7cy3z8sh
og:image: https://api.daily.dev/og/posts/y7CY3Z8SH.png
og:image:alt: Building a Bulletproof Multi-Agent Data Analyst with CrewAI (and Why Small LLMs Fail at It)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building a Bulletproof Multi-Agent Data Analyst with CrewAI (and Why Small LLMs Fail at It)

**[Medium](https://daily.dev/sources/medium_js)** · 6 min read · 2 upvotes · 0 comments

## Summary

A hands-on experiment building a 5-agent CrewAI pipeline for autonomous Exploratory Data Analysis on a messy 12,500-row retail dataset. The key architectural insight is decoupling computation from interpretation: Python/Pandas tools handle all math deterministically, while LLMs only interpret the pre-computed metadata. The post details three major engineering hurdles — strict JSON schema validation with Groq's API, infinite hallucination loops in ReAct agents, and API rate limit exhaustion — along with their fixes using Pydantic BaseTool classes, aggressive negative prompting, and RPM throttling. A local SLM test with phi3:mini and llama3.2:3b via Ollama failed catastrophically: phi3:mini rejected tool-calling entirely and hallucinated filenames, while llama3.2:3b ignored its tools and fabricated a fake dataset. The conclusion is that multi-step ReAct tool-calling workflows require models of roughly 30B+ parameters to function reliably.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@ntratofficial/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it-2d6fbd5fce63>

## Questions this post answers

### Why does CrewAI fail with a tool_use_failed error when using Groq's Llama 3 70B API?

Groq's strict API validator rejects ambiguous JSON schemas produced by CrewAI's default function decorators, which use flexible **kwargs. Migrating the tool definitions from decorators to strict BaseTool classes with Pydantic BaseModel schemas (e.g., explicitly typing file_path: str) matches the schema exactly to the LLM's output and eliminates the rejections.

_Anyone hardening a CrewAI tool pipeline against API rejections can find similar fixes discussed on daily.dev._

### Can small local language models like llama3.2:3b or phi3:mini run multi-agent tool-calling pipelines reliably?

No, testing showed both models failed badly in a CrewAI ReAct-style tool-calling pipeline. phi3:mini had its tool calls rejected by the Ollama API and hallucinated a nonexistent filename, while llama3.2:3b ignored the Python tools entirely and fabricated a fake dataset about iPhones and sofas instead of analyzing the real data.

_Developers weighing local small models against cloud LLMs for agent workflows can track findings like this via daily.dev._

### How do you stop a CrewAI agent from getting stuck in an infinite loop after finishing its task?

Inject aggressive negative prompting telling the agent to call the tool exactly once and not output conversational filler like 'Go ahead', combined with hardcapping agents using max_iter=3 to force them to stop reasoning and produce output. This addresses a ReAct loop failure mode where agents hallucinate conversational filler instead of finishing.

_Teams debugging runaway agent loops in CrewAI can compare fixes and experiences through daily.dev._

## Similar posts on daily.dev

- [Building a Local, Ollama-Powered Insurance Claim Review Agent: What Broke Along the Way](https://daily.dev/posts/building-a-local-ollama-powered-insurance-claim-review-agent-what-broke-along-the-way-4xymtpxpd) · Medium · 2 upvotes · 1 comments
- [Three Years of Building Agents in Production \(Part 1\)](https://daily.dev/posts/three-years-of-building-agents-in-production-part-1--d2wjasjzx) · Mabl Engineering Blog · 3 upvotes · 1 comments
- [Build LLM Agents Faster with Datapizza AI](https://daily.dev/posts/build-llm-agents-faster-with-datapizza-ai-mhn3pva1m) · Towards Data Science · 1 upvotes · 0 comments
- [we are building data breach machines and nobody cares](https://daily.dev/posts/we-are-building-data-breach-machines-and-nobody-cares-qcskpagwt) · Hacker News · 3 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#ai-agents](https://daily.dev/tags/ai-agents), [#ollama](https://daily.dev/tags/ollama), [#exploratory-data-analysis](https://daily.dev/tags/exploratory-data-analysis)

[View this post on daily.dev](https://daily.dev/posts/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it--y7cy3z8sh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building a Bulletproof Multi-Agent Data Analyst with CrewAI (and Why Small LLMs Fail at It)","url":"https://daily.dev/posts/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it--y7cy3z8sh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it--y7cy3z8sh"},"datePublished":"2026-07-23T13:54:50.516Z","dateModified":"2026-09-14T08:02:59.346Z","description":"A hands-on experiment building a 5-agent CrewAI pipeline for autonomous Exploratory Data Analysis on a messy 12,500-row retail dataset. The key architectural...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d6518d32a670532fde5fa30b15cdae39?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d6518d32a670532fde5fa30b15cdae39?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it--y7cy3z8sh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,ai-agents,ollama,exploratory-data-analysis","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Building a Bulletproof Multi-Agent Data Analyst with CrewAI (and Why Small LLMs Fail at It)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-a-bulletproof-multi-agent-data-analyst-with-crewai-and-why-small-llms-fail-at-it--y7cy3z8sh#faq","mainEntity":[{"@type":"Question","name":"Why does CrewAI fail with a tool_use_failed error when using Groq's Llama 3 70B API?","acceptedAnswer":{"@type":"Answer","text":"Groq's strict API validator rejects ambiguous JSON schemas produced by CrewAI's default function decorators, which use flexible **kwargs. Migrating the tool definitions from decorators to strict BaseTool classes with Pydantic BaseModel schemas (e.g., explicitly typing file_path: str) matches the schema exactly to the LLM's output and eliminates the rejections. Anyone hardening a CrewAI tool pipeline against API rejections can find similar fixes discussed on daily.dev."}},{"@type":"Question","name":"Can small local language models like llama3.2:3b or phi3:mini run multi-agent tool-calling pipelines reliably?","acceptedAnswer":{"@type":"Answer","text":"No, testing showed both models failed badly in a CrewAI ReAct-style tool-calling pipeline. phi3:mini had its tool calls rejected by the Ollama API and hallucinated a nonexistent filename, while llama3.2:3b ignored the Python tools entirely and fabricated a fake dataset about iPhones and sofas instead of analyzing the real data. Developers weighing local small models against cloud LLMs for agent workflows can track findings like this via daily.dev."}},{"@type":"Question","name":"How do you stop a CrewAI agent from getting stuck in an infinite loop after finishing its task?","acceptedAnswer":{"@type":"Answer","text":"Inject aggressive negative prompting telling the agent to call the tool exactly once and not output conversational filler like 'Go ahead', combined with hardcapping agents using max_iter=3 to force them to stop reasoning and produce output. This addresses a ReAct loop failure mode where agents hallucinate conversational filler instead of finishing. Teams debugging runaway agent loops in CrewAI can compare fixes and experiences through daily.dev."}}]}
```

