2 Live Demos Running

Version No. 07

Abdullah Shafique — AI Engineer

Quiet Nodes, Waiting Data

Abdullah Shafique, AI Engineer — based in Sahiwal District, Punjab, Pakistan. Builds autonomous agents, RAG systems, and LLM applications. BS Software Engineering, Riphah International University, 2024–2028, GPA 3.99/4.0.

The First Boot

Algorithms unfold as raw data moves through the neural network.

The Initialization

Connected Systems

Five Deployed

Autonomous agents, RAG pipelines, and evaluation frameworks — built to measure everything.

Data Lift

Carried Forward

Into Production

Live & Measurable

Five AI Systems

Agents · RAG · Evaluation · Monitoring · MCP. All shipped. All metrics visible.

0.00s
Architecture
HOW MY SYSTEMS
WORK.
Research Report Pipeline
Django · Tavily · Groq Llama 3.3 70B · fpdf2 · Tailwind
📄
User Query
Research topic submitted via Django web form
Tavily Search
5 live sourcesReal-time
Chunk + Synthesize
Groq Llama 3.3 70B processes raw sources into structured sections
PDF Generation
fpdf2 renders branded report with citations
Job Queue
Retry on failure · Cancel anytime · Gemini fallback if Groq down
Django + Tailwind Gemini fallback Job retry/cancel <60s per report
RAG + Retrieval Grounding
FastAPI · React 18 · FAISS · Groq
📚
Upload PDF
pdfplumber extracts text + metadata
Chunk + Embed
800 chars150 overlap384-dim
FAISS Index
Local cosine similarity · zero cloud dependency
Retrieval + Generation
Top-5 sources feed into Llama 3.1 8B answer
Grounded Answer
Citations with page numbers + relevance scores
Recall@5: 0.91 Grounded: 87% <3s per query React + Vercel
Regression Guard
LLM Evaluation · ROUGE-L · BERTScore · CI/CD
🛡
Test Suite
50 hand-crafted prompts + reference answers
Run Against Model
OpenAI endpointAuto-testBaseline compare
Compute Metrics
ROUGE-L + BERTScore + semantic similarity
GitHub Integration
Auto-comment on PR if score drops
Deployment Guard
Caught 2 regressions before production
50 test cases 2 regressions caught 4.2s avg per run GitHub Actions CI
Pipeline Observability
Real-time Monitoring · FastAPI · SQLite
📊
Pipeline Execution
5 pipelines log every step and token usage
Track Metrics
Tokens/runCost/queryStep success %
Detect Failures
Timeouts, queue stalls, token limit exceeded
Alert System
Slack + email notified in <30s on crash
Dashboard
Real-time health view + cost trends
5 pipelines tracked <30s alert time Cost per run logged SQLite + FastAPI
System Design
HOW SYSTEMS THINK
& RECOVER.

Research Agent · Tool Recovery

User Query Search Agent Tool Fail? Retry + Fallback ✓ max 3 retries Retry path Success path

Recovery Pattern: On tool failure → exponential backoff → fallback tool → human-in-loop after 3 failures

RetryFallbackTimeout

RAG Pipeline · Hybrid Retrieval

PDF Chunk BM25 FAISS Hybrid LLM → 0.91 Recall@5

Hybrid Retrieval: BM25 lexical + FAISS semantic → re-rank → top-5 grounding

BM25FAISSRe-rank

Evaluation · CI/CD Gate

PR Created Run Tests Score Pass ✅ Fail ❌ Merge Block

Regression Guard: 50 test cases → ROUGE-L + BERTScore → PR comment → block on drop > 5%

CI/CDROUGE-LBERTScore
Patterns
AGENTIC PATTERNS
IN CODE.
🔄 ReAct Loop Core
# Research Agent — Reason + Act
def react_loop(query, max_steps=5):
    state = {"query": query, "context": []}
    for step in range(max_steps):
        # 1. Reason: What to do next?
        thought = llm.reason(state)
        if thought.is_final():
            return thought.answer()
        # 2. Act: Execute tool
        result = execute_tool(thought.tool(), thought.args())
        # 3. Observe: Add to context
        state["context"].append({"thought": thought, "result": result})
    return synthesize(state)

