🏗️ Contextual Architecture
While prompt engineering focuses on how you instruct AI, context engineering focuses on what information you provide. They complement each other: a good prompt without adequate context is limited.
🏛️ The 4 Pillars of Context Engineering
- •Memory Management: Retain information over time for continuity
- •Data Integration: Connect AI to multiple sources of information
- •Tool Orchestration: Allow AI to use external tools
- •Relevance Filtering: Determine which information is relevant
💡 Practical Tip
Think of context engineering as setting up your AI’s “office”: you organize documents, tools, and references so it can work efficiently without needing you to provide everything in every interaction.
🔍 RAG - Retrieval-Augmented Generation
RAG is an architecture that combines search for information with AI text generation. First, the system searches a knowledge base for relevant documents, then uses that information as context to generate accurate responses.
🔄 How RAG Works
- 1.User asks the system a question
- 2.The system searches the knowledge base for relevant documents
- 3.Found documents are added as context to the prompt
- 4.AI generates responses based on actual documents, reducing hallucinations
📊 Why RAG Matters
- Up-to-date knowledge: AI accesses recent data, not just training data
- Hallucination reduction: Well-implemented RAG reduces hallucinations by 40-96% (2025-2026 data)
- Proprietary data: AI securely uses your company’s specific knowledge
- Verifiable sources: Each answer can cite the original source
- Multimodal RAG: In 2026, RAG already combines text, images, and structured data, and is used in finance, healthcare, and legal services
📐 Vector Embeddings and Semantic Search
Embeddings are numerical representations (vectors) that capture the semantic meaning of texts. They let computers “understand” that “dog” and “canine” are similar, making it possible to search by meaning instead of exact words.
🧮 Main Concept
Imagine that each sentence or document can be represented as a point in a multidimensional space. Sentences with similar meanings are close together in this space, making it possible to find relevant content even when the same words aren’t used.
- •Embedding models: OpenAI Ada, Cohere, Sentence-BERT
- •Vector databases: Pinecone, Weaviate, Chroma, FAISS
- •Similarity: Cosine similarity, Euclidean distance
🕸️ Knowledge Graphs
Knowledge graphs represent information as a network of entities connected by relationships. Similar to how the human brain organizes knowledge, allowing AI to understand complex connections between concepts.
🌐 Graph Examples
- •Google Knowledge Graph: Powers Google’s direct answers
- •Wikidata: Open knowledge base with millions of entities
- •Enterprise KGs: Internal company graphs with proprietary data
✓ When to Use Graphs
- ✓Data with many relationships
- ✓Questions that connect multiple entities
- ✓Discovering hidden patterns
✗ When to Avoid
- ✗Simple data without relationships
- ✗Purely text-based searches
- ✗Projects with very short deadlines
⚡ Function Calling
Function calling is the AI’s ability to identify when an external tool is needed and automatically call this function. It transforms AI from a passive chatbot into an active agent that performs concrete actions. In 2025-2026, the Model Context Protocol (MCP) standardized how these connections work — see the next topic.
🔧 What Function Calling Allows
- •Fetch real-time data (weather, prices, news)
- •Perform precise calculations via APIs
- •Integrate with enterprise systems (CRM, ERP)
- •Automate complex workflows
- •Send emails, create documents, schedule meetings
💡 Practical Tip
Start with simple functions (fetch data, calculate) and work up to complex workflows. Platforms like n8n, Make.com, and Zapier let you create function calls without programming, and increasingly support MCP natively.
🧠 Memory Systems
Memory systems allow AI to maintain and organize information over time, learning from past interactions and maintaining continuity in long-term relationships.
📦 Types of Memory
- •Short term: Current conversation context (context window)
- •Long term: Preferences, history, user patterns
- •Episodic: Specific past events and experiences
- •Semantics: Organized factual and conceptual knowledge
📊 Practical Applications
- Customer service: AI remembers customer history and preferences
- Personal assistant: Learns your routines and priorities over time
- Tutoring: Adapts content based on the learner's progress
🔌 MCP - The USB-C of AI Agents
The Model Context Protocol (MCP) is the most important development in context engineering in 2025-2026. Created by Anthropic and now maintained by the Linux Foundation, MCP is a standard protocol that defines how AI models connect to tools, APIs, databases, and external services — like a universal "USB-C" for AI agents.
🚀 Why MCP Changed Everything
Before MCP, each AI system needed custom integrations for each tool—like having a different charger for every device. With MCP, a server announces its capabilities to any compatible agent, and the agent knows how to use that tool without specific configuration.
- •November 2024: Anthropic launches MCP (~100,000 downloads)
- •March 2025: OpenAI Adopts MCP in ChatGPT Desktop
- •April 2025: Google confirms support in Gemini. 8 million downloads; 5,800+ MCP servers
- •December 2025: MCP is donated to the Linux Foundation (AAIF), with OpenAI, Google, Microsoft, and AWS as co-founders
- •February 2026: 97 million downloads per month — nearly 1,000x growth in 15 months
🤝 MCP and A2A: Complementary Protocols
- •MCP (Model Context Protocol): Connects agents to tools and data — how an agent "uses" external resources
- •A2A (Agent-to-Agent Protocol): Created by Google in April 2025, it standardizes how agents communicate and collaborate with each other
- •Together, these protocols form the infrastructure for the next generation of AI systems, just as HTTP and TCP/IP form the foundation of the web
💡 Practical Tip
You don't need to code to use MCP. Tools like Claude Desktop, Cursor, and n8n already support MCP natively. Try installing a simple MCP server (such as file access or web search) and see how AI automatically gains new capabilities. More than 10,000 public MCP servers are available to use.
⚠️ Attention: Security
Research found injection vulnerabilities in 43% of tested MCP implementations. Always use MCP servers from trusted sources and check the permissions you grant. The protocol is evolving rapidly to address these issues.
📋 Module Summary
Next Module:
1.5 - Automating Business Processes with AI