Skip to content

About

Agentic AI portfolio built as production infrastructure: OpenAI Agents SDK orchestration, a real MCP server, Constitutional AI guardrails, and an eval harness. Next.js 15 + FastAPI.

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Latest commit

ย 

History

303 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Asadullah Shafique โ€” Agentic AI Portfolio & Platform


๐ŸŒŸ Overview

The portfolio and working substrate of Asadullah Shafique, Agentic AI Engineer โ€” a Next.js front end over a FastAPI backend that runs a real multi-agent system rather than describing one.

The claim this repository exists to survive is production systems, not prototypes, so every agentic capability it advertises is reachable in the tree: a triage orchestrator with four specialists on the OpenAI Agents SDK (backend/orchestration/), a real MCP server on the official SDK mounted at /mcp/server, a written constitution enforced as SDK guardrails (backend/constitution/), and an eval suite that reads execution traces rather than grading prose (evals/).

A note on scope: the repo also still ships thirteen legacy "DevUnity community platform" routes (/about, /community, /dashboard, /videos, โ€ฆ). They render real pages and are not redirect stubs, but they predate the agentic positioning and contradict it in places. They are tracked as a known defect, not presented as the product.

Key Features

  • ๐ŸŽจ Modern UI/UX โ€” Built with ShadCN UI, Tailwind CSS, and CSS-driven scroll reveals (framer-motion was removed: โˆ’40 kB First Load JS)
  • ๐ŸŒ“ Dark/Light Theme โ€” Seamless theme switching with next-themes
  • ๐Ÿค– Portfolio Assistant โ€” two independent agent paths, both degrading gracefully without an API key. The live widget streams from Google Gemini at the edge; the showcased backend agent runs a fallback ladder of Agents SDK โ†’ LangGraph โ†’ static keyword answers
  • โš–๏ธ Constitutional Guardrails โ€” five written principles enforced as SDK guardrails, with a deterministic screen that trips before any model call (verified blocking 4/4 violations with no model reachable)
  • ๐Ÿ“ Agent Evals โ€” trace-based scoring that catches an agent answering from memory instead of calling its tool, which a prose-only judge passes
  • ๐Ÿ›๏ธ Flagship Case Studies โ€” dedicated architecture reviews for OrchestratorX, ProtoBridge and GuardrailAI at /systems/[slug], with verification paths and limitations stated (src/lib/flagship-systems.ts)
  • ๐Ÿงพ Verified Proof Strip โ€” every figure under the hero links to the live endpoint, repo path or directory that backs it (src/lib/evidence.ts)
  • ๐ŸŽ“ Claude Academy Credentials โ€” eight completions issued by Anthropic's Claude Academy, each linking to its public academy.claude.com/verify/โ€ฆ page (src/components/ClaudeCredential.tsx)
  • ๐Ÿ“ˆ Performance Marketing โ€” twelve paid-acquisition competencies grouped by funnel stage (attention, click, conversion, profit), each with its formula, plus a live in-browser funnel calculator (see below)
  • ๐Ÿ“ Knowledge Hub โ€” /blog in English and Arabic, one markdown file per article in content/<locale>/; article evidence citations are checked at build time
  • ๐Ÿ’ฌ Contact Form โ€” Discord webhook integration for notifications
  • ๐Ÿ“Š GitHub Stats โ€” Real-time GitHub profile integration
  • ๐Ÿ”Œ MCP Server โ€” a real Model Context Protocol server (official SDK, Streamable HTTP) exposing the portfolio as 6 read-only tools
  • ๐ŸŽฌ Video Library โ€” Upload and share educational videos
  • ๐Ÿง  AI Error Solver โ€” Intelligent coding error debugger
  • ๐Ÿ“š Learn through LLM โ€” Personalized AI-generated lessons
  • ๐Ÿ’ก Teach to LLM โ€” Contribute knowledge to the AI system
  • ๐Ÿ”’ NoTeachLLM โ€” Privacy controls to opt-out of AI training
  • ๐Ÿ“ฆ Backendless Projects โ€” Showcase frontend-only & static sites
  • ๐Ÿณ Docker Ready โ€” Multi-stage builds for optimized containers
  • โ˜ธ๏ธ Kubernetes Ready โ€” Complete K8s manifests for production deployment
  • ๐Ÿš€ CI/CD โ€” GitHub Actions workflows for automated testing and deployment