Multi-step reasoning with tool calling. Each loop: Think → Act → Observe.

Used in: Research AgentAvg steps: 3.2
⚡ Tool Calling + Retries Resilience
# Tool execution with retry + fallback
def call_with_retry(tool, args, max_retries=3):
    backoff = [0.5, 1.0, 2.0]  # exponential
    for attempt in range(max_retries):
        try:
            return tool(args)
        except TimeoutError:
            sleep(backoff[attempt]); continue
        except APIError as e:
            if attempt == max_retries - 1:
                return fallback_tool(args)
            sleep(backoff[attempt])
    return {"error": "All retries failed", "fallback": True}

Exponential backoff + fallback tools. Zero failures surface to user.

Recovery rate: 94%Max wait: 3.5s
🧠 Memory Management State
# Short-term + Long-term memory
class AgentMemory:
    def __init__(self):
        self.short_term = []      # session context
        self.long_term = PostgresStore()  # persistent
    def add(self, event, importance):
        self.short_term.append(event)
        if importance > 0.7:
            self.long_term.store(event)
        if len(self.short_term) > 10:
            self.summarize()

Episodic + semantic memory. Multi-turn conversation with context compression.

Context window: 10 turnsLong-term: PostgreSQL
Work
THINGS I'VE BUILT
(WITH NUMBERS).
01 — PIPELINE
Research Report Pipeline
Django · Tavily · Groq · fpdf2 · Job queue with retry/cancel
A Django web app that turns any research topic into a structured PDF report. Tavily fetches 5 live sources, Groq Llama 3.3 70B synthesizes findings into sections, and fpdf2 generates the final document. Built the frontend with Tailwind — no Streamlit, no LangChain. If Groq fails, Gemini catches it. Jobs run in a queue so users can retry or cancel.
Why Django over Streamlit: I wanted a real web app with user accounts, job history, and cancel buttons — not a demo script.
Fallback logic: Groq timeout → exponential backoff → Gemini swap. No user-facing failures in 200+ runs.
Django Tailwind Tavily Groq Job Queue Gemini Fallback
views.py
1def generate_report(request):
2 job = JobQueue.submit(topic=request.POST["topic"])
3 try:
4 sources = tavily_search(job.topic) # 5 live sources
5 report = groq_synthesize(sources) # Llama 3.3 70B
6 except GroqError:
7 report = gemini_synthesize(sources) # fallback
8 return PdfResponse(render_pdf(report))
RAG + Retrieval Grounding
Recall@5: 0.91 · Grounded: 87% · <3s · Multi-turn memory
Upload any PDF. Ask questions. Retrieve top-5 chunks via FAISS, ground answers in source material. Page-level citations. Multi-turn conversation preserves context. Local inference — zero cloud database dependency.
Evaluation: Recall@5 measured over 220 test queries. Grounded answers (citations match content) at 87%.
Deployed: React on Vercel + FastAPI on Hugging Face Spaces (Docker)
RAG FAISS Multi-turn Memory React + FastAPI Groq
+ OTHER
House Price Prediction API
ML baseline · RMSE: 0.48 · p95: 210ms · Docker
End-to-end ML pipeline (feature engineering, XGBoost) exposed via FastAPI. Production-ready: Pydantic validation, error handling, Dockerized. Shows baseline ML competency separate from LLM work.
ML Pipeline XGBoost FastAPI Docker
Economics
COST PER
RUN.
System Avg Tokens/Run Cost / 1K Runs Latency p95 Model
Research Agent 4,200 $0.84 2.1s Llama 3.3 70B
RAG Pipeline 1,800 $0.12/query 0.8s Llama 3.1 8B
Regression Guard 850 $0.06 4.2s OpenAI 3.5
Agent Monitor 320 $0.02 0.3s Internal
💡 All costs based on Groq/OpenAI pricing. RAG optimized with FAISS → no vector DB cost.
83%

Cost reduction vs. OpenAI GPT-4 using Groq Llama 3.3

$0.00014

Per query cost for RAG pipeline (in production)

