Skip to content

002_Context_Engineering

Amresh Verma edited this page Jun 18, 2026 · 3 revisions

Context Engineering

Definition

    Context engineering is the practice of managing all information that enters an LLM's context.

Components:

Retrieval Context

     Information fetched from knowledge sources.

Conversation Memory

     Previous user interactions.

Application State

     Current workflow information.

Prompt Design

     Instructions guiding the model.

Storage Layer

  • Vector databases
  • Traditional databases
  • Hybrid storage systems

The workshop positions context engineering as the next evolution beyond prompt engineering.

Real-Life Example

Imagine a shopkeeper asks:

 "How much should I charge customer Amit?"

AI needs:

  Customer name = Amit
  Products in cart
  Discount rules
  GST rules
  Wallet balance

Without this information:

  AI = Guessing

With this information:

  AI = Accurate

Providing all this information is Context Engineering.

Today: Context Engineering

Now we provide much more than a prompt.

           Prompt
              +
           Company Documents
              +
           Customer Data
              +
           Previous Chats
              +
           Current Order
              +
           Database Information
             ↓
           LLM

This is Context Engineering.

Example: Your Kirana Shop App

Suppose you say through voice:

 "Add 2 kg sugar for customer Ram."

AI needs context:

Current Voice Command

  Add 2 kg sugar

Customer Information

 Customer: Ram

Wallet: ₹500

Product Information

 Sugar Price = ₹45/kg
 Stock = 100 kg

Business Rules

Apply GST

Apply Loyalty Points

All together:

     Voice Command
         +
     Customer Data
          +
     Product Data
          +
     Business Rules
          ↓
         LLM
         ↓
     Generate Bill

This is Context Engineering.

Components of Context Engineering

1. Prompt

Instructions for AI.

You are a billing assistant.

2. Retrieval (RAG)

Fetch data from documents.

     Question
     ↓
     Search PDF
     ↓
     Relevant Content
     ↓
     LLM

3. Memory

Remember previous conversation.

Customer selected:

  • Rice
  • Sugar
  • Oil

4. Database Data

Current business information.

  • Wallet Balance
  • Stock
  • Orders
  • Invoices

5. Tools

Allow AI to perform actions.

  • Create Bill
  • Send SMS
  • Generate PDF
  • Save Order

Why Context Engineering Matters

Without context:

User: What's my balance?

AI:

 I don't know.

With context:

Database:

Balance = ₹1250

AI:

   Your balance is ₹1250.
   Context Engineering in Your Voice Billing App

Architecture:

 Headphone Mic
    ↓
 Whisper
    ↓
 Speech Text
    ↓
 Context Builder
    ↓
 Ollama (Llama 3)
    ↓
 Billing Service
    ↓
 Invoice

Context Builder collects:

  • Current Customer
  • Current Cart
  • Product Prices
  • Stock
  • GST Rules
  • Wallet Balance
  • Previous Commands

Then sends everything to the LLM.

That Context Builder is doing Context Engineering.

Clone this wiki locally