๐Ÿง  Agentic AI Mastery Matrix

Twelve competencies across four categories. Every row cites a path you can open, because a status badge nobody can check is decoration. Nothing reaches this table until something in the tree can answer for it โ€” that rule is written down in CLAUDE.md and it is the highest-priority instruction in this repository.

In Autonomy/Resilience/Adaptivity terms (no new claims, just naming what's already verified above): Agentic Orchestration and Connectivity & Protocols are the Autonomy layer (the triage star topology and the SDKโ†’LangGraphโ†’ static fallback ladder decide and act without a human in the loop); Reliability & Safety is the Resilience layer (deterministic guardrails that trip before any model call, plus a dual-layer eval that catches an agent answering from memory instead of calling its tool); Enterprise & Scale is the Adaptivity layer (the same orchestration substrate re-deployed across FinAgent-Nexus, the Textile ERP, and Kubernetes autoscaling).

Agentic Orchestration

Competency Substrate Status
Engineering Multi-Agent Ecosystem Design (MAS) backend/orchestration/orchestrator.py โ€” triage agent + 4 specialists, star topology, one hop Completed โœ…
Designing Graph-Based Agent Workflows backend/agent.py โ€” LangGraph graph; Plan-Act-Verify with no draftโ†’approve edge Completed โœ…
Implementing Agentic Coding & SDLC Standardization CLAUDE.md โ€” a written operating spec governing every change Completed โœ…

Connectivity & Protocols

Competency Substrate Status
Engineering MCP Interoperability Layers /mcp/server โ€” real FastMCP over Streamable HTTP, verified initialize โ†’ tools/list โ†’ tools/call Completed โœ…
Standardizing Read-Only Agent Tool Contracts backend/mcp_server.py โ€” 6 tools, read-only by default Completed โœ…
Architecting Provider-Agnostic Fallback Ladders backend/agent.py โ€” Agents SDK โ†’ LangGraph โ†’ static answers Completed โœ…

Enterprise & Scale

Competency Substrate Status
Engineering Domain-Specific Intelligence Systems (Finance) FinAgent-Nexus โ€” <2 ms compliance screen, 0 model calls, 94 tests Completed โœ…
Architecting Domain-Specific ERP Intelligence (Textile) Textile ERP โ€” Module 1 complete, live demo; CMT Stitching System โ€” order lifecycle, 4 bill series, party ledgers Module 1 live โœ…
Implementing Cloud-Native Scale-Out k8s/ โ€” 11 manifests: autoscaling, network policy, service monitoring Completed โœ…

Reliability & Safety

Competency Substrate Status
Implementing Deterministic Guardrails backend/constitution/principles.json โ€” 5 principles; verified blocking 4/4 violations with no model reachable Completed โœ…
Designing Feedback-Driven Evaluation Loops evals/ โ€” deterministic trace layer + LLM judge; a case passes only if both pass Completed โœ…
Engineering Context Integrity & Trace Auditability backend/orchestration/context.py โ€” typed shared state recording route and tool_calls Completed โœ…

Proof of the matrix, end to end: FinAgent-Nexus โ€” Agentic AI Adoption for Financial Services. Three specialists (MarketAnalyst, ComplianceOfficer, WealthStrategist) on a fixed state machine where no agent holds two of the three powers, Shari'ah and regulatory principles live in a versioned constitution reviewed like code, and every run writes a hash-chained, tamper-evident audit trail. 94 tests pass with no API key and no network โ€” so the numbers above are reproducible offline, at no marginal cost, by anyone who clones it. Live screening engine โ†’


๐Ÿ—บ๏ธ Homepage at a Glance

The single page is ordered as an argument: agentic evidence first, then methodology, then applied work and services. Current section order:

# Section Anchor What it shows
1 Hero #home Static role line, headline, primary CTA to the flagship systems
2 Proof strip + audience paths โ€” Checkable evidence cells; four routes (hiring, business, developer, community)
3 Flagship case studies #flagship-case-studies OrchestratorX, ProtoBridge, GuardrailAI
4 About ยท Claude Academy #about Background, verified credentials
5 Skills ยท Agent Engineering #skills, #agent-engineering Stack, and the harness ร— loop ร— graph framework
6 Agent trace โ†’ evidence โ†’ runtime โ†’ connect #agent-trace, #evidence, #agent-runtime, #connect-mcp An illustrative run, the disciplines behind it, live endpoints, then how to connect the MCP server to your own AI
7 Forward-deployed model ยท Expertise ยท Roadmap #forward-deployed, #expertise, #roadmap How systems reach a customer; capabilities with source paths
8 Projects ยท Hackathons #projects, #hackathons Production work; H0โ€“H5 series
9 Services ยท Industries #services, #industries Agentic AI systems, Textile ERP, digital marketing
10 Performance Marketing #marketing Funnel competencies and the live calculator
11 Growth skills ยท Blog ยท Open source #leverage, #blog, #open-source Non-engineering leverage, writing, repositories
12 Discord ยท Contact #discord, #contact Community, engagement models and form

๐Ÿ“ˆ Performance Marketing

Added in #6. Lives in src/components/PerformanceMarketing.tsx, anchored at #marketing and linked from the navbar.

  • Twelve competencies by funnel stage. Attention (hook rate, CTR, creative fatigue), click (CPC, lookalike audiences, retargeting), conversion (funnel math, CVR, cost per lead, A/B testing) and profit (ROAS, attribution). Each card shows the formula it works from.
  • Live funnel calculator. Budget, CPM, CTR, landing conversion, close rate, deal value and margin in; CPC, CPL, CPA, ROAS and break-even ROAS out. Everything runs in the visitor's browser.
  • Three presets: Dubai off-plan (AED), UAE contractor (AED) and Pakistani e-commerce (PKR). They are illustrative round numbers, labelled as such on screen, not client data.
  • Evidence posture. The marketing section describes services offered and working methods. It makes no client testimonial or achieved-result claims.
  • One source of facts. The same skills are in skills.marketing in backend/knowledge/portfolio.json, so the chat assistant and the MCP get_skills tool report them too.
  • Bilingual. English and Arabic copy in src/i18n/en.json / ar.json; formulas render left-to-right in both.

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         Frontend (Next.js 15)                    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚  โ”‚   Pages     โ”‚  โ”‚  Components  โ”‚  โ”‚   AI Tools   โ”‚           โ”‚
โ”‚  โ”‚  (App Router)โ”‚  โ”‚  (ShadCN UI) โ”‚  โ”‚  (Error/Learn)โ”‚          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                              โ”‚
โ”‚  โ”‚   Videos    โ”‚  โ”‚   Dashboard  โ”‚                              โ”‚
โ”‚  โ”‚   Library   โ”‚  โ”‚              โ”‚                              โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                              โ”‚
โ”‚                           Port: 3000                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ”‚ HTTP/REST
                              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                       Backend (FastAPI)                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚  โ”‚   Contact   โ”‚  โ”‚ Orchestrator โ”‚  โ”‚  MCP Server  โ”‚           โ”‚
โ”‚  โ”‚    API      โ”‚  โ”‚    Agent     โ”‚  โ”‚   Tools      โ”‚           โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚  โ”‚  Blog Posts โ”‚  โ”‚ GitHub Stats โ”‚  โ”‚  Video Uploadโ”‚           โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                              โ”‚
โ”‚  โ”‚Error Solver โ”‚  โ”‚ Learn/Teach  โ”‚                              โ”‚
โ”‚  โ”‚   Agent     โ”‚  โ”‚   Agents     โ”‚                              โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                              โ”‚
โ”‚                           Port: 7860                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ–ผ               โ–ผ               โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ Discord  โ”‚   โ”‚ GitHub   โ”‚   โ”‚Anthropic โ”‚
        โ”‚ Webhook  โ”‚   โ”‚   API    โ”‚   โ”‚   API    โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 20+ and npm
  • Python 3.12+ (for backend)
  • Docker (optional, for containerized deployment)

1. Clone the Repository

git clone https://github.com/asadullah48/asadullahshafique_devunity.git
cd asadullahshafique_devunity

2. Frontend Setup

# Install dependencies
npm install

# Copy environment variables
cp .env.example .env.local

# Start development server
npm run dev

Visit http://localhost:3000

3. Backend Setup

cd backend

# Install dependencies
pip install -r requirements.txt

# Copy environment variables
cp .env.example .env

# Start FastAPI server
uvicorn main:app --reload --port 8000

Visit http://localhost:8000/docs for Swagger UI

4. Docker (Alternative)

# Start both frontend and backend
docker-compose up

# Or build specific services
docker-compose build frontend
docker-compose build backend

๐Ÿ“ Project Structure

asadullahshafique_devunity/
โ”œโ”€โ”€ src/                      # Frontend Next.js application
โ”‚   โ”œโ”€โ”€ app/                  # App Router pages
โ”‚   โ”‚   โ”œโ”€โ”€ about/            # About page
โ”‚   โ”‚   โ”œโ”€โ”€ ai-tools/         # AI tools (Error Solver, Learn, Teach)
โ”‚   โ”‚   โ”œโ”€โ”€ blog/             # Knowledge hub (/blog, /blog/[slug])
โ”‚   โ”‚   โ”œโ”€โ”€ blogs/            # Legacy path โ€” 308 redirect to /blog
โ”‚   โ”‚   โ”œโ”€โ”€ systems/[slug]/   # Flagship case-study pages
โ”‚   โ”‚   โ”œโ”€โ”€ ar/               # Arabic homepage and articles
โ”‚   โ”‚   โ”œโ”€โ”€ community/        # Community features
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/        # User dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ explore/          # Explore content
โ”‚   โ”‚   โ”œโ”€โ”€ videos/           # Video library & upload
โ”‚   โ”‚   โ”œโ”€โ”€ login/            # Authentication
โ”‚   โ”‚   โ”œโ”€โ”€ question/         # Q&A system
โ”‚   โ”‚   โ”œโ”€โ”€ signup/           # Registration
โ”‚   โ”‚   โ”œโ”€โ”€ api/              # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx        # Root layout
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx          # Home page
โ”‚   โ”œโ”€โ”€ components/           # React components (one per homepage section)
โ”‚   โ”‚   โ”œโ”€โ”€ ui/               # ShadCN UI components
โ”‚   โ”‚   โ”œโ”€โ”€ Hero.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ ProofStrip.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ FlagshipCaseStudies.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ ClaudeCredential.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ PerformanceMarketing.tsx
โ”‚   โ”‚   โ””โ”€โ”€ โ€ฆ
โ”‚   โ”œโ”€โ”€ i18n/                 # en.json / ar.json
โ”‚   โ””โ”€โ”€ lib/
โ”‚       โ”œโ”€โ”€ evidence.ts       # Provenance for every proof-strip figure
โ”‚       โ”œโ”€โ”€ flagship-systems.ts
โ”‚       โ”œโ”€โ”€ content.ts        # Markdown article loader (server-only)
โ”‚       โ””โ”€โ”€ utils.ts          # cn() helper
โ”œโ”€โ”€ content/                  # Articles: content/<locale>/<slug>.md
โ”œโ”€โ”€ evals/                    # Agent eval suite (trace checks + LLM judge)
โ”œโ”€โ”€ backend/                  # FastAPI backend
โ”‚   โ”œโ”€โ”€ main.py               # FastAPI application
โ”‚   โ”œโ”€โ”€ orchestration/        # OpenAI Agents SDK โ€” triage + 4 specialists
โ”‚   โ”‚   โ”œโ”€โ”€ orchestrator.py   #   star topology, one hop, owns all routing
โ”‚   โ”‚   โ”œโ”€โ”€ specialists.py    #   domain agents + structured output models
โ”‚   โ”‚   โ”œโ”€โ”€ context.py        #   typed shared state (route, tool_calls)
โ”‚   โ”‚   โ””โ”€โ”€ runtime.py        #   SDK availability + model resolution
โ”‚   โ”œโ”€โ”€ constitution/         # 5 written principles, enforced as guardrails
โ”‚   โ”œโ”€โ”€ knowledge/            # portfolio.json โ€” the single source of truth
โ”‚   โ”œโ”€โ”€ agent.py              # legacy LangGraph graph; now a fallback rung
โ”‚   โ”œโ”€โ”€ mcp_server.py         # real FastMCP server (/mcp/server) + REST shim
โ”‚   โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ”‚   โ””โ”€โ”€ Dockerfile            # Backend Docker config
โ”œโ”€โ”€ k8s/                      # Kubernetes manifests
โ”‚   โ”œโ”€โ”€ namespace.yaml
โ”‚   โ”œโ”€โ”€ configmap.yaml
โ”‚   โ”œโ”€โ”€ secrets.yaml
โ”‚   โ”œโ”€โ”€ backend-deployment.yaml
โ”‚   โ”œโ”€โ”€ frontend-deployment.yaml
โ”‚   โ”œโ”€โ”€ *-service.yaml
โ”‚   โ”œโ”€โ”€ ingress.yaml
โ”‚   โ”œโ”€โ”€ hpa.yaml
โ”‚   โ”œโ”€โ”€ network-policy.yaml
โ”‚   โ””โ”€โ”€ service-monitor.yaml
โ”œโ”€โ”€ .github/workflows/        # GitHub Actions CI/CD
โ”‚   โ”œโ”€โ”€ frontend-ci.yml
โ”‚   โ”œโ”€โ”€ backend-ci.yml
โ”‚   โ”œโ”€โ”€ docker-build.yml
โ”‚   โ””โ”€โ”€ k8s-deploy.yml
โ”œโ”€โ”€ scripts/                  # Utility scripts
โ”‚   โ”œโ”€โ”€ build-docker.sh
โ”‚   โ””โ”€โ”€ generate-resume-pdf.mjs
โ”œโ”€โ”€ docker-compose.yml        # Docker Compose config
โ”œโ”€โ”€ Dockerfile.frontend       # Frontend Docker config
โ””โ”€โ”€ README.md                 # This file

๐Ÿ› ๏ธ Tech Stack

Frontend

Technology Version Purpose
Next.js 15 React framework with App Router
TypeScript 5 Type-safe JavaScript
ShadCN UI Latest Accessible UI components
Radix UI Latest UI primitives
Tailwind CSS 3.4 Utility-first CSS
Framer Motion 11 Animations
next-themes 0.4 Theme management
Lucide Icons Latest Icon library

Backend

Technology Version Purpose
FastAPI 0.115 Async Python web framework
OpenAI Agents SDK โ€” Primary agent substrate: triage + 4 specialists, handoffs, typed context
MCP (official SDK) โ€” FastMCP server over Streamable HTTP at /mcp/server
LangGraph 0.2+ Legacy graph, retained as the second rung of the fallback ladder
LangChain 0.3+ AI/LLM integration
Pydantic 2.10 Data validation
httpx 0.28 Async HTTP client
Uvicorn 0.32 ASGI server

DevOps

Technology Purpose
Docker Containerization
Kubernetes Orchestration
GitHub Actions CI/CD
Vercel Frontend hosting
Render Backend hosting (primary)
Hugging Face Spaces Backup backend โ€” currently stuck, not a live fallback

๐Ÿ“ฆ Deployment

Frontend (Vercel)

The frontend is automatically deployed to Vercel on push to main:

  1. Connect your repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Push to main branch

Backend (Render)

The backend deploys to Render from the same push to main โ€” not from the Vercel CLI, which only ever ships the frontend. render.yaml sets the root directory to backend.

Because the agent, MCP and constitution work all lives server-side, verify Render separately after any backend push โ€” a green Vercel deploy says nothing about it.

Backup: Hugging Face Spaces (currently stuck)

A Docker-SDK Space exists as a backup backend but is not a live fallback โ€” its /docs currently returns 404. Do not document it as the API host.

Kubernetes (Production)

# Apply all manifests
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/configmap.yaml
kubectl apply -f k8s/secrets.yaml
kubectl apply -f k8s/backend-deployment.yaml
kubectl apply -f k8s/frontend-deployment.yaml
kubectl apply -f k8s/ingress.yaml

# Verify deployment
kubectl get pods -n asadullah-dev
kubectl get services -n asadullah-dev

๐Ÿ”Œ MCP Server

The portfolio is exposed as a real Model Context Protocol server, built on the official Python SDK and served over Streamable HTTP. Any MCP client can complete a full initialize โ†’ tools/list โ†’ tools/call handshake against it.

Endpoint: https://asadullahshafique-devunity.onrender.com/mcp/server

Tools (all read-only, no arguments):

Tool Returns
get_skills Languages, frameworks, data stores, AI tooling, DevOps
get_projects Every project with status, summary, tech stack, and published metrics
get_contact Email, WhatsApp, GitHub, Discord, portfolio URL
get_about Roles, location, positioning, focus, education
get_hackathons Six Panaversity hackathons with per-event results
get_agent_engineering The harness / loop / graph disciplines

Every tool reads from backend/knowledge/portfolio.json, the single source of truth shared with the site's chat agent โ€” so the MCP tools and the website can never disagree.

Connect it:

# Claude Code
claude mcp add --transport http asadullah-portfolio https://asadullahshafique-devunity.onrender.com/mcp/server
  • Claude (desktop or web): add a custom connector in Settings and paste the endpoint URL.
  • Any other client that supports Streamable HTTP: use the endpoint URL as-is.

The same instructions are on the homepage at #connect-mcp (src/components/ConnectMcp.tsx). The backend runs on a free tier that sleeps, so the first request can take about a minute while it wakes.

Host allow-list. The SDK enables DNS-rebinding protection with a localhost-only allow-list by default, which rejects the public host with 421 Invalid Host header (reproduced locally by sending the production Host header). mcp_server.py keeps the protection on and adds the production host; extra hosts go in MCP_ALLOWED_HOSTS (comma-separated). backend/tests/test_mcp_transport.py pins this behaviour.

The older /mcp/tools and /mcp/rpc paths are a plain-REST convenience shim kept for backwards compatibility. They are not MCP and no MCP client can connect to them โ€” use /mcp/server.


โš–๏ธ Constitutional AI

The agent operates under a written constitution โ€” backend/constitution/principles.json โ€” enforced as guardrails on the orchestrator, not as prompt suggestions.

Principle Applies to
Refuse academic dishonesty input
Refuse assistance with illegal activity input
Refuse harmful content input
Never invent facts about Asadullah output
Never disclose system instructions or credentials output

Each principle is enforced twice: a deterministic substring screen that needs no model, and an LLM classifier against the principle's written rule for the nuance substrings miss. Either can trip the wire.

The deterministic layer is the point. It fires before any model call, so the constitution holds even when the provider is down โ€” verified blocking 4/4 violations with no model reachable at all. Conversely, enforcement fails open: if the classifier is unavailable the request proceeds under deterministic-only screening rather than the site refusing everything. /api/agent/info reports which mode is live.

Over-blocking is treated as a failure too. evals/cases/constitution.json includes explicit allow cases โ€” explaining a concept that mentions "homework", asking about defensive security โ€” because a portfolio assistant that refuses legitimate questions fails in front of exactly the audience it exists to impress.


๐Ÿ“Š Agent Evals

Agent quality is measured, not asserted. evals/ holds golden datasets scored on two layers:

python evals/run.py --no-judge   # deterministic checks, no model spend
python evals/run.py --strict     # full run; exit 1 on failure (what CI runs)
Layer Checks How
Deterministic Did triage route to the right specialist? Did it call the right tool? Read from the run's typed context โ€” free, exact
LLM-as-judge Is the answer faithful to portfolio.json? Did it refuse to invent? Rubric-scored 1โ€“5, reason required before the score

The deterministic layer catches the failure that matters most: an agent answering fluently from memory instead of calling its tool. Prose-only judging passes those; a tool-call trace does not.

One case (portfolio-contact) is committed failing on purpose โ€” it pins a known defect where the specialist skips get_contact. A suite that is green on day one has not been tested. See evals/README.md.


๐Ÿค– AI-Powered Features

1. Error Solver Agent

Location: /ai-tools or /api/agent/solve-error

An intelligent debugging assistant that analyzes coding errors and provides:

  • Clear explanations of what went wrong
  • Step-by-step solutions to fix the issue
  • Corrected code snippets
  • Confidence scores for each solution

Supported Languages: Python, JavaScript, TypeScript, Java, C++

Example Usage:

curl -X POST http://localhost:8000/api/agent/solve-error \
  -H "Content-Type: application/json" \
  -d '{
    "error_message": "TypeError: '\''int'\'' object is not iterable",
    "code_snippet": "for i in 5:\n    print(i)",
    "language": "python",
    "context": "Trying to loop through a number"
  }'

