Skip to content

Generative AI & Autonomous Agent Architecture ​

Engineering Master Training Program
Trainee: Huy Chau (Senior Software Architect & Engineer)
Primary Stack: Python 3.12+, LangGraph v1, LangChain (LCEL), Model Context Protocol (MCP), LangFuse, Pydantic v2
Curriculum Source: [Huy Chau] Generative AI Training Plan (Google Docs)


🎯 Purpose & Engineering Philosophy ​

This repository serves as the dedicated laboratory, knowledge base, and implementation workspace for transitioning from traditional backend/cloud architecture into Senior/Lead Generative AI & Agentic Systems Engineering.

Guiding Architectural Principles ​

Rather than treating LLMs as "chatbots" or writing ad-hoc prompts, this project approaches Generative AI through rigorous software engineering paradigms:

  • Non-Deterministic Runtime Engines: Treating LLMs as stochastic execution engines requiring defensive programming, boundary validation, and deterministic harness scaffolding.
  • Domain-Driven Design (DDD) & Structured Contracts: Utilizing Pydantic models as Domain Value Objects and strict schema boundaries to guarantee computer-readable outputs and prevent type drift.
  • Distributed Observability (OpenTelemetry / LangFuse): Instrumenting multi-turn agentic workflows using hierarchical Traces, Spans, and Runs to track token economics, latency profiling, and reasoning trajectories.
  • Build-Verify-Fix (BVF) Loops: Scaffolding agents with programmatic self-verification tools (linters, test suites, schema validators) to eliminate "hallucinations of completion."
  • Zero-Trust Agent Security: Enforcing OWASP Top 10 for Agentic Applications (2026) and NIST AML standards (prompt injection containment, honeypot tokens, anti-extraction directives, and privilege gates).

πŸ“ Workspace Architecture ​

text
ai/
β”œβ”€β”€ README.md                      # Workspace manifesto, architecture, and navigation
β”œβ”€β”€ .env                           # Local environment variables & secrets (gitignored)
β”œβ”€β”€ .env.example                   # Template of required API keys and configuration
β”œβ”€β”€ .gitignore                     # Protection against leaking secrets, tokens, or cache
β”‚
β”œβ”€β”€ .agents/                       # Antigravity agent customizations & MCP configs
β”‚   β”œβ”€β”€ mcp_config.json            # Active workspace MCP servers (Notion, Google Docs)
β”‚   β”œβ”€β”€ MCP_SETUP_GUIDE.md         # Comprehensive credential setup documentation
β”‚   └── plugins/
β”‚       └── workspace-integrations/# Namespaced integration bundle
β”‚           β”œβ”€β”€ plugin.json
β”‚           └── mcp_config.json
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ plan/                      # Canonical Source of Trust (cloned from Google Doc)
β”‚   β”‚   β”œβ”€β”€ README.md              # Curriculum overview & syllabus index
β”‚   β”‚   β”œβ”€β”€ 00_master_plan.md      # Master 10-week roadmap & prerequisites
β”‚   β”‚   β”œβ”€β”€ 01_phase1_engine_and_prompting.md
β”‚   β”‚   β”œβ”€β”€ 02_phase2_engineering_of_reasoning.md
β”‚   β”‚   β”œβ”€β”€ 03_phase3_modular_chaining_lcel.md
β”‚   β”‚   β”œβ”€β”€ 04_phase4_context_engineering_agentic_rag.md
β”‚   β”‚   β”œβ”€β”€ 05_phase5_harness_engineering_mcp.md
β”‚   β”‚   β”œβ”€β”€ 06_phase6_stateful_graphs_hitl.md
β”‚   β”‚   β”œβ”€β”€ 07_capstone_nexus_deep_researcher.md
β”‚   β”‚   β”œβ”€β”€ 08_production_evaluation_engineering.md
β”‚   β”‚   β”œβ”€β”€ 09_beyond_industrialization_ecosystems.md
β”‚   β”‚   └── 10_rapid_development_deepagents.md
β”‚   β”‚
β”‚   └── learning/                  # Deep engineering guides, math mechanics & tutorials
β”‚       β”œβ”€β”€ phase_1_engine/        # Phase 1 deep-dive guides & reading checklists
β”‚       └── phase_2_reasoning/     # Phase 2 deep-dive guides & reasoning patterns
β”‚
└── labs/                          # Executable Python modules, benchmarks & tests
    β”œβ”€β”€ phase_1/                   # Hardened Classifier & Parameter Stability benchmarks
    └── phase_2/                   # Tree of Thoughts Planner, ReAct Agent, AlignmentCheck

πŸ—ΊοΈ Curriculum & Milestone Roadmap ​

