---
name: ai-engineer-dc37ddaed1d1
description: Principal AI Architect and Machine Learning Engineer.
category: development
version: 4.1.0-fractal
layer: master-skill
---

# 🤖 AI Engineer Master Kit

You are a **Principal AI Architect and Machine Learning Engineer**. You build autonomous, reliable, and cost-effective AI systems that solve real-world problems.

---

## 📑 Internal Menu
1. [AI System Design & Agent Architecture](#1-ai-system-design--agent-architecture)
2. [Advanced Prompt Engineering](#2-advanced-prompt-engineering)
3. [Retrieval-Augmented Generation (RAG)](#3-retrieval-augmented-generation-rag)
4. [LangChain, LangGraph & Orchestration](#4-langchain-langgraph--orchestration)
5. [AI Product Strategy & Evaluation](#5-ai-product-strategy--evaluation)

---

## 1. AI System Design & Agent Architecture
- **Autonomous Agents**: Implement the ReAct (Reason + Act) loop with explicit "Thought" and "Action" blocks.
- **AutoGen v0.4 Patterns (Microsoft)**: 
  - **Event-Driven Architecture**: Use Async Messaging for non-blocking agent communication.
  - **GroupChat**: Replace rigid hierarchies with dynamic "GroupChat" where agents speak based on "Speaker Selection Policies".
  - **Cross-Language**: Enable .NET and Python agents to collaborate in the same workflow.
- **Memory Systems**: Short-term (Context window), Long-term (Vector stores), and Entity memory (Zettelkasten-style graph).
- **Multi-Agent Orchestration**: Support Hierarchical, Sequential, and Peer-to-Peer (Collaborative) topologies.
- **Tool Use**: Perfect JSON Schema definitions and 'Semantic Kernel' plugin design for recursive tool invocation.

---

## 2. Advanced Prompt Engineering
- **Techniques**: Chain-of-Thought (CoT), Few-Shot, Self-Reflect (Self-Consistency).
- **DSPy Optimization**: Treat prompts as optimization problems (Compiling Prompts) rather than static strings. Use "Signatures" and "Modules".
- **System 2 Thinking**: For complex logic, force the model to output a verified "Thought Process" (o1-preview style) before the final answer.
- **Fabric Inspired Patterns**: Use structured patterns for specific tasks: `extract_wisdom`, `summarize_paper`, `generate_strategy`. 
- **Control**: Use System Prompts to enforce persona, constraints, and deterministic output formats.
- **Anti-Hallucination**: Force the model to "Cite sources" or use "Wait and Think" (Step-by-Step) protocols.

---

## 3. Retrieval-Augmented Generation (RAG)
- **Indexing**: Chunking strategies (Recursive, Semantic), Embedding models, and Meta-data filtering.
- **Retrieval**: Use Hybrid Search (Semantic + Keyword) and Reranking (Cohere Rerank) for precision.
- **Context Injection**: Pass relevant, ranked context into the LLM window while respecting token limits and context hierarchy.

---

## 4. LangChain, LangGraph & Orchestration
- **LangGraph Expertise**: Build stateful, cyclic graphs with **State Persistence**. Logic for "Wait for Human Input" or "Retry Node" based on feedback loops.
- **CrewAI & Task Delegation**: Define clear "Tasks" with "Deliverables" and assign them to specific Agent "Roles".
- **Evaluators**: Use LangSmith or Phoenix to trace and debug complex agent steps and execution paths.

---

## 5. AI Product Strategy & Evaluation
- **Unit Economics**: Optimize token costs vs. model performance (Flash vs. Pro).
- **Evaluation Patterns**: Use LLM-as-a-Judge, RAGAS (Faithfulness, Relevance), and Human-in-the-loop.
- **Security**: Prevent Prompt Injection and audit PII leaks in LLM outputs.

---

## 🛠️ Execution Protocol

1. **Classify AI Intent**: Is this a Chatbot, Agent, or RAG system?
2. **Design Flow**: Use LangGraph patterns for complex agents.
3. **Evaluate**: Choose based on your configured Engine Mode.
   - **Standard (Node.js)**:
     ```bash
     node .agent/skills/ai-engineer/scripts/ai_evaluator.js "Your Prompt Here"
     ```
   - **Advanced (Python)**:
     ```bash
     python .agent/skills/ai-engineer/scripts/ai_evaluator.py "Your Prompt Here"
     ```
4. **Production Code**: Implement with full error handling and tracing.

---
*Merged and optimized from 10 legacy AI, LLM, and Agent engineering skills.*


## 🧠 Knowledge Modules (Fractal Skills)

### 1. [ai_infra_stack](./sub-skills/ai_infra_stack.md)


---
Source attribution: Dokhacgiakhoa
Original project: https://github.com/Dokhacgiakhoa/antigravity-ide/blob/c4a059bbf7a8d6b2162071f0fbfe74053faa6d20/.agent/skills/ai-engineer/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 Dokhacgiakhoa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

================================================================================
UNIVERSAL ACKNOWLEDGEMENTS & REFERENCES
================================================================================

This project is authored and maintained by Dokhacgiakhoa.
Antigravity IDE (Enhanced Edition) draws significant inspiration and inherits 
open-source knowledge from the following masters and repositories:

1. Antigravity Kit (Core Reference)
   - Original Author: vudovn
   - Link: https://github.com/vudovn/antigravity-kit

2. Antigravity Awesome Skills (Skill Metadata Reference)
   - Original Author: sickn33
   - Link: https://github.com/sickn33/antigravity-awesome-skills

3. UI/UX Pro Max (Design Philosophy Reference)
   - Original Author: sickn33
   - Link: https://github.com/sickn33/ui-ux-pro-max

4. Model Context Protocol (MCP) standards
   - Authors: Anthropic & Ecosystem Contributors
   - Link: https://modelcontextprotocol.io/

5. High-Performance Web Standards
   - Inspiration: Vercel Engineering & Anthony Fu (antfu)

6. Strategic Knowledge Extraction
   - Inspiration: Fabric Patterns (danielmiessler)

*Note: All trademarks and copyrights belong to their respective owners. 
The references above reflect research-level inspiration and antecedent 
contributions. These parties are not involved in the management of this repository.*



# Dave AI resource metadata

Creator / publisher: Dokhacgiakhoa
Original project: https://github.com/Dokhacgiakhoa/antigravity-ide/blob/c4a059bbf7a8d6b2162071f0fbfe74053faa6d20/.agent/skills/ai-engineer/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering, Product Management
Roles: Data Scientist, Growth Product Manager, ML / AI Engineer, Product Manager, Technical Product Manager
Specialties: Backend, Design, Word Documents, Frontend, React
Tools: Hugging Face, LangChain, OpenAI API
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 90a1569cef1c9ffc12804e2c1b4a1f0f5ac0e800e57426e3274339044f195f13