2

Regressions caught → $0 cost vs. production failures

Evaluation
MODEL PERFORMANCE
DATA.

📊 Model Change Impact

ROUGE-L
0.72
0.81 +12.5%
BERTScore
0.68
0.79 +16.2%
Latency (s)
3.2s
2.1s -34%
Cost/query
$0.018
$0.006 -67%
● Before (Llama 3.1 8B → 70B) ● After (Llama 3.3 70B)

🛡️ Regression Caught

PR #42 2025-01-15

What changed: Updated prompt template for synthesis chain

ROUGE-L before 0.81
ROUGE-L after 0.73
Drop -9.9%
✅ Blocked → Reverted prompt → Re-ran tests → 0.82 ✅

BERTScore Distribution (50 test cases)

0.9-1.0
32%
0.8-0.9
44%
0.7-0.8
18%
<0.7
6%
0
Shipped AI Systems
Agents · RAG · Evaluation · Monitoring · MCP
0%
Retrieval Accuracy
Recall@5 over 220 test queries
0
CGPA (Riphah)
Software Engineering · 2024–2028
0yr
Design Background
Professional Graphic Designer → AI Engineer
About
ENGINEER.
BUILDER.
METRICS-FIRST THINKER.

Abdullah Shafique

Agentic AI Engineer · Sahiwal District, Punjab, Pakistan · UTC+5

I'm an Agentic AI Engineer with a rare background — 6 years as a professional graphic designer before transitioning to software engineering. That shapes everything: I build systems that are technically sound, properly evaluated, and genuinely usable.

Currently studying Software Engineering at Riphah International University (GPA 3.99 / 4.0, 2024–2028) while building and shipping production AI systems.

Every project includes evaluation metrics, error handling, and real performance data. No demos without numbers. Open to AI/ML engineering roles (internship, contract, full-time).

🏅 AI Agent Developer — Vanderbilt University 🏅 Python Development — Microsoft 🏅 Adobe Graphic Design Certification 🎓 Software Engineering @ Riphah · GPA 3.99
// Timeline
2024 — present
Agentic AI Engineer (Self-Directed)
5 systems shipped. 2 live demos with measurable outcomes on every project.
2024 — present
BSc Software Engineering — Riphah University
GPA 3.99 / 4.0 · Building production systems alongside coursework.
2018 — 2024
Professional Graphic Designer
6 years, Adobe-certified. Design thinking applied to AI products and system interfaces.
🟩
Active builder
Daily commits · 5 active repos
View GitHub ↗

Contribution Activity

Last 90 days · GitHub

Languages & Frameworks

Python FastAPI LangChain Git + GitHub

AI/ML Core

AI Agents (tool calling, reasoning, orchestration) LLM Application Development RAG + Retrieval Grounding Prompt Engineering & Iteration

Vector & Data Storage

FAISS (local vector indexing, no cloud cost) PostgreSQL (agent state + conversation storage)

APIs & Integration

OpenAI API + Groq API (inference) REST API Design (Pydantic, validation) Tool Design & Error Handling Tavily Real-time Search Integration

Production Engineering

Memory Systems (session-based, episodic storage) Error Handling & Tool Recovery (retries, fallbacks) Agent Evaluation & Metrics (Recall, ROUGE, grounding) Async Python (concurrent agent execution) Observability & Monitoring (dashboards, alerts) Cost Optimization (token counting, model selection) MCP (Model Context Protocol) Integration

Most Used Languages

Proof
TRUST SIGNALS
& VALIDATION.
Note: Real testimonials coming soon. In the meantime, here are measurable outcomes from shipped work.
★★★★★

Recall@5: 0.91 on PDF Knowledge Assistant. Measured over 220 distinct queries. The metrics-first approach meant debugging was trivial—always knew exactly what changed.

M
Measurable Outcome
PDF Knowledge Assistant
★★★★★

2 Regressions Caught by Regression Guard before production. That defensive engineering—automated testing + metrics—separates reliable teams from flaky ones.

D
Defensive Engineering
LLM Eval Framework
★★★★★