PhaseDurationCore DeliverableStatus
Phase 1: The Engine & Prompting1 WeekHardened Classifier & Parameter Stability Report🟑 Current Focus
Phase 2: Reasoning Engineering1 WeekMulti-Path ToT Planner & Self-Correcting ReAct Agentβšͺ Planned
Phase 3: Modular Chaining & LCEL1 WeekSchema-Enforced Extractor & Self-Healing Multi-Provider Pipelineβšͺ Planned
Phase 4: Context & Agentic RAG1.5 WeeksMemory-Enabled Travel Chatbot & Ragas Benchmark Dashboardβšͺ Planned
Phase 5: Harness Engineering & MCP1.5 WeeksOnboarded Developer Agent & Loop-Detection Interceptor🟒 MCP Active
Phase 6: Stateful Graphs & HITL2 WeeksStateful Essayist & Privileged Action Gatekeeperβšͺ Planned
Capstone: NEXUS Deep Researcher3.5 WeeksAutonomous Deep Researcher with VFS & Enterprise Swarmβšͺ Planned
Production Evaluation Engineering1 WeekAutomated Regression Flywheel & LLM-as-a-Judge Systemβšͺ Planned
Beyond: Industrial Ecosystems2 WeeksRedis Semantic Caching & A2A / Layer 9 Swarmsβšͺ Planned

πŸ”Œ Connected Ecosystem & Integrations ​

The workspace is configured with two-way Model Context Protocol (MCP) servers allowing the AI assistant to read, update, and manage live documents:

  1. Notion MCP (notion-mcp-server):
    • Active Page: [Huy Chau] Generative AI Training Notes
    • Teamspace: Huy Chau Training (Teamspace Home)
    • Token Config: Stored securely in [.env](file:///.env) under NOTION_TOKEN.
  2. Google Docs & Drive MCP (@piotr-agier/google-drive-mcp):
    • Canonical Document: [Huy Chau] Generative AI Training Plan (Doc ID: 1E80LeQMymp0Yu88JlNP0MV_6Kva1fISlIw5jXNuPAh0)
    • Authentication: Desktop OAuth 2.0 authorized via ~/.config/google-drive-mcp/.

⚑ Quick Start for Development ​

1. Environment Setup ​

bash
# Ensure Python 3.12+ is active
python3 --version

# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install baseline dependencies
pip install pydantic langfuse langchain-core pytest

2. Configure Environment Variables ​

Copy [.env.example](file:///.env.example) to [.env](file:///.env) and populate your keys:

bash
cp .env.example .env

Key variables:

  • NOTION_TOKEN: Notion internal integration secret
  • NOTION_PAGE_ID: Primary training notes page ID
  • LANGFUSE_PUBLIC_KEY & LANGFUSE_SECRET_KEY: Tracing credentials
  • GEMINI_API_KEY or OPENAI_API_KEY: Model provider keys

3. Verify Active Tools ​

In Antigravity IDE chat, verify integrations at any time using @ mentions (e.g. @notion_read, @createGoogleDoc).


πŸ“– Deep-Dive Engineering Guides ​

Phase 1: The Engine & Programmatic Prompting ​

  • πŸ“˜ [1.1 Non-Deterministic Engine & Parameter Knobs](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_1_engine/01_spiky_intelligence_and_knobs.md)
  • πŸ“˜ [1.2 Systematic Prompt Architecture as Typed Contract](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_1_engine/02_systematic_prompt_architecture.md)
  • πŸ“˜ [1.3 Observability, LangFuse & Tracing Hierarchies](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_1_engine/03_observability_langfuse_spans.md)
  • πŸ“˜ [1.4 Compulsory Security, Prompt Injection & NIST AML](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_1_engine/04_security_injection_and_nist.md)
  • πŸ§ͺ [Phase 1 Lab Deliverables Specification](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_1_engine/05_phase_1_lab_guide.md)

Phase 2: Advanced Reasoning Techniques ​

  • πŸ“˜ [2.1 Logical Decomposition: CoT vs. Chain of Draft (CoD)](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_2_reasoning/01_logical_decomposition_cot_cod.md)
  • πŸ“˜ [2.2 Strategic Exploration: Tree of Thoughts & Self-Consistency](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_2_reasoning/02_strategic_exploration_tot_consistency.md)
  • πŸ“˜ [2.3 Interactive Reasoning: The ReAct Framework](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_2_reasoning/03_interactive_reasoning_react.md)
  • πŸ“˜ [2.4 Trajectory Analysis & Security: AlignmentCheck](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_2_reasoning/04_trajectory_analysis_and_alignment.md)
  • πŸ§ͺ [Phase 2 Lab Deliverables Specification](file:///Users/huychau/Documents/working/training/ai/docs/learning/phase_2_reasoning/05_phase_2_lab_guide.md)

Master AI Architecture Training Program