Books → Learning Ai From Scratch → Introduction → Chapter 18


Chapter 18

 

Chapter 18

Complete Example Projects

Project blueprints for building practical AI, GenAI, RAG, and LLM applications

 

This chapter converts the concepts from previous chapters into complete project blueprints. Each project is written so that a beginner can understand the business problem, architecture, data flow, implementation plan, testing strategy, and future enhancements. These projects can be used as portfolio projects, proof-of-concepts, internal company demos, or starting points for production applications.

Chapter Learning Objectives

  • Understand how to convert AI concepts into working end-to-end applications.
  • Learn how to design architecture for chatbot, RAG, classification, summarization, and learning assistant systems.
  • Understand the role of prompts, embeddings, vector databases, APIs, databases, monitoring, and evaluation in real projects.
  • Learn how to design database tables and REST APIs for AI applications.
  • Create a project portfolio roadmap that can help a learner move from theory to implementation.

How to Read This Chapter

Do not read these projects only as theory. For every project, first understand the problem statement, then trace the architecture diagram, then read the data flow step by step. After that, look at the database design and API design. Finally, implement a minimum viable version before adding advanced features. This is the same approach used in real enterprise software delivery.

Common Project Architecture Pattern

Most LLM applications follow a similar high-level pattern. A user interacts with an interface. The backend validates the request, prepares prompts or retrieval steps, calls AI models or tools, stores logs, and returns the response. In production, the same application also needs authentication, security, monitoring, evaluation, and feedback collection.

+----------------+       +----------------+       +----------------------+
| User Interface | ----> | Backend / API  | ----> | AI Orchestration     |
| Web / Mobile   |       | Auth + Logic   |       | Prompt + Tools + RAG |
+----------------+       +----------------+       +----------------------+
                                                        |       |
                                                        v       v
                                              +-------------+  +-------------+
                                              | LLM / Model |  | Vector DB   |
                                              +-------------+  +-------------+
                                                        |
                                                        v
                                              +-------------------------+
                                              | Logs, Metrics, Feedback |
                                              +-------------------------+

 

Project 1: AI FAQ Chatbot

Problem Statement

An organization has many repeated questions from students, customers, employees, or users. Support teams repeatedly answer questions such as pricing, refund policy, course duration, login problems, and contact details. The goal is to build a simple AI FAQ chatbot that answers common questions using a controlled FAQ knowledge base.

Architecture Diagram

+-------------+      +----------------+      +---------------------+
| User        | ---> | Chat UI        | ---> | Backend API         |
| Question    |      | Website/App    |      | Validate + Route    |
+-------------+      +----------------+      +---------------------+
                                                   |
                                                   v
                                         +--------------------+
                                         | FAQ Knowledge Base |
                                         | DB / JSON / CSV    |
                                         +--------------------+
                                                   |
                                                   v
                                         +--------------------+
                                         | Prompt Builder     |
                                         +--------------------+
                                                   |
                                                   v
                                         +--------------------+
                                         | LLM Response       |
                                         +--------------------+
                                                   |
                                                   v
                                         +--------------------+
                                         | Answer + Feedback  |
                                         +--------------------+

 

Data Flow

1. User opens the website chatbot and asks a question.

2. Frontend sends the question to the backend API.

3. Backend checks user session, rate limit, and input safety.

4. Backend searches FAQ records using keyword search or simple semantic search.

5. Prompt builder creates a controlled prompt using matched FAQ entries.

6. LLM generates a clear answer using only approved FAQ content.

7. System returns the answer and asks whether it was helpful.

8. User feedback is stored for improving FAQ quality.

Required Components

Component

Responsibility

Chat UI

Allows users to ask questions and read answers.

Backend API

Receives questions, validates inputs, calls search and LLM services.

FAQ Store

Stores approved questions, answers, category, status, and last updated date.

Search Module

Finds the most relevant FAQ entries.

Prompt Template

Controls the format and behavior of the LLM response.

LLM

Generates a natural-language answer based on selected FAQ data.

Feedback Store

Captures thumbs up/down, comments, unresolved questions.

 