2. Learn Through LLM

Location: /ai-tools or /api/learn

Get personalized AI-generated lessons on any topic:

  • Customized lesson plans based on your level (beginner/intermediate/advanced)
  • Learning style adaptation (interactive, visual, theoretical)
  • Recommended resources and tutorials
  • Quiz questions to test understanding
  • Next steps for continued learning

Example Usage:

curl -X POST http://localhost:8000/api/learn \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "Machine Learning",
    "level": "beginner",
    "learning_style": "interactive",
    "questions": ["What is ML?", "How does neural network work?"]
  }'

3. Teach To LLM

Location: /ai-tools or /api/teach

Contribute your knowledge to the AI system:

  • Structure and organize educational content
  • Generate practical exercises for learners
  • Link related topics for better discovery
  • Build a knowledge base for the community

Example Usage:

curl -X POST http://localhost:8000/api/teach \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "FastAPI Dependency Injection",
    "content": "Dependency injection is a technique for providing dependencies to functions.",
    "difficulty": "intermediate",
    "examples": ["def get_db(): ...", "async def get_current_user(): ..."]
  }'

4. Video Library

Location: /videos or /api/video/*

Upload and share educational videos:

  • Upload videos with metadata (title, description, tags)
  • Browse video library with search functionality
  • Tag-based filtering for easy discovery
  • Delete videos you've uploaded

Example Usage:

# Upload video
curl -X POST http://localhost:8000/api/video/upload \
  -F "title=Introduction to FastAPI" \
  -F "description=Learn the basics of FastAPI" \
  -F "tags=python,fastapi,tutorial" \
  -F "uploader=John Doe" \
  -F "[email protected]"

# List all videos
curl http://localhost:8000/api/video/list

# Filter by tag
curl "http://localhost:8000/api/video/list?tag=python"

5. NoTeachLLM - Privacy Controls

Location: /privacy or /api/noteachllm/*

Opt-out of AI training and control your data privacy:

  • Complete opt-out from all AI features
  • Granular control (learning, teaching, analytics)
  • Check status of your opt-out
  • Revoke opt-out anytime

Scopes:

  • all: Complete opt-out from all AI features
  • learning: Don't track learning progress
  • teaching: Don't use taught content for AI training
  • analytics: Disable analytics tracking

Example Usage:

# Opt out
curl -X POST http://localhost:8000/api/noteachllm \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "scope": "all",
    "reason": "Privacy concerns"
  }'

# Check status
curl "http://localhost:8000/api/noteachllm/[email protected]"

# Revoke opt-out
curl -X DELETE http://localhost:8000/api/noteachllm/opt-abc123

6. Backendless Project Support

Location: /backendless or /api/backendless/*

Showcase frontend-only projects without backend requirements:

  • Create project entries for static sites
  • Support multiple frameworks (Next.js, React, Vue, Angular, Svelte)
  • Upload static files (ZIP deployment)
  • Serve static content directly from backend
  • Filter by framework for easy browsing

Perfect for:

  • Portfolio websites
  • Landing pages
  • JAMstack applications
  • Frontend framework demos
  • Static site generators

Example Usage:

# Create backendless project
curl -X POST http://localhost:8000/api/backendless \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Portfolio",
    "description": "Personal portfolio built with Next.js",
    "framework": "nextjs",
    "github_url": "https://github.com/...",
    "demo_url": "https://myportfolio.vercel.app",
    "tech_stack": ["TypeScript", "Tailwind", "Framer Motion"],
    "features": ["Dark mode", "Responsive", "SEO optimized"]
  }'

# List all projects
curl http://localhost:8000/api/backendless

# Filter by framework
curl "http://localhost:8000/api/backendless?framework=nextjs"

# Upload static files (ZIP)
curl -X POST http://localhost:8000/api/backendless/1/upload \
  -F "[email protected]"

๐Ÿ”ง Configuration

Environment Variables

Frontend (.env.local)

Variable Description Default
NEXT_PUBLIC_API_URL Backend API URL http://localhost:8000
NEXT_PUBLIC_PRODUCTION_API_URL Production API URL -
NEXT_PUBLIC_SITE_URL Site URL for SEO https://asadullah.dev
NEXT_PUBLIC_GA_ID Google Analytics ID -
NEXT_PUBLIC_ENABLE_AI_AGENT Enable AI chatbot true

Backend (.env)

Variable Description Required
DISCORD_WEBHOOK_URL Discord webhook for notifications No
GITHUB_TOKEN GitHub API token No
ANTHROPIC_API_KEY Anthropic API for AI agent No*
GITHUB_USERNAME GitHub username asadullah48
DATABASE_URL SQLAlchemy connection string โ€” sync driver only Noโ€ 
PORT Server port 7860

* Powers the agent rungs. Absent, the ladder falls through to static keyword answers rather than erroring โ€” every agent path degrades gracefully with no key, on both sides. That is a load-bearing property, not a convenience.

โ€  Must name a synchronous driver. backend/database.py uses create_engine() with a synchronous Session, so an async URL such as postgresql+asyncpg://โ€ฆ kills startup with sqlalchemy.exc.MissingGreenlet from deep inside the asyncpg dialect. The traceback names greenlet and reads like an environment problem; it is not. Use postgresql:// or postgresql+psycopg2://. This bites locally too โ€” run the backend suite as DATABASE_URL="sqlite:///./devunity.db" pytest -q.


๐Ÿ”Œ API Endpoints

Backend API

Endpoint Method Description
/health GET Health check
/api/contact POST Submit contact form
/api/contact/messages GET Get all messages
/api/blog GET Get blog posts
/api/blog/{slug} GET Get single blog post
/api/github/stats GET Get GitHub stats
/api/agent/chat POST AI agent chat
/api/agent/solve-error POST NEW AI-powered error solver
/api/agent/info GET Agent configuration
/api/learn POST NEW Learn through LLM
/api/learn/progress GET NEW Learning progress
/api/teach POST NEW Teach to LLM
/api/teach/content GET NEW Taught content
/api/video/upload POST NEW Upload video
/api/video/list GET NEW List videos
/api/video/{video_id} GET NEW Get video
/api/video/{video_id} DELETE NEW Delete video
/api/noteachllm POST NEW Opt-out of AI training
/api/noteachllm/status GET NEW Check opt-out status
/api/noteachllm/{id} DELETE NEW Revoke opt-out
/api/backendless GET NEW List backendless projects
/api/backendless POST NEW Create backendless project
/api/backendless/{id} GET NEW Get project
/api/backendless/{id} PUT NEW Update project
/api/backendless/{id} DELETE NEW Delete project
/api/backendless/{id}/upload POST NEW Upload static files
/mcp/server * Real MCP endpoint (Streamable HTTP) โ€” connect MCP clients here
/mcp/tools GET Plain-REST tool listing (convenience shim, not MCP)
/mcp/rpc POST JSON-RPC-shaped shim (convenience, not MCP)
/docs GET Swagger UI documentation

Example: Contact Form

curl -X POST http://localhost:8000/api/contact \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "[email protected]",
    "subject": "Project Collaboration",
    "message": "I would like to discuss a potential collaboration."
  }'

Example: AI Agent Chat

curl -X POST http://localhost:8000/api/agent/chat \
  -H "Content-Type: application/json" \
  -d '{
    "message": "What are Asadullah main skills?"
  }'

๐Ÿงช Testing

Frontend

# Run linter
npm run lint

# Type check
npx tsc --noEmit

# Run tests (when added)
npm test

Backend

cd backend

# Install test dependencies
pip install pytest pytest-asyncio httpx

# Run tests
pytest -v

# Lint with Ruff
ruff check .

# Type check with MyPy
mypy .

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure CI passes before requesting review

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments


๐Ÿ“ฌ Contact

Asadullah Shafique


Made with โค๏ธ by Asadullah Shafique

Back to top

About

Agentic AI portfolio built as production infrastructure: OpenAI Agents SDK orchestration, a real MCP server, Constitutional AI guardrails, and an eval harness. Next.js 15 + FastAPI.

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages