Chatting With Agents
AI Agents in NinjaCat provide a powerful way to interact with your data and automate insights. However, understanding how conversations work—including context retention, tool usage, and troubleshooting outputs—is key to maximizing their effectiveness.
Conversation Space & Privacy
Each user has their own unique conversations with an Agent. You can:
- Access past conversations in Conversation History or start a new one.
- Rest assured that your chats are private—no other user can see your interactions, even with a Public Agent.
However, all users can see Triggered Outputs from an Agent, even if they didn't originally set up the Trigger.
Having a Conversation with an Agent
Because NinjaCat's Agents are powered by large language models (LLMs) by OpenAI and Anthropic, they have a broad general knowledge base. For example, if you ask an Agent: "What is Denver, CO known for?" It might tell you it's the Mile High City, famous for the Rocky Mountains, craft beer, and Red Rocks Amphitheater. However, that's not why you're using an Agent.
NinjaCat Agents are designed for specific marketing and advertising-related tasks—their effectiveness depends on:
- The instructions (prompt) given in the Agent Builder.
- The datasets and tools assigned to them.
How to Start a Conversation
- If the Agent is configured to do its task for all accounts or campaigns found in a dataset, you might only need to say: "Go do your thing!"
- If the prompt requires details, you may need to provide specifics: "Analyze performance for Account X in the last 30 days."
Why Conversations Vary Between Agents
Each Agent behaves differently based on:
- The instructions given to it in the Agent Builder
- How it was prompted—some Agents ask clarifying questions, while others execute immediately.
- The datasets and tools assigned to it.
- The way each user interacts with the Agent.
How Agents Use Tools During Conversations
During a conversation, the Agent will display the steps it is taking, including any tools being used. These tools are either:
- Locked & pre-enabled (required for basic functionality).
- Optional tools (enabled based on the Agent's needs). ( See more in Adding Tools.)
Viewing Tool Activity:
When a tool is in use, a blue expandable text box appears—clicking it will reveal what the Agent is processing in real-time, including any code or queries that it's writing.
- String Matcher Tool: Leverage the String Matcher Tool to either find the correct Account Match or Campaign Match (or other element) that the user is inquiring about. If it finds an exact match of that Account / Advertiser / Campaign Name, it will go ahead and perform the task for that Exact Match. If it only finds partial matches then it may ask the user clarifying questions before proceeding.
- Query Executor Tool: Allows the Agent to write a SQL query in order to find the necessary data from the assigned dataset(s). When the AI writes SQL queries, it is allowed to select up to 100,000 rows. This doesn't mean that it can't work with datasets that are larger than 100,000 rows, the resulting set of rows that are pulled back from that query just must be under that limit. Many of the datasets that get assigned to an Agent are very large, and could pose performance risks if limitations are not put in place.
- In more complex cases, its been beneficial to include the SQL directly in the prompt of the Agent so that it produces more consistent outputs.
- Those rows that result from the Query Executor Tool then get saved to a CSV. The AI can do a few things with the CSV: it can share it with the user, it can send it to Code Interpreter for further processing, or it can look at its contents 500 rows at a time (see more about this limitation in below "Context Windows" section).
- If the CSV gets passed to Code Interpreter for further processing, then code will begin to be written in order to further analyze the results that were queried in order to produce the final output to the user.
⚠️ For complex use cases, you can include SQL directly in the Agent's prompt for more consistent results.
Uploading Files to a Conversation
Users are able to upload files to a conversation for the Agent to analyze. This will only impact the individual conversation that the file(s) were uploaded to, and not other conversations.
Files that are supported in individual conversations: .PDF, .CSV, .IMG, .TXT, .MD, .JPG, .JPEG
Understanding Context Windows & Conversation Limits
Each conversation is a clean slate. Agents are not aware of context in other conversations.
Within a single conversation, context is retained—even if you return to it after a week.
What is a Context Window?
A Context Window is the amount of text the AI can process within one conversation, measured in tokens. This includes:
- The prompt
- All messages exchanged in the conversation
- Any tool-generated messages
- Rows of data that the CSV Reader tool analyzes chunks at a time
- Any information scraped from websites by the website scraper tool
- The text that is extracted from PDF files added to the Agent's knowledge
- Files that get uploaded to the individual conversation
Why does this matter?
Token limits are set by the AI model that powers the Agent and each Large Language Model (LLM) has a different maximum token limit. In many cases this is 200k tokens, but in more recent, updated models (like OpenAI GPT 5, 5.1 and 5.2, they have 400k token context window.
- Complex queries or long conversations may eventually exceed the limit. Every conversation needs to be smaller than the context window, otherwise the AI will stop working.
- Choosing the right model for your Agent can impact how much context it can retain over time.
- With that said, context windows are fairly large, but its good to know that restrictions are put in place in order to avoid exceeding the limit and ending up in a broken conversation.
- A hot tip if you're hitting the context window error in your Agent conversation: start a new conversation with the agent, which essentially opens up a blank slate of a context window.
Tool Result Masking
When Agents use tools like the Query Executor or Web Scraper during a conversation, those tools can return large amounts of data. Before this enhancement, over the course of a long conversation, the AI re-reads the full history on every turn—including all past tool results. Without any management, these large results can accumulate and eventually fill up the context window, leading to slower responses or errors.
Tool Result Masking is a feature that automatically manages large tool results behind the scenes so your conversations stay fast and productive—without losing any data.
How it works
As your conversation progresses, Tool Result Masking monitors how much of the context window is being used by past tool results. When older results are taking up significant space, the system automatically replaces them with compact summaries. This frees up room in the context window for new messages, queries, and analysis.
Here's what you should know:
- No data is ever lost. Full tool results are always saved. Masking only affects what the AI actively "sees" during a conversation—think of it as the AI setting aside older notes it's already reviewed.
- Older and larger results are managed first. The system prioritizes masking results that are both older (the AI has likely already extracted what it needed) and larger (freeing up the most space). When a single tool result exceeds 25% of the available context window, it's automatically summarized in place — and once total conversation usage crosses 50%, older and larger tool results are progressively summarized as well.
- The AI can retrieve past results if needed. If the AI needs to revisit a previously managed result, it can pull the full data back on demand.
- Conversations stay faster. By keeping the active context window lean, the AI processes each response more quickly—especially in long or data-heavy conversations.
- Overflow protection is built in. If a conversation ever approaches the context window limit, the system automatically takes more aggressive action to keep things running smoothly. This happens in the background with no action required from you.
What this means for you
With Tool Result Masking, you can have longer, more complex conversations with your Agents—running multiple queries, pulling in data from different sources, and iterating on analysis—without worrying as much about hitting context window limits. The system handles the housekeeping so you can focus on getting the insights you need.
Managing Large Data Sets
To avoid performance issues and exceeding the Context Window, a couple limitations are put in place to help control and manage the amount of data that passes through to an Agent.
- Query Executor Tool retrieves up to 100,000 rows at a time. This doesn't mean that it can't work with datasets that are larger than 100,000 rows, the resulting set of rows that are pulled back from that query just must be under that limit. Many of the datasets that get assigned to an Agent are very large, and could pose performance risks if limitations are not put in place.
- If you notice that the Query Executor Tool is displaying "100,000 Results" in the text of the expandable link, that may mean you are hitting this limit and it may not be a complete or accurate result set. The prompt will need to be adjusted in order to pull back less results (an example adjustment: pull back results from the last 14 days instead of the last 30 days).
- In more complex cases, it's been beneficial to include the SQL directly in the prompt of the Agent so that it produces more consistent outputs.
- CSV files are saved with the results from the Query Executor Tool. To get around the Context Window limits, we do not load the saved CSV into the conversation. Instead, the AI can view the data in 500-row chunks, if it wants. Or, it can share the results with the user or it can send it to Code Interpreter for further processing.
- Tool Result Masking (Beta) further helps manage context window usage by automatically summarizing older, large tool results as your conversation progresses. See the Tool Result Masking section above for more details.
These safeguards prevent system overloads and help maintain high-speed AI responses.
Exporting Information from an Agent Conversation
Sometimes the information given by an Agent is just too good that you can't keep it to yourself! When this is the case, you have a couple of options to export that information from the conversation. In both cases, Code Interpreter must be enabled as a tool in the Agent Builder for that Agent.
- Generate a CSV- ask the Agent to provide a 'downloadable csv' with the table of data. This can be apart of the Agent's prompt instructions (in the Agent Builder) or ad hoc through the conversation.
- Generate a PDF- along with Code Interpreter being enabled, this feature works best with Claude 3.7 Sonnet and GPT 4.1 (works with other models as well, but you may notice less-than-ideal formatting in the PDF).
Updated about 16 hours ago