Suggested Tech Stack

Layer

Beginner Option

Production Option

Frontend

HTML/CSS/JavaScript, Streamlit

React, Angular, mobile app

Backend

Python FastAPI or Flask

FastAPI with authentication and logging

FAQ Data

CSV or SQLite

PostgreSQL or managed database

AI Model

Free/local small model or API trial

Cloud LLM with governance

Monitoring

Simple logs

Dashboard with latency, cost, unresolved queries

 

Database Design

Table / Collection

Important Fields

Purpose

faqs

id, question, answer, category, tags, status, updated_at

Stores approved FAQ knowledge.

chat_sessions

session_id, user_id, started_at, channel

Tracks conversation sessions.

chat_messages

id, session_id, role, message, created_at

Stores user and assistant messages.

feedback

id, message_id, rating, comment, created_at

Stores answer quality feedback.

 

API Design

Endpoint

Method

Input

Output

/api/chat

POST

question, session_id

answer, sources, confidence

/api/feedback

POST

message_id, rating, comment

success status

/api/faqs

GET

category, search text

list of FAQs

/api/admin/faqs

POST

question, answer, tags

created FAQ record

 

Step-by-Step Implementation Plan

1. Create a small FAQ dataset with 30 to 100 approved questions and answers.

2. Build a simple chat screen with a text box and message history.

3. Create a backend API endpoint that accepts a user question.

4. Implement basic FAQ retrieval using keyword search first.

5. Add an LLM prompt that uses only retrieved FAQ entries.

6. Return the answer with a source FAQ title or category.

7. Add feedback buttons for helpful and not helpful.

8. Create an admin screen to add or update FAQ records.

9. Log unanswered questions and review them weekly.

Example Prompts

System: You are a helpful support assistant. Answer only from the FAQ context. If the answer is not available, say that you do not have enough information and suggest contacting support.

FAQ Context:
{faq_context}

User Question:
{question}

Answer in simple language:

 

User: What is your refund policy?
Assistant: Use the FAQ context to answer briefly and mention the support email if required.

 

Example Outputs

Our refund policy allows refund requests within 7 days of purchase if the course has not been substantially consumed. For special cases, please contact support with your order ID.
 

I do not have enough information in the FAQ to answer that. Please contact the support team or check the official policy page.
 

Testing Strategy

  • Test exact FAQ matches such as refund policy and course duration.
  • Test similar wording such as “Can I get my money back?” for refund policy.
  • Test out-of-scope questions and ensure the bot does not invent answers.
  • Test long or malicious inputs to check input handling.
  • Measure answer helpfulness using user feedback.
  • Review unanswered questions and convert repeated ones into new FAQs.

Future Enhancements

  • Add semantic search using embeddings for better matching.
  • Add multilingual FAQ support for Hindi and English.
  • Add admin approval workflow for new FAQ answers.
  • Add analytics for top questions and unresolved topics.
  • Integrate with WhatsApp, website chat, or helpdesk software.
 

 

Project 2: RAG-based Company Document Assistant

Problem Statement

A company has many PDF, DOCX, HTML, and policy documents. Employees waste time searching for leave rules, travel policy, reimbursement limits, security standards, project guidelines, and process documents. The goal is to build a RAG-based assistant that retrieves relevant passages and answers with source citations.

Architecture Diagram

                  INDEXING PIPELINE
+-------------+   +-------------+   +-------------+   +--------------+
| Documents   |-->| Loader      |-->| Chunking    |-->| Embeddings   |
| PDF/DOCX    |   | Parser/OCR  |   | + Metadata  |   | Model        |
+-------------+   +-------------+   +-------------+   +--------------+
                                                           |
                                                           v
                                                   +---------------+
                                                   | Vector DB     |
                                                   +---------------+

                  QUERY PIPELINE
+-------------+   +-------------+   +-------------+   +--------------+
| User Query  |-->| Query Embed |-->| Retriever   |-->| Re-ranker    |
+-------------+   +-------------+   +-------------+   +--------------+
                                                           |
                                                           v
                                                   +---------------+
                                                   | Context Build |
                                                   +---------------+
                                                           |
                                                           v
                                                   +---------------+
                                                   | LLM + Citation|
                                                   +---------------+

 

