Two Real Options, Different Trade-Offs
When a developer or technical founder decides to build an AI agent, there's a genuine architectural decision waiting early on: use the OpenAI Assistants API and its built-in capabilities, or build a custom agent architecture on the raw Chat Completions API with your own orchestration.
Both approaches produce real, production AI agents. The difference is in what you control, what you depend on, and what it takes to keep alive after launch. We've built both, and the recommendation depends on the situation more than either option's fans would tell you.
A 20-person insurance brokerage recently came to us with a use case: their team was spending 90 minutes a day pulling policy documents and answering repetitive client questions via email. They needed an AI assistant that could read PDFs, remember past conversations with each client, and draft replies. That's a case where the Assistants API got them to a working proof of concept in two days. Another client — a fintech startup processing 50,000 customer support tickets a month — needed multi-step routing logic, real-time cost monitoring, and the ability to swap in cheaper models for simple classification tasks. That required custom architecture from day one.
What the OpenAI Assistants API Gives You
The Assistants API is OpenAI's framework for building AI agents with persistent memory, tool use, and file handling. It manages several things that would otherwise require custom engineering:
Threads. Persistent conversation history stored by OpenAI. You don't manage conversation context yourself — you add messages to a thread and the API maintains the history. For a typical customer service scenario, this means a user can pick up a conversation three days later and the agent remembers what was discussed. The downside is that OpenAI stores that history, which matters for some clients.
File Search. Upload files (PDFs, documents, spreadsheets) and the Assistant can search them to answer questions. OpenAI handles chunking, embedding, and vector search for you. The built-in chunking works acceptably for clean, well-structured documents — think product manuals or HR policies. It struggles with dense legal contracts, scanned PDFs with poor OCR, or documents where the relevant passage depends on context from a different section.
Code Interpreter. A sandboxed Python environment the Assistant can use to execute code, process data, and generate files. Useful for analytical applications — a small accounting firm could use it to let clients upload a CSV of transactions and ask "show me all expenses over $500 this quarter." The sandbox resets between sessions, so it is not suitable for stateful computation.
Function Calling. Define tools (functions) the Assistant can call, and OpenAI's orchestration handles the tool-calling loop — recognising when to call a tool, parsing arguments, and continuing after the tool result. You define the function schema, OpenAI handles the decision of when to invoke it. This works well for straightforward single-tool workflows.
Built-in Runs management. The API manages the execution loop (runs) for you — polling for completion, handling tool calls, managing state transitions. You submit a run and poll for its status. It abstracts away the mechanics of agent execution, which is useful early on but means you have limited visibility into what's happening inside.
When the Assistants API makes sense:
- Rapid prototyping. You can have a working agent with memory and file search in hours rather than days.
- Small teams or solo developers. Less infrastructure to manage means less surface area to mess up.
- Applications where OpenAI's tool implementations are sufficient. If you need file search over a moderate document set and some built-in code execution, the Assistants API gets you there without custom development.
- Projects where OpenAI lock-in is acceptable. You're comfortable building on OpenAI's proprietary API with its associated pricing and terms.
- Internal tools with bounded scope. A 12-person law firm using an Assistant to help staff search their template library and precedents — that's a real fit, especially if they are already on OpenAI's enterprise tier for data controls.
What Custom Agent Architecture Gives You
A custom agent uses the Chat Completions API directly, with your own orchestration layer managing conversation state, tool calls, and memory. Usually built with LangChain, LlamaIndex, or custom code.
What you control:
Model choice. You can use any model — OpenAI, Anthropic Claude, Google Gemini, open-source models via Ollama or Together AI. You're not locked to OpenAI. In practice this matters when you want GPT-4o for complex reasoning steps but a much cheaper model (like GPT-4o-mini or Claude Haiku) for document classification or intent routing. We commonly build pipelines that spend 80% of their compute on cheap models and reserve expensive calls for the steps that actually need them.
Memory architecture. You decide how conversation history is stored, compressed, and retrieved. Redis, PostgreSQL, vector databases, or in-memory — based on your requirements, not someone else's defaults. For a healthcare platform serving patients across sessions, you might store structured summaries rather than raw transcripts, run nightly compression jobs, and retrieve only the most relevant prior context per query. None of that is possible through the Assistants API's thread management.
Retrieval strategy. Full control over chunking, embedding models, vector databases, hybrid search, re-ranking, and query decomposition. You can optimise for retrieval quality instead of accepting whatever OpenAI ships. A client in the legal sector found that OpenAI's built-in file search missed about 18% of relevant clauses on their test set; a custom retrieval pipeline using recursive chunking, a cross-encoder re-ranker, and hybrid BM25 + vector search got that miss rate below 4%.
Orchestration logic. Complex agent behaviours — multi-agent coordination, conditional routing, parallel tool calls, custom retry logic — need custom orchestration that the Assistants API can't accommodate. An e-commerce returns agent might run an intent classifier, a sentiment scorer, and a policy lookup in parallel before deciding which response path to take. Building that in Assistants API runs would mean a slow sequential chain; in custom code it's a straightforward async fan-out.
Cost control. Custom architectures let you optimise token usage, use cheaper models for specific steps, and implement caching strategies that reduce cost at scale. The difference shows up on the bill. One SaaS product we optimised had an initial cost of $0.14 per user conversation using the Assistants API. After migrating to a custom architecture with prompt caching, model routing, and context compression, the same conversations cost $0.031 — a 78% reduction that made the unit economics viable without changing the product experience.
Data residency. With a custom architecture, you can self-host models or choose providers with specific data residency guarantees. Conversation data can stay within your infrastructure. This is not optional for many clients in finance, healthcare, or any company operating under UK GDPR or similar frameworks.
When custom architecture makes sense:
- Production customer-facing agents. Cost optimisation, caching, and performance tuning that the Assistants API doesn't support.
- Multi-model or multi-provider requirements. Different models for different tasks.
- Complex agent orchestration. Multi-agent systems, complex conditional logic, or behaviours that go beyond the Assistants API's run management.
- High retrieval quality requirements. The quality of document retrieval is a primary product differentiator and you need control over every part of the pipeline.
- Data sovereignty. Conversation data can't leave a specific jurisdiction or infrastructure.
- Regulated environments. Financial services, healthcare, legal — where you need full auditability and control over data processing.
The Honest Trade-Offs
| Factor | Assistants API | Custom Architecture |
|---|---|---|
| Time to first working prototype | Hours | Days to weeks |
| Control over retrieval quality | Low | High |
| Model flexibility | OpenAI only | Any model |
| Cost at scale | Higher (OpenAI pricing) | Lower (optimisable) |
| Maintenance overhead | Low | Higher |
| Data residency control | Limited | Full |
| Complex orchestration | Limited | Full |
| Debugging transparency | Limited | Full |
| Vendor lock-in | High | Low |
| Retrieval miss rate (typical) | 10–20% | 2–6% (with tuning) |
| Monthly cost at 100k conversations | $1,400–2,800 est. | $400–900 est. (optimised) |
These figures are estimates based on typical usage patterns we've observed — they will vary by application, model tier, and conversation length.
The Assistants API Limitations Worth Knowing
Rate limits and latency. Assistants API runs are asynchronous — you submit a run and poll for completion. That adds latency compared to a direct Chat Completions call. Under load, run queue times can be unpredictable, and we've felt this in client projects. For a customer-facing application expecting sub-2-second response times, the polling overhead alone can push you over that threshold before you've even factored in the model call.
File search quality ceiling. Built-in file search works well for simple document Q&A. For production RAG where retrieval quality is the whole game — large document sets, complex queries, domain-specific content — custom retrieval consistently outperforms. The gap is especially pronounced with technical documentation, legal text, and documents where a query requires pulling context from multiple non-adjacent sections.
Pricing at scale. Assistants API includes costs for storage and processing that compound at high volume. Custom architectures can be meaningfully cheaper when volume is high and someone has done the cost optimisation work. OpenAI charges for file storage per day, assistant runs per call, and vector store usage on top of token costs. That overhead is fine for low-volume tools; it becomes a meaningful line item at production scale.
Debugging difficulty. When an Assistant behaves unexpectedly, diagnosing the cause means working through OpenAI's tooling rather than your own logs. Custom architectures give you full visibility into every step, which matters more than it sounds until you're trying to chase a weird bug at 11pm. In production systems we instrument every tool call, every retrieval result, and every model decision so we can trace any user complaint back to the exact sequence of events that caused it.
Dependency risk. The Assistants API has changed significantly since launch. Building a production system on a proprietary, evolving API creates dependency risk that custom architectures avoid. The Assistants API introduced breaking changes to its runs model in 2024, requiring teams to update their polling logic. Custom architectures using Chat Completions directly are more stable because that API has far more backward-compatibility pressure on it.
What to Expect in Practice
Assistants API path: A typical prototype takes one to three days for a developer familiar with the API. You will spend time on the system prompt, file upload format, and function schemas. You will hit the file search quality ceiling around the point your stakeholders start asking "why did it miss this obvious document?" Expect to spend time writing prompt workarounds for retrieval failures rather than improving the retrieval itself.
Custom architecture path: Budget two to four weeks for a solid first production version, including the orchestration layer, retrieval pipeline, and observability setup. The early investment pays back quickly — you can tune every component, swap models without rewriting the agent, and add capabilities (caching, logging, cost monitoring) incrementally.
Common mistakes:
Starting with the Assistants API and not planning the migration is the most expensive mistake we see. Teams build product features on top of Assistants API abstractions, and when they eventually need to migrate — usually driven by cost or retrieval quality issues — the migration is expensive because the product logic is coupled to the API's concepts (threads, runs, assistants). If you build on the Assistants API for a prototype, keep the product layer thin and the Assistants API calls contained to a single module.
The second common mistake is underestimating retrieval quality. Many teams assume "it searched the documents, so it worked." Retrieval quality degrades gradually — you won't notice until someone asks a question the agent should answer and it gives a confident wrong answer. Build evaluation from day one: a test set of question/answer pairs against your documents, run it every time you change chunking or prompts.
A third mistake specific to custom architectures: not setting spending limits. An orchestration bug that causes an infinite tool-call loop will generate a large OpenAI bill before you notice. Set hard limits on tokens per run and spending per day before you go live.
Our Recommendation
Use the Assistants API for: Prototypes, MVPs, internal tools with moderate requirements, and applications where getting to "working" quickly outweighs the need for optimisation and control.
Use custom architecture for: Production customer-facing agents, any application with meaningful scale, systems requiring high retrieval quality, regulated environments, and multi-agent orchestration.
The hybrid approach: Many teams prototype with the Assistants API, validate the use case, then migrate to custom when production requirements become clearer. This is a reasonable path — just plan the migration before you're under pressure to execute it. We've inherited "we'll migrate later" projects where "later" arrived in the form of a billing surprise. One SaaS team came to us with a $12,000/month Assistants API bill and a product that was starting to show retrieval failures at scale. The migration took six weeks and cut their monthly spend to $2,800 while improving answer accuracy. The delay cost them three months of avoidable spend.
Related guides
- Building multi-agent systems: when one agent isn't enough
- LangChain vs LlamaIndex: which framework to use
- How to build an AI agent without code
- Our AI agent development services
What We Build With
We build custom agent architectures for production deployments. We use the Assistants API for rapid prototyping and proof-of-concept work. The decision is made explicitly at the start of every project, with the trade-offs written down — not handed off as a "choice we'll figure out later."
Talk to us about your agent — we'll tell you which approach fits your specific requirements and why, including the cases where the Assistants API is genuinely the right call.
Frequently Asked Questions
Can I start with the Assistants API and switch to a custom agent later?
Yes, but plan the migration before you build, not after. Keep your Assistants API calls inside a single module or service layer so your product features don't couple directly to OpenAI's abstractions (threads, runs, assistants). Teams that do this can migrate in two to three weeks; teams that build product logic directly on top of those abstractions often need two to three months.
How much does the Assistants API cost compared to building a custom agent?
The Assistants API adds storage and processing fees on top of token costs — roughly $0.10 per GB of file storage per day and vector store query fees on top of model costs. For a low-volume internal tool, that overhead is negligible. At 50,000+ conversations per month, the difference between an optimised custom architecture and the Assistants API is typically 50–80% lower cost for the custom path. The custom architecture requires upfront build investment, so the break-even point depends on your volume and development costs.
Is the Assistants API good enough for a customer-facing SaaS product?
It depends on your scale and retrieval requirements. For early-stage products with under 5,000 monthly active users and straightforward document Q&A, many teams ship on the Assistants API without problems. Once you hit meaningful volume or start needing accurate retrieval over large, complex document sets, the limitations become product problems. Most customer-facing SaaS products we've worked with eventually need a custom architecture — the question is whether you build it from the start or migrate later.
What framework should I use for a custom agent — LangChain, LlamaIndex, or something else?
It depends on the primary job the agent needs to do. LlamaIndex is stronger for document-heavy retrieval applications — its indexing and retrieval abstractions are more mature. LangChain offers a broader set of integrations and is better for complex orchestration workflows with multiple tools and agents. For simpler use cases, we often write a thin custom orchestration layer directly on the Chat Completions API rather than adopting a framework, because frameworks add abstraction layers that complicate debugging without adding much value at small scale.
How do I evaluate whether my AI agent's retrieval is good enough?
Build a test set of at least 50 representative question/answer pairs against your documents before you deploy anything. Run the agent against that set and measure retrieval accuracy: did it find the right source? Did it answer correctly? Set a threshold — for most business applications, you want over 90% retrieval accuracy before shipping to users. Run this evaluation every time you change chunking strategy, embedding model, or prompts. Without this, you're guessing.
Does the Assistants API work for regulated industries like finance or healthcare?
It depends on the specific regulation and what data you are processing. OpenAI offers a Business Associate Agreement (BAA) for healthcare customers under its enterprise tier, which enables HIPAA-compatible use for some applications. For financial services under FCA regulation in the UK, or for applications requiring data residency within specific jurisdictions, the Assistants API's data handling — where OpenAI processes and stores your conversation data — often does not meet the requirements. Regulated environments almost always end up needing custom architectures with self-hosted or EU/UK-resident cloud deployments.
How long does it take to build a production-ready custom AI agent?
For a focused use case — a customer support agent with retrieval over a defined document set and three to five tool integrations — expect four to eight weeks for a team of two developers. That includes the orchestration layer, retrieval pipeline, evaluation setup, and basic observability. Simpler use cases (single-turn Q&A, no complex tool use) can be production-ready in two to three weeks. Multi-agent systems with complex routing logic take longer — typically three to four months for the first production version.
