Into AI

Into AI

Share this post

Into AI
Into AI
Building Your First Agentic RAG From Scratch
Copy link
Facebook
Email
Notes
More

Building Your First Agentic RAG From Scratch

Learn to build a Multi-agentic RAG system from the very basics and understand its components in depth.

Dr. Ashish Bamania's avatar
Dr. Ashish Bamania
Apr 05, 2025
∙ Paid
6

Share this post

Into AI
Into AI
Building Your First Agentic RAG From Scratch
Copy link
Facebook
Email
Notes
More
3
Share
Image generated with Google ImageFX

Last week, we learned how to code up a vector database from scratch and perform RAG on it.

If you missed that post, here’s a link to it:

Build A Vector Database From Scratch To Understand RAG In Depth

Build A Vector Database From Scratch To Understand RAG In Depth

Dr. Ashish Bamania
·
Mar 29
Read full story

This week, we will use this database to build a multi-agentic RAG system.

We will also learn to write custom tools that our agents can use to access the database and the web.

Let’s begin!


Time For Some Agentic RAG

Agentic RAG is a step forward from traditional RAG systems.

It involves combining traditional RAG with AI agents, which are autonomous systems that can reason, plan, and take multiple steps to complete a task.

Agentic RAG is all about agents using retrieval as one of their tools.

To understand it better, we will create a simple customer chatbot that dynamically performs RAG over a company’s data or the Internet.

We use CrewAI (instead of LangChain) as our framework to build this.

This is because CrewAI is much simpler to use, is rapidly growing, has an active and helpful community, and has an amazing documentation.

If you’re new to CrewAI or to building AI agents, I would recommend starting here:

Building Your First AI Agent (That Will Actually Improve You As An AI Engineer)

Building Your First AI Agent (That Will Actually Improve You As An AI Engineer)

Dr. Ashish Bamania
·
Mar 15
Read full story

For others, it’s time to get coding!


Installing Packages

We start by installing the CrewAI packages to build our Agentic RAG system, as follows.

!uv pip install crewai

We can also install the crewai-tools package to equip our agents with pre-built CrewAI tools, but since this lesson is all about understanding things in depth, we will write the RAG and Web Search tools from scratch.

Keep reading with a 7-day free trial

Subscribe to Into AI to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Dr. Ashish Bamania
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More