Data Flow

1. Admin uploads company documents or syncs them from a document repository.

2. Document loader extracts text and metadata from each file.

3. Chunking engine splits documents into meaningful sections.

4. Embedding model converts each chunk into a vector.

5. Vector database stores vectors, text chunks, source name, page, department, and date.

6. User asks a question in the chat interface.

7. System converts the question into an embedding and retrieves top relevant chunks.

8. Optional re-ranker improves result order.

9. Context builder prepares a prompt using retrieved chunks.

10. LLM generates an answer with source citations.

11. Feedback and logs are stored for evaluation and improvement.

Required Components

Component

Responsibility

Document Loader

Reads PDF, DOCX, HTML, TXT, CSV, or OCR output.

Chunking Engine

Splits long documents into smaller retrieval-friendly chunks.

Metadata Extractor

Captures file name, page number, department, version, access level.

Embedding Model

Converts chunks and queries into vectors.

Vector Database

Stores chunk vectors and metadata for similarity search.

Retriever

Finds top-K chunks related to user question.

Re-ranker

Reorders retrieved chunks based on relevance.

Prompt Builder

Combines instructions, question, and retrieved context.

LLM

Generates grounded answer based on context.

Citation Formatter

Returns document name, page, section, and link.

 

Suggested Tech Stack

Layer

Beginner Option

Production Option

Frontend

Streamlit or simple web UI

React with enterprise SSO

Backend

Python FastAPI

FastAPI/Kubernetes/serverless

Document Storage

Local folder

S3/GCS/Azure Blob/SharePoint

Vector DB

Chroma or FAISS

Pinecone, Qdrant, Milvus, pgvector

Database

SQLite

PostgreSQL

LLM

API-based model

Approved enterprise LLM gateway

 

Database Design

Table / Collection

Important Fields

Purpose

documents

doc_id, title, source_path, owner, version, status

Tracks source documents.

chunks

chunk_id, doc_id, chunk_text, page_no, section, hash

Stores retrievable text units.

embeddings

chunk_id, vector_id, model_name, created_at

Tracks embedding metadata.

queries

query_id, user_id, query_text, created_at

Stores user questions.

answers

answer_id, query_id, answer_text, sources, rating

Stores generated answers and feedback.

 

API Design

Endpoint

Method

Input

Output

/api/documents/upload

POST

file, metadata

document_id

/api/documents/index

POST

document_id

indexing status

/api/ask

POST

question, filters

answer, citations

/api/feedback

POST

answer_id, rating, comment

success status

 

Step-by-Step Implementation Plan

1. Create a document upload folder and collect sample policy documents.

2. Build a document parser for PDF and DOCX files.

3. Split documents into chunks of suitable size with overlap.

4. Generate embeddings for each chunk.

5. Store chunk text, metadata, and vectors in a vector database.

6. Create a retrieval function that accepts a question and returns top-K chunks.

7. Create a prompt template that instructs the LLM to answer only from retrieved context.

8. Return answer with citations such as document name and page number.

9. Add feedback, logs, and evaluation test cases.

10. Add role-based access so users only retrieve documents they are allowed to see.

Example Prompts

System: You are a company policy assistant. Use only the retrieved context. If the answer is not present, say so. Always cite sources.

Retrieved Context:
{context}

Question:
{question}

Answer with citations:

 

User: How many days of earned leave can an employee carry forward?
Context: HR Leave Policy, page 4, says employees may carry forward up to 30 days of earned leave.

 

Example Outputs

Employees may carry forward up to 30 days of earned leave, according to the HR Leave Policy, page 4.
 

I could not find a confirmed answer in the available documents. Please check with HR or upload the latest policy document.
 

Testing Strategy

  • Create 50 golden questions with expected answers and source documents.
  • Measure whether the correct source appears in top 3 retrieved chunks.
  • Test outdated documents and ensure version filtering works.
  • Test access control by department and role.
  • Test hallucination behavior by asking questions not present in documents.
  • Review citations and verify that answers are grounded in retrieved text.

