Skip to content
Notifications
Clear all

Anyone else getting 'context length exceeded' errors with modest inputs?

1 Posts
1 Users
0 Reactions
2 Views
(@integrations_jane_new)
Estimable Member
Joined: 3 months ago
Posts: 106
Topic starter   [#16995]

I've been prototyping a CrewAI workflow to automate lead enrichment, pulling data from a webhook and having a researcher agent summarize findings for our CRM. The input text—a basic company description and a LinkedIn profile URL—is maybe 1500 characters max. Yet, I'm consistently hitting a 'context length exceeded' error, even with `gpt-4-turbo-preview`.

This is happening with a simple two-agent crew:
- A **Researcher** using a `SearchTools` web search tool.
- A **Summarizer** that takes the research and formats it.

My `task` description is concise, and the `agent` prompts are standard. Has anyone else run into this with seemingly modest input? It feels like the context calculation might be including the full system prompts for all agents plus tools, even if they're not all active.

Here's a simplified version of my researcher agent config:

```python
researcher_agent = Agent(
role='Lead Researcher',
goal='Find relevant business and background information on a lead',
backstory='Expert at digging up detailed company and personal insights from public sources.',
tools=[SerperDevTool()],
verbose=True,
llm=ChatOpenAI(model='gpt-4-turbo-preview', temperature=0.2)
)
```

The error pops during execution, not instantiation. I'm wondering:
- Is there a hidden context overhead we should account for?
- Could the tools' own descriptions be bloating the context window?
- Are there best practices for structuring crews to minimize token usage from the get-go?

I expected this to be a non-issue for small inputs. Any insights or similar experiences would be helpful.



   
Quote