Why the Best AI Agents Are Built Without Frameworks (Primitives over Frameworks) — Ahmad Awais, CHAI

AI EngineerAbout 6 min readJun 4, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

AI Agents, AI Primitives, AI Frameworks, Augmented LLM, Prompt Chaining and Composition, Agent Router, Parallel Agents, Agent Orchestrator Worker, Evaluator Optimizer, Memory (as a primitive), Threads (as a primitive), Parser, Chunker, Langbase, Chai, Serverless AI Agents, Production-Ready AI Agents.

Main Topics and Key Points

The Shift from AI Frameworks to AI Primitives

  • Argument: Production-ready AI agents are increasingly built on AI primitives rather than AI frameworks.
  • Reasoning: Frameworks are often bloated, slow-moving, and filled with unnecessary abstractions. Primitives offer more flexibility and scalability.
  • Examples: Perplexity, Cursor v0, Lovable Bold, and Chai are cited as examples of production-ready agents not built on AI frameworks.
  • Analogy: Amazon S3 is presented as an example of a successful primitive (object storage) that scales massively without being a framework.

AI Agents as a New Way of Writing Code

  • Perspective: AI agents represent a fundamental shift in how code is written and applications are built.
  • Implication: Traditional coding practices and software architectures are being transformed by AI.
  • Focus: The emphasis should be on building small, reusable building blocks (primitives) that can be composed across the stack.
  • Example: Threads (for storing conversation context) are presented as a useful primitive for many agents.

The Rise of the AI Engineer

  • Trend: Engineers from various backgrounds (full-stack, web, front-end, DevOps, ML) are transitioning into AI engineering roles.
  • Motivation: The increasing demand for shipping products with AI is driving this shift.
  • Langbase's Goal: To improve the experience of AI engineers by providing tools and primitives for building production-ready AI agents quickly.

Langbase's Approach: Composable AI Primitives

  • Methodology: Building AI agents on top of predefined, highly scalable, composable AI primitives.
  • Benefit: This approach results in serverless AI agents that can automatically handle heavy lifting.
  • Primitives Examples: Memory (with a vector store), parsing, chunking, threads, and tools infrastructure.

Eight AI Agent Architectures Built with AI Primitives

The talk then dives into eight different AI agent architectures, all built using AI primitives:

1. Augmented LLM

  • Description: An agent that takes input, generates output, and uses an LLM.
  • Primitives Used: Tools (for connecting to APIs), threads (for storing conversation context), and memory (for long-term data storage).
  • Functionality: Can connect to APIs, store conversation history, and access large datasets.

2. Prompt Chaining and Composition

  • Description: Multiple agents working together in a sequence.
  • Process: An agent's output determines whether to proceed to the next agent in the chain.
  • Example: A spam filter agent followed by an email drafting agent.

3. Agent Router

  • Description: An LLM router decides which specialized agent to call next based on the task.
  • Example: A routing agent chooses between a summary agent (Gemini), a reasoning agent (DeepSeek Llama 70B), and a coding agent (Claude Sonnet).
  • Code Structure: The code uses AI primitives to build the routing agent and specialized agents, avoiding AI frameworks.

4. Parallel Agents

  • Description: Running multiple agents concurrently.
  • Implementation: Achieved using JavaScript's Promise.all() to execute agents in parallel.
  • Example: Running a sentiment analysis agent and a summarization agent simultaneously.

5. Agent Orchestrator Worker

  • Description: An orchestrator agent plans subtasks for worker agents, which then complete those tasks.
  • Process: The orchestrator generates subtasks, worker agents execute them, and the results are synthesized by another agent.
  • Example: Writing a blog post on remote work benefits, with subtasks for introduction, productivity, work-life balance, environmental impact, and conclusion.

6. Evaluator Optimizer

  • Description: An agent generates a response, and another agent (the evaluator) judges its quality and provides feedback.
  • Process: The evaluator accepts or rejects the response with specific feedback for improvement.
  • Example: Generating a marketing copy for an eco-friendly water bottle and having an evaluator assess its appeal to eco-conscious millennials.

7. Tools Integration

  • Description: Agents can call external tools and APIs to perform tasks.

8. Memory

  • Description: Agents can upload data to a memory (vector store), retrieve relevant information, and answer questions based on that data.
  • Process: Data is parsed, chunked, and embedded for similarity search.
  • Example: Uploading PDF documents and then asking questions about their content.

Chai: Vibe Coding AI Agents with Primitives

  • Functionality: Chai allows users to "vibe code" AI agents by building them on top of AI primitives.
  • Example: The "chat with PDF" feature automatically creates a memory, uploads the PDF, and builds an agent to answer questions about the document.
  • Customization: Users can modify the generated code and deploy the agent.
  • Additional Examples: Deep researcher, receipt checker (using OCR), and image analyzer.

Notable Quotes

  • "All these AI agents in production are actually not built on top of any AI frameworks because well frameworks do not really add that much value." - Ahmed
  • "AI agents are just a new way of writing code." - Ahmed
  • "Most of engineers are going to become AI engineers." - Ahmed

Technical Terms and Concepts

  • AI Primitives: Basic building blocks for AI agents, such as memory, threads, parsers, chunkers, and tools.
  • AI Frameworks: Pre-built software structures that provide a foundation for building AI applications.
  • LLM (Large Language Model): A type of AI model trained on vast amounts of text data, capable of generating human-like text.
  • Vector Store: A database that stores data as vectors, enabling efficient similarity search.
  • Threads: A primitive for storing and managing conversation context or asynchronous context.
  • Parser: A primitive for extracting context from documents or other data sources.
  • Chunker: A primitive for splitting data into smaller pieces for processing.
  • Serverless AI Agent: An AI agent that runs on a serverless computing platform, automatically scaling resources as needed.
  • OCR (Optical Character Recognition): Technology that converts images of text into machine-readable text.

Logical Connections

  • The talk begins by establishing the problem: the limitations of AI frameworks.
  • It then introduces the solution: building AI agents with AI primitives.
  • The speaker provides examples of successful agents built with primitives.
  • The talk then presents eight different agent architectures, demonstrating how primitives can be used to build a variety of AI applications.
  • Finally, the speaker showcases Chai as a tool for easily building and deploying AI agents with primitives.

Data, Research Findings, or Statistics

  • Ahmed's open-source packages have been downloaded 40-50 million times a year.
  • Reference to stateofaiagents.com, a resource for learning about how people are building agents and the primitives they are using.

Synthesis/Conclusion

The core message is that AI development is moving away from monolithic frameworks and towards composable primitives. By building AI agents with these fundamental building blocks, developers gain greater flexibility, scalability, and control. Tools like Langbase and Chai are making it easier to leverage AI primitives and build production-ready AI agents quickly. The future of AI engineering lies in mastering these primitives and composing them to create innovative solutions.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.