Future Enhancements

  • Add hybrid search using keyword + semantic search.
  • Add re-ranking for improved retrieval quality.
  • Add document versioning and expiry alerts.
  • Add SharePoint, Google Drive, or Confluence connectors.
  • Add multilingual answers while citing original English documents.
  • Add evaluation dashboard for retrieval accuracy, answer quality, cost, and latency.
 

 

Project 3: AI Ticket Classification and Routing System

Problem Statement

An IT support or business operations team receives many tickets. Manual triage wastes time because each ticket must be read and assigned to the right team such as Network, Database, Hardware, Security, HR Payroll, or Application Support. The goal is to classify tickets automatically and route them to the correct team with confidence score and explanation.

Architecture Diagram

+-------------+     +--------------+     +-------------------+
| Ticket      | --> | Preprocess   | --> | Classification    |
| Portal/Email|     | Clean Text   |     | Prompt/Embedding  |
+-------------+     +--------------+     +-------------------+
                                               |       |
                                               v       v
                                      +-------------+  +-------------+
                                      | Team Label  |  | Confidence  |
                                      +-------------+  +-------------+
                                               |
                                               v
                                      +-------------------+
                                      | Route to Queue     |
                                      | Notify + Monitor   |
                                      +-------------------+

 

Data Flow

1. Ticket arrives from portal, email, chat, or API.

2. System extracts subject, description, requester, priority, and attachments if needed.

3. Text is cleaned and normalized.

4. Classification engine predicts the most suitable support team.

5. Confidence score is calculated using model output or similarity score.

6. Low-confidence tickets go to manual review.

7. High-confidence tickets are routed automatically to the correct queue.

8. Resolved ticket outcomes are stored as training or evaluation data.

Required Components

Component

Responsibility

Ticket Ingestion

Receives tickets from email, portal, or API.

Preprocessor

Cleans text, removes signatures, extracts important fields.

Label Taxonomy

Defines teams and categories such as Network, Security, Database.

Classifier

Predicts routing team using prompting, embeddings, or fine-tuning.

Confidence Engine

Determines whether auto-routing is safe.

Workflow Router

Creates or updates ticket assignment.

Human Review Queue

Handles uncertain cases.

Monitoring Module

Tracks accuracy, misroutes, and team feedback.

 

Suggested Tech Stack

Layer

Beginner Option

Production Option

Frontend

Simple admin page

ServiceNow/Jira/Zendesk integration

Backend

Python FastAPI

Microservice with queue workers

Database

SQLite

PostgreSQL

AI Method

Prompting or embedding similarity

Fine-tuned classifier plus fallback LLM

Workflow

Manual CSV export/import

Ticketing system API integration

 

Database Design

Table / Collection

Important Fields

Purpose

tickets

ticket_id, subject, description, requester, status, actual_team

Stores ticket data and outcome.

labels

label_id, team_name, description, examples

Stores classification taxonomy.

predictions

ticket_id, predicted_team, confidence, method, explanation

Stores AI predictions.

routing_audit

ticket_id, old_team, new_team, routed_by, timestamp

Tracks routing actions.

review_queue

ticket_id, reason, reviewer, decision

Stores low-confidence review tasks.

 

API Design

Endpoint

Method

Input

Output

/api/tickets/classify

POST

subject, description

team, confidence, explanation

/api/tickets/route

POST

ticket_id, team

routing status

/api/labels

GET

none

list of labels and descriptions

/api/review/decision

POST

ticket_id, final_team

saved decision

 

Step-by-Step Implementation Plan

1. Collect historical tickets with final resolved team labels.

2. Create a clean taxonomy of teams and examples for each team.

3. Start with prompt-based classification using label descriptions.

4. Add embedding similarity by comparing new tickets with historical examples.

5. Combine both methods and calculate confidence.

6. Route only high-confidence predictions automatically.

7. Send low-confidence predictions to human review.

8. Store human corrections for evaluation and future improvement.

