AnythingLLM Agents: What They Do and How to Set Them Up
Learn what AnythingLLM agents do, how to configure them, and when to use them for automation. Step-by-step setup guide with infrastructure requirements and trade-offs.
- AnythingLLM agents enable autonomous multi-step task execution with tool calling and integration skills across your workflows (65.7K GitHub stars)
- Built-in skills include web search, document analysis, file I/O, and integrations with Gmail, Google Calendar, SQL databases, and Slack
- Agents require models that support tool calling and add 30-120 seconds latency per task; Intelligent Tool Selection optimizes cost and context
- Production use cases: research automation, document orchestration, scheduled workflows, support ticket triage, and complex data extraction
- Trade-offs include tool accuracy variance, context window bloat, and debugging complexity; start with proof of concept before scaling
AnythingLLM agents extend the tool beyond simple document Q&A. They execute multi-step tasks autonomously: researching, analyzing, and taking action across systems. Unlike passive chat that retrieves and summarizes, agents select their own tools, handle sequences of operations, and adapt based on results. If you're handling repetitive workflows, agents are worth understanding.
What Are AnythingLLM Agents?
AnythingLLM agents are LLM instances with the ability to call external tools and execute sequential actions without human intervention between steps. A standard chat interaction is passive: you ask a question, the model retrieves and summarizes information, done. An agent is active: it analyzes your request, selects tools, executes them, evaluates the results, and may call more tools to complete the task.
The distinction matters in production. Simple document retrieval ("Find this policy in our knowledge base") doesn't need agency. But multi-step workflows ("Analyze these documents, cross-reference with current industry standards, generate a compliance summary, and email it to legal") do. Agents handle that complexity without custom code.
AnythingLLM agents are built on the Mintplex Labs platform, which has 65.7K stars on GitHub and 7.3K forks. The tool is open-source (MIT license) and available both as desktop software and self-hosted or managed deployments. Agents are a core feature, not an afterthought, and work across local models (Ollama, LM Studio) and cloud LLMs (OpenAI, Anthropic, Groq).
How AnythingLLM Agents Work: The Mechanics
When you invoke an agent, you're using a different processing path than regular chat. You prefix your prompt with @agent and AnythingLLM routes it to the agent engine. The agent engine reads your request, consults the list of available tools (skills), and decides which tools apply.
Here's the sequence: the model reads the prompt and available tools. It decides if a tool is needed; if yes, which one. AnythingLLM executes the tool (e.g., search the web, query a database). Results are fed back to the model. The model evaluates: is the task complete? If no, loop again. Once complete, the agent returns a final response to you.
This process is called a "chain." Most agent chains complete in 30 seconds to 2 minutes, depending on model speed, tool complexity, and how many loops are needed. Each loop consumes tokens (the model's input cost), so verbose tool descriptions hurt performance and cost.
AnythingLLM addresses this with Intelligent Tool Selection: a mechanism that automatically filters tool descriptions to only include relevant ones, shrinking context bloat. This reduces latency and token spend without degrading accuracy. Another key mechanic is workspace isolation. Agents run within a workspace, accessing only skills and documents configured in that workspace. You can't accidentally leak data between customers or projects. Skills are the building blocks: they're either built-in or custom.
Core Capabilities: What Agents Can Actually Do
AnythingLLM agents ship with a rich set of built-in skills. Document search and summarization works across your AnythingLLM knowledge base. Web search queries the live internet. File I/O reads and writes files to disk. Chart generation creates visualizations from data. Data synthesis transforms and combines information.
Integration skills connect to Gmail (read and send emails, parse attachments), Google Calendar (check availability, schedule events), Outlook, SQL databases, Slack, and custom webhooks for triggering external systems. You enable skills at the workspace level. In workspace settings, you navigate to Agent Skills, toggle on the ones you need, and configure credentials (e.g., your Gmail OAuth token). Once enabled, the agent automatically considers them when processing requests.
For more specialized workflows, you can write custom skills in Node.js. A custom skill is a JavaScript handler function that accepts parameters and returns results. AnythingLLM looks for a plugin.json manifest and a handler.js file. The process is not beginner-friendly, but it's approachable for anyone with basic JavaScript experience.
Agent Flows are a visual workflow builder. Instead of prompting an agent and hoping it makes the right choices, you can drag-and-drop steps into a canvas: fetch data from API A, transform it, write to database B, send notification to Slack. Flows execute on-demand or on a schedule (cron). This is closer to n8n or Make, but integrated into AnythingLLM's native interface.
Document analysis is one of the most common skills, allowing agents to extract, synthesize, and structure data from PDFs, images, and text files. The combination of skills, built-in integrations, and Agent Flows makes AnythingLLM agents powerful for local-first automation. You're not shipping data to a SaaS platform; everything runs on your infrastructure (if self-hosted) or your managed infrastructure (if hosted).
Step-by-Step: Setting Up Your First Agent
Here's how to enable and test an agent in AnythingLLM.
Step 1: Confirm or Connect an LLM. Open AnythingLLM (desktop, self-hosted, or managed). Go to Settings > LLM. You'll see your current LLM choice. For agents to work, your LLM must support tool calling (function calling). Most modern models do: GPT-4, Claude, Mistral, Llama 2. If you're running Ollama locally, check that your model is recent enough (older 7B models may not handle tool calling well). If uncertain, start with a cloud LLM (Groq is free-tier friendly and handles tools well).
Step 2: Navigate to Agent Skills. Go to Settings > Agent Skills (or Agent Configuration, depending on your version). You'll see a list of available skills with toggles.
Step 3: Enable Skills for Your Use Case. For a research workflow, enable web search (live internet), document search (your internal knowledge base), and file I/O (save results). Click toggle to enable. For skills requiring credentials (Gmail, SQL databases), a modal will appear asking for connection details. Paste your credentials and save.
Step 4: Test in Chat. Open a workspace and create a new chat. Type your request using the @agent prefix: @agent Research the latest quarterly earnings for Acme Corp and summarize the key metrics. The agent will search the web for recent earnings, decide if it needs to fetch documents from your knowledge base (if Acme Corp PDFs are there), synthesize a response, and return a summary with sources. The first run may take 60-90 seconds as the model chains through tools. Subsequent similar requests are often faster if the model reuses the same tools.
Common Gotcha: Not all models handle tool calling equally. If you're using a self-hosted Ollama model smaller than 7B parameters, it may fail to invoke tools or invoke the wrong tools. Switch to a larger model or a cloud LLM if you hit this wall. The model must explicitly choose to call a tool; if the LLM doesn't recognize the tool-calling syntax, the agent falls back to regular chat (which defeats the purpose).
Real-World Use Cases: When to Deploy Agents
Research Automation. Prompt: "Compare our product features against our three main competitors and produce a Markdown table." The agent browses the web, synthesizes competitor data, and outputs a table you can paste into a doc.
Document Orchestration. Prompt: "Extract all customer names and email addresses from the PDF in workspace, format as a CSV, save to sales-contacts.csv." The agent reads the PDF, parses the data, and writes the file. You upload later.
Scheduled Data Pulls. Use Agent Flows (cron-based): every Monday morning, fetch the latest analytics from your API, transform it, and email the team a summary.
Support Ticket Triage. An incoming support email is routed to an AnythingLLM agent. The agent reads the issue, searches your knowledge base for solutions, and either auto-responds with an answer or flags urgent tickets for human review.
When Agents Are Overkill. A simple question like "What's our return policy?" doesn't need an agent. It needs a single document lookup. Agents add latency (30 seconds vs. 2 seconds for a simple retrieval). Don't over-automate. Use agents when the task requires multiple steps, the steps depend on the output of previous steps (conditional logic), and humans can't complete it faster than setting up the automation. For example, extracting a specific paragraph from a known document is faster done manually or with a simple retrieval. Extracting patterns from 50 documents and summarizing requires an agent.
Limitations & Honest Trade-Offs
Tool Accuracy Variance. Agents only work if the underlying LLM understands which tool to call. Smaller or poorly-trained models hallucinate tool use: they might invent parameters or call the wrong tool. GPT-4 and Claude are reliable. Smaller open-source models hit accuracy walls. Test with your actual workload before relying on agents in production.
Context Window Bloat. Each skill description is a block of tokens. Web search skill plus document search skill plus file I/O skill plus three custom skills equals a lot of context consumed before your actual request is even sent to the model. Intelligent Tool Selection mitigates this, but it's not perfect. Large context windows (128K tokens) help, but they cost more.
Latency. A simple retrieval answers in 2-5 seconds. An agent chain with 3-4 tool calls takes 60-120 seconds. If you need real-time responses (user sitting at a chat waiting), agents are too slow. If the workflow is async (background job, batch process), the latency is acceptable.
Debugging is Hard. When an agent fails, you need to understand which step broke. Did it select the right tool? Did the tool execute? Did the model misinterpret the tool's output? Debugging requires checking logs and sometimes re-running the chain with verbose logging enabled. Simple chats don't have this complexity.
Not All Models Support Tool Calling. Your LLM must implement the tool-calling specification (OpenAI's function calling, or similar). Older models or edge-case LLMs don't. If you're committed to a specific model that doesn't support tool calling, agents won't work. Test first.
Cost Implications. Each tool call costs tokens. A 10-step chain consumes more tokens than a single summary. The Intelligent Tool Selection feature helps, but it's not free. For cost-sensitive workflows, do the math: is the time saved worth the token cost?
What Infrastructure Do You Need?
Local Setup (Ollama, LM Studio): CPU 8+ cores, RAM 16GB+ (depending on model size), GPU optional but strongly recommended (4GB+ VRAM). Latency: 30-120 seconds per agent chain. Cost: Initial hardware purchase; zero recurring cost. Models to consider: Mistral 7B, Llama 2 70B, or larger. Smaller models (3-5B) may fail at tool selection.
Cloud LLM Setup (OpenAI, Anthropic, Groq): No compute required (hosted), latency 10-60 seconds per agent chain (faster than local), cost per-token billing where a typical agent chain costs $0.02-0.05. Advantage: no infrastructure to manage.
Managed Setup: Compute handled by your infrastructure provider, auto-scaling Kubernetes, built-in Docker support, CPU/GPU options, latency sub-30 seconds per agent chain, subscription cost covers hosting and model serving. Advantage: you configure once, agents scale automatically.
For production workloads, managed infrastructure is recommended. Self-hosted is great for development; production demands reliability, monitoring, and scaling that DIY setups require constant tuning. Agents add complexity; let managed infrastructure handle the operational burden.
Getting Agents into Production: Your Implementation Path
If you're sold on agents, here's how to move forward.
Phase 1: Proof of Concept (Week 1). Download AnythingLLM desktop or spin up a self-hosted instance. Pick one simple use case (e.g., "summarize emails daily"). Configure the agent with 2-3 skills. Test manually a few times. Measure latency and cost (if using cloud LLMs). Does it solve the problem faster than doing it manually? If yes, move to phase 2.
Phase 2: Scale to Production. Move from desktop to a reliable hosting platform. Self-hosted Docker works, but managed AnythingLLM hosting eliminates infrastructure toil. You specify compute requirements (CPU/GPU), connect your LLM (local or cloud), and your provider handles provisioning, monitoring, and scaling. Connect your agent to production systems (email, Slack, databases) via integrations or webhooks.
Phase 3: Measure and Iterate. Monitor agent accuracy and latency. If accuracy is less than 90%, consider switching to a larger or better-quality model, adding more detailed tool descriptions (so the agent understands better), or simplifying the workflow (maybe this particular task doesn't need an agent). Most teams find one use case that works well, deploy that, then add more use cases over time.
Frequently Asked Questions
How does AnythingLLM work? AnythingLLM is a local-first AI chat platform. You load documents into workspaces, connect an LLM (local like Ollama or cloud like OpenAI), and chat. In agent mode, the LLM can call tools (search, write files, query databases) and chain them together to complete multi-step tasks.
What are AI agents? AI agents are LLM instances with access to tools and the ability to decide which tools to use. Unlike passive chat, agents actively call tools, evaluate results, and make decisions about next steps. They're useful for automation, research, and workflow orchestration.
Can you deploy agents locally? Yes. Download AnythingLLM desktop or deploy the Docker image to any machine with 16GB RAM and a decent CPU or GPU. You can run Ollama (a lightweight local LLM server) on the same machine or network. Agents will be slower than cloud LLMs but cost nothing to run.
What models support agent tool calling? Most modern LLMs do: GPT-4, Claude 3, Mistral, Llama 2 (recent versions). Older or very small models (3B parameters or less) may not. If you're unsure, test with your LLM before committing.
How much does running agents cost? If self-hosted with Ollama, zero recurring cost (one-time hardware). If using cloud LLMs (OpenAI, Anthropic), expect $0.02-0.10 per agent run depending on chain length. If using managed hosting, a subscription covers infrastructure and includes a generous compute allowance.
The Bottom Line
AnythingLLM agents extend the tool from a document Q&A system into a workflow automation platform. They're powerful for research, orchestration, and scheduled tasks. They're not a silver bullet: they add latency, require careful model selection, and can become expensive if misused. But for the right use cases, they save time and scale workflows that would otherwise demand custom code. The key is honesty about trade-offs. Use agents when a task genuinely benefits from autonomy and multi-step reasoning. Don't use them for simple lookups. Start with a proof of concept, measure carefully, and scale once you know it works.