Agentic AI Notebook
CrewAI
Phase 13Module 9 of 14

Knowledge and RAG

Crews that 'know the docs' without retrieval hallucinate. Knowledge is how an agent actually reads the contract.

Memory is your notes. Knowledge is the company wiki you search when the notes are not enough.

Visual Workflows

Start here — scroll inside each diagram frame to explore, then use + / to zoom up to 200% if needed.

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

Key Takeaways

  • 1.Knowledge is external information you attach so an agent can retrieve it — docs, PDFs, site dumps. The interesting question is when the agent should retrieve, not always retrieve.
  • 2.Chunk, embed, store, retrieve, then pack into the agent — this is RAG you already know. Knowledge is a complement to memory, not a replacement.
  • 3.Attach a knowledge source to an Agent or Crew. Gate retrieval: a rename-the-variable task does not need the design doc.
  • 4.Filter by metadata. Compress hits before they enter the task context.

Learn elsewhere

  • RAG — Phase 3
  • Context Engineering — Phase 6
  • Memory

Real Example

Scenario

Writer retrieves only the research notes for this topic, not the entire knowledge base.

What you would do

In CrewAI, apply Knowledge and RAG to this scenario: Writer retrieves only the research notes for this topic, not the entire knowledge base. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Commands

Commands to Remember

  • Knowledge = retrieved docs
  • Retrieve when needed
  • Filter by metadata
  • Compress before packing

Cheat Sheet

Quick recap

quick ref
  • Wiki ≠ notebook
  • Gate retrieval
  • Reuse RAG skills
  • Cite the chunk

Common Mistakes

  • Skipping evaluation for Knowledge and RAG before production
  • No logging or tracing around crewai knowledge steps
  • Ignoring cost and latency implications