9. Build a dashboard for misclassified tickets and routing accuracy.

Example Prompts

Classify the ticket into one of these teams: Network, Hardware, Database, Security, HR Payroll, Application Support.

Ticket Subject: VPN not connecting after password reset
Ticket Description: User cannot connect to VPN from home after password change.

Return JSON with team, confidence, and reason.

 

Use the following historical examples to classify the new ticket. Choose the closest support team and explain briefly.

Examples:
- VPN is not connecting from home -> Network
- Oracle connection timeout -> Database
- Suspicious email link clicked -> Security

New ticket: {ticket_text}

 

Example Outputs

{"team": "Network", "confidence": 0.86, "reason": "The ticket mentions VPN connectivity after password reset, which is usually handled by the Network team."}
 

{"team": "Security", "confidence": 0.91, "reason": "The ticket reports a suspicious email link, which requires security investigation."}
 

Testing Strategy

  • Create a test set of at least 200 historical tickets.
  • Measure accuracy by team and not only overall accuracy.
  • Track false routing cases because they affect support SLA.
  • Test ambiguous tickets that mention multiple systems.
  • Review confidence threshold weekly.
  • Compare prompt-only, embedding-only, and combined approaches.
  • Ask team leads to review a sample of predictions.

Future Enhancements

  • Integrate with Jira, ServiceNow, Freshdesk, or Zendesk.
  • Add auto-priority prediction and SLA recommendation.
  • Add duplicate ticket detection using embeddings.
  • Add fine-tuning when enough clean labeled data is available.
  • Add suggested resolution articles from knowledge base.
  • Add multilingual ticket classification.
 

 

Project 4: AI Report Summarizer

Problem Statement

Business users, managers, analysts, and project leaders often receive long reports, meeting notes, PDFs, logs, and documents. Reading everything manually is slow. The goal is to create an AI report summarizer that accepts documents, extracts text, summarizes key points, highlights risks, and produces an executive summary.

Architecture Diagram

+-------------+     +-------------+     +------------------+
| Upload File | --> | Text Extract| --> | Chunk Documents  |
| PDF/DOCX    |     | Parser/OCR  |     | if Large         |
+-------------+     +-------------+     +------------------+
                                                |
                                                v
                                      +------------------+
                                      | Chunk Summaries  |
                                      +------------------+
                                                |
                                                v
                                      +------------------+
                                      | Final Summary    |
                                      | Risks + Actions  |
                                      +------------------+

 

Data Flow

1. User uploads a PDF, DOCX, TXT, or meeting transcript.

2. System extracts text and metadata such as title, author, date, and page count.

3. If the document is long, it is split into chunks.

4. Each chunk is summarized separately with a consistent prompt.

5. Chunk summaries are combined into a final executive summary.

6. System extracts risks, decisions, action items, dates, and open questions.

7. Final output is returned in a structured format and optionally saved as DOCX or PDF.

8. User can provide feedback or ask follow-up questions.

Required Components

Component

Responsibility

File Upload

Accepts report files and stores them securely.

Text Extractor

Extracts text from PDF, DOCX, TXT, or OCR.

Chunker

Splits long reports into manageable sections.

Summarizer Prompt

Creates summary, key points, risks, actions, and decisions.

LLM

Generates chunk and final summaries.

Validator

Checks missing sections, hallucination risk, and output format.

Export Module

Exports final summary to DOCX, PDF, or email.

 

Suggested Tech Stack

Layer

Beginner Option

Production Option

Frontend

Streamlit file upload

React dashboard

Backend

Python FastAPI

FastAPI with async workers

Storage

Local folder

Cloud object storage with encryption

Parsing

python-docx, pypdf

Enterprise document extraction/OCR

LLM

API model

LLM gateway with cost controls

Queue

None for small files

Celery, Cloud Tasks, Pub/Sub, SQS

 

Database Design

Table / Collection

Important Fields

Purpose

documents

doc_id, file_name, type, uploaded_by, status

Tracks uploaded reports.

document_chunks

chunk_id, doc_id, chunk_no, text, token_count

Stores extracted chunks.