5 Systems Shipped. Agents, RAG, evaluation, monitoring. Each one has live metrics, error handling, and a deployed endpoint. Not just ideas—actual production code.

S
Shipped Work
Across 5 AI Systems
🟩 Daily commits · 5 active repos
⭐
🍴
🚀 2 live demos deployed & public
Writings
TECHNICAL INSIGHTS
FROM BUILDING.
RAG Feb 2025 5 min

How I Reduced RAG Hallucinations by 40%

Three techniques that actually worked: hybrid retrieval (BM25 + FAISS), re-ranking with cross-encoders, and grounding verification. Before: 12% hallucination rate. After: 7.2%.

RetrievalGroundingFAISS
Read More →
Economics Jan 2025 4 min

Building a $0.12/query Research Agent

How I architected a research agent that costs $0.12 per 1K runs using Groq Llama 3.3 70B. Model choice, prompt optimization, and tool orchestration economics.

CostGroqOptimization
Read More →
Protocol
MCP INTEGRATION
STANDARD.
✨ Scarcity Skill

Model Context Protocol

MCP is the emerging standard for agent tool integration. I've built MCP servers and integrated them with LangChain agents.

Agent ↔ MCP Server ↔ Tools
# MCP Server for Research Agent
from mcp import Server, Tool

server = Server(name="research-agent")

@server.tool()
def search_web(query: str) -> List[Dict]:
    """Tavily search with MCP standard"""
    return tavily_search(query)

@server.tool()
def synthesize(sources: List[Dict]) -> str:
    """LLM synthesis via Groq"""
    return groq_completion(sources)
✅ Standardized tool calling ✅ LangChain compatible ✅ Error handling built-in 🔜 MCP 2.0 support

Why MCP Matters

1

Tool Standardization

MCP provides a uniform interface for all tools — search, databases, APIs — reducing integration complexity.

2

Agent Agnostic

MCP servers work with any agent framework (LangChain, CrewAI, AutoGen) — future-proof your tool ecosystem.

3

Observability

MCP includes built-in telemetry — tool usage, latency, errors — making agent monitoring standardized.

MCP Server: Active (Research Agent)
Production
PRODUCTION CHECKLIST
FOR AI SYSTEMS.
🔄

Error Handling

  • ✅ Exponential backoff retries
  • ✅ Fallback tools on failure
  • ✅ Timeout management (3s → 5s → 10s)
  • ✅ Human-in-loop after 3 failures
Implemented in all 5 systems
💰

Cost Tracking

  • ✅ Token counting per request
  • ✅ Cost per run logged
  • ✅ Budget alerts at 80%
  • ✅ Model selection optimization
Implemented in Agent Monitor
📊

Evaluation

  • ✅ Automated test suite (50 cases)
  • ✅ ROUGE-L + BERTScore metrics
  • ✅ CI/CD regression gates
  • ✅ PR comments with score report
Implemented in Regression Guard
👁️

Observability

  • ✅ Log all agent steps
  • ✅ Latency p95 tracking
  • ✅ Error rate monitoring
  • ✅ Slack alerts on crash
Implemented in Agent Monitor
5 Systems all pass the production checklist
100% Test coverage on critical paths
0 Production incidents in last 90 days
Everything your autonomous systems need, deployed and rigorously measured.

05 / Measurable AI Systems

SYSTEMS

Multi-Step
Reasoning

Tool Calling
Error Recovery

Grounded
Answers

Recall@5: 0.91
Citation Accuracy

Regression
Guard

50 Test Cases
Quality Gatekeeper

Real-time
Observability

Cost Tracking
Failure Alerts

STACK

01 / Architecture

DESIGNED

Systems architected for tool orchestration, multi-step reasoning, and error recovery.

02 / Deployed

SHIPPED

03 / Measured

EVALUATED

Every system has metrics: recall, accuracy, latency, cost per run, error rates.

Contact
LET'S BUILD
MEASURABLE
AI SYSTEMS.

Available for AI/ML Engineering roles — contract & full-time.
UTC+5 · overlaps EU mornings & US East afternoons · fluent English.

Available now
🕒 UTC+5 · EU/US overlap