summaries

summary_id, doc_id, summary_type, summary_text

Stores executive and detailed summaries.

action_items

id, doc_id, owner, action, due_date, status

Stores extracted action items.

validation_results

id, doc_id, issue_type, severity, note

Stores quality checks.

 

API Design

Endpoint

Method

Input

Output

/api/reports/upload

POST

file, summary_type

document_id

/api/reports/summarize

POST

document_id, options

summary_id

/api/reports/{id}/summary

GET

document_id

summary output

/api/reports/{id}/export

GET

format

download file

 

Step-by-Step Implementation Plan

1. Create a file upload screen.

2. Implement text extraction for DOCX and PDF files.

3. Create chunking logic for long documents.

4. Build a chunk-summary prompt that extracts key points, numbers, risks, and actions.

5. Build a final-summary prompt that combines chunk summaries.

6. Add output sections: executive summary, key findings, risks, action items, decisions, and open questions.

7. Add validation rules such as “do not create facts not present in the document.”

8. Store original file, extracted text, and final summary.

9. Add export to DOCX for business users.

Example Prompts

Summarize the following report section. Extract: 1) key points, 2) financial numbers, 3) risks, 4) decisions, 5) action items. Do not add information not present in the text.

Report Section:
{chunk_text}

 

Create an executive summary from these chunk summaries. Use clear headings: Overview, Key Findings, Risks, Actions, Decisions, Open Questions.

Chunk Summaries:
{chunk_summaries}

 

Example Outputs

Overview: The report discusses Q2 sales performance, major customer churn risks, and planned product improvements.

Key Findings: Revenue increased by 8%, but support escalations increased in the enterprise segment.

Risks: Delay in onboarding two large clients may affect Q3 target.

Actions: Sales operations must prepare revised onboarding plan by Friday.

 

Open Questions: The report does not clearly mention the owner for the migration risk. This should be clarified before final review.
 

Testing Strategy

  • Test short reports, long reports, scanned reports, and poorly formatted reports.
  • Compare AI summary with human-created summary for important facts.
  • Check whether the summary preserves numbers, names, and dates accurately.
  • Test hallucination by using reports with missing information.
  • Review action item extraction for owner, due date, and task clarity.
  • Measure processing time and cost per document.

Future Enhancements

  • Add section-wise summary with page references.
  • Add comparison between two reports.
  • Add risk scoring and priority tagging.
  • Add meeting transcript summarization.
  • Add email delivery of summaries.
  • Add dashboard of extracted actions and deadlines.
 

 

Project 5: AI Learning Assistant

Problem Statement

Learners often do not know what to study next, how to revise, or how to test themselves. The goal is to create an AI learning assistant that builds a personalized learning path, explains concepts, generates quizzes, tracks progress, and uses RAG to answer from uploaded learning materials.

Architecture Diagram

+-------------+      +-----------------+      +--------------------+
| Learner     | ---> | Learning UI     | ---> | Profile + Progress |
+-------------+      +-----------------+      +--------------------+
                                                   |
                                                   v
                                         +--------------------+
                                         | AI Tutor / Planner |
                                         +--------------------+
                                            |       |       |
                                            v       v       v
                                      +--------+ +------+ +----------+
                                      | RAG KB | | Quiz | | Roadmap  |
                                      +--------+ +------+ +----------+
                                                   |
                                                   v
                                         +--------------------+
                                         | Feedback + Analytics|
                                         +--------------------+

 

Data Flow

1. Learner creates a profile with goal, current level, available time, and preferred language.

2. System creates a learning roadmap with topics, resources, and exercises.

3. Learner studies a topic and asks questions.

4. RAG module retrieves explanations from uploaded notes or curated learning content.

5. AI tutor explains the concept in beginner-friendly language.

6. Quiz generator creates practice questions based on current topic.

7. System evaluates answers and updates progress.

8. Assistant recommends the next topic based on performance.

Required Components

Component

Responsibility

Learner Profile

Stores goals, current skill level, time availability, and preferences.

Roadmap Generator

Creates personalized study plan.

Content Store

Stores notes, lessons, examples, and resources.

RAG Module

Answers using uploaded or curated learning content.

Quiz Generator

Creates MCQ, short answer, and coding exercises.

Progress Tracker

Tracks completed lessons, quiz scores, weak areas.

Recommendation Engine

Suggests next lesson or revision topic.

Feedback Module

Captures learner difficulty and satisfaction.

 

Suggested Tech Stack

Layer

Beginner Option

Production Option

Frontend

Streamlit or simple web UI

React learning dashboard

Backend

FastAPI

Scalable API with user authentication

Database

SQLite

PostgreSQL

Vector DB

Chroma

Qdrant/Pinecone/pgvector

LLM

API model

Governed model gateway

Analytics

Basic charts

Learning analytics dashboard

 

Database Design

Table / Collection

Important Fields

Purpose

learners

learner_id, name, goal, level, daily_minutes

Stores learner profile.

topics

topic_id, title, prerequisite, difficulty

Stores curriculum topics.

lessons

lesson_id, topic_id, content, examples

Stores learning material.

quiz_questions

question_id, topic_id, question, options, answer

Stores generated or curated quizzes.

attempts

attempt_id, learner_id, question_id, answer, score

Tracks quiz performance.

progress

learner_id, topic_id, status, confidence_score

Tracks learning progress.

 

API Design

Endpoint

Method

Input

Output

/api/profile

POST

goal, level, daily_minutes

profile created

/api/roadmap

POST

learner_id, goal

learning roadmap

/api/ask

POST

learner_id, question, topic

answer and sources

/api/quiz/generate

POST

topic, difficulty, count

quiz questions

/api/quiz/submit

POST

answers

score and explanation

/api/progress

GET

learner_id

progress summary

 

Step-by-Step Implementation Plan

1. Create a learner profile form.

2. Define a curriculum with topics and prerequisites.

3. Create a prompt for personalized learning roadmap generation.

4. Add lessons or upload notes and index them for RAG.

5. Build a question-answer flow that retrieves content and explains concepts simply.

6. Create quiz generation prompt based on topic and difficulty.

7. Store quiz attempts and calculate weak areas.

8. Recommend revision topics based on wrong answers.

9. Create dashboard showing progress, strengths, and weak areas.

Example Prompts

You are an AI tutor. The learner is a beginner and knows basic Python. Explain the topic using simple language, one daily-life analogy, one IT example, and one small exercise.

Topic: {topic}
Learner Goal: {goal}

 

Generate 5 quiz questions on {topic}. Difficulty: beginner. Include one correct answer, three wrong options, explanation, and skill tag. Return JSON.
 

Example Outputs

Topic: Embeddings
Explanation: Embeddings convert words into numbers so a computer can compare meanings. For example, “car” and “vehicle” should be close in meaning even if the words are different.
Exercise: Write three pairs of words that are similar in meaning and three pairs that are different.

 

{"question": "What is the main purpose of embeddings?", "options": ["To convert text into vectors", "To store passwords", "To compress images only", "To replace databases"], "answer": "To convert text into vectors", "explanation": "Embeddings represent meaning as numbers so similarity search becomes possible."}
 

Testing Strategy

  • Test roadmap generation for different learner levels.
  • Check whether explanations are simple and not too technical for beginners.
  • Verify quiz answers and explanations manually for correctness.
  • Test RAG answers against uploaded course notes.
  • Track whether weak-area recommendations match quiz performance.
  • Collect learner feedback after each lesson.

Future Enhancements

  • Add voice-based learning assistant.
  • Add Hindi-English explanations for Indian learners.
  • Add spaced repetition revision reminders.
  • Add gamification badges and streaks.
  • Add teacher dashboard for class-level progress.
  • Add automatic assignment generation.
 

 

Cross-Project Comparison

Project

Primary AI Pattern

Best First Version

Production Upgrade

AI FAQ Chatbot

Controlled prompt + FAQ retrieval

CSV FAQ + simple chat UI

Semantic search, feedback analytics, admin workflow

Company Document Assistant

RAG

PDF/DOCX upload + vector DB

Hybrid search, re-ranking, access control, citations

Ticket Classification

Classification

Prompt-based classifier

Embedding similarity, fine-tuning, workflow integration

Report Summarizer

Summarization + extraction

File upload + summary prompt

Chunking, validation, action tracking, export

AI Learning Assistant

Tutor + RAG + quiz generation

Roadmap + Q&A + quiz

Progress analytics, personalization, multilingual support

 

Recommended Implementation Order for Beginners

A beginner should not start with the most complex architecture. Start with a small working version, then add components gradually.

1. Build the AI FAQ Chatbot first because it teaches UI, backend, prompt design, and simple retrieval.

2. Build the AI Report Summarizer second because it teaches file handling, chunking, and structured output.

3. Build the Ticket Classification system third because it teaches labels, confidence, and evaluation.

4. Build the RAG-based Company Document Assistant fourth because it combines document ingestion, embeddings, vector DB, retrieval, prompting, and citations.

5. Build the AI Learning Assistant last because it combines personalization, RAG, quiz generation, progress tracking, and recommendation.

Portfolio Strategy

If you want to use these projects for interviews, freelancing, or internal company demos, document each project clearly. A good portfolio project should include a problem statement, architecture diagram, screenshots, sample input/output, database design, API list, testing results, and future improvements. Do not only share code. Explain your design decisions.

Portfolio Item

What to Include

README file

Problem, features, setup steps, screenshots, demo flow.

Architecture diagram

Show UI, backend, LLM, vector DB, database, monitoring.

Sample data

Small safe dataset for demo. Do not use private company data.

Prompt examples

Show important prompt templates without exposing secrets.

Evaluation section

Show test cases, accuracy, retrieval quality, and limitations.

Cost note

Mention estimated token usage, model choice, and optimization methods.

Security note

Mention access control, input validation, PII masking, and audit logs.

 

Chapter Summary

This chapter provided five complete AI project blueprints. The AI FAQ chatbot introduced a simple controlled response system. The RAG-based company document assistant showed how to build a grounded knowledge assistant with citations. The ticket classification project demonstrated how AI can automate support routing. The report summarizer showed how to process long documents and generate executive summaries. The AI learning assistant combined personalization, RAG, quiz generation, and progress tracking. Together, these projects cover the most common LLM application patterns used in real organizations.

Key Terms

Term

Meaning

Project blueprint

A structured plan that explains problem, architecture, components, implementation, testing, and enhancements.

MVP

Minimum viable product; the smallest useful version of a system.

RAG project

An application that retrieves relevant knowledge before generating an answer.

Classification project

A system that assigns labels or categories to input data.

Summarization project

A system that converts long content into shorter meaningful output.

Workflow automation

Using software to automatically move tasks through business processes.

Human review

A process where uncertain or risky AI outputs are checked by a person.

Evaluation dataset

A set of test cases used to measure AI quality.

Production upgrade

Enhancements required to make a demo safe, scalable, and maintainable for real users.

 

Practice Exercises

1. Choose one project and write a one-page problem statement for your own organization or learning use case.

2. Draw the architecture diagram for the AI FAQ chatbot in your own words.

3. Create a sample FAQ dataset with at least 20 questions and answers.

4. Design five test cases for a RAG-based document assistant.

5. Create a label taxonomy for an IT ticket classification system with at least six support teams.

6. Write a prompt for extracting action items from a meeting report.

7. Design a learner progress table for an AI learning assistant.

8. Compare which project needs embeddings, which needs only prompting, and which may later need fine-tuning.

9. Prepare a GitHub README outline for one project.

10. Explain how you will add security, logging, and human review to one of the projects.

Mini Capstone Task

Build a small but complete AI FAQ chatbot using any free or low-cost tools. Use a CSV file for the FAQ database, a simple web interface, a backend function, and a prompt template. Add a feedback button and store unresolved questions. After completing it, write a short report explaining architecture, data flow, prompts, test cases, and future improvements. This mini capstone prepares you for the larger RAG and agent projects in later chapters.

End of Chapter 18