Advanced AI: RAG, MCP, and Agents
Data Literacy
AI Workflows
- Process information from unstructured to structured data.
- Finding Aid for complex information.
- RAG (Retrieval-Augmented Generation)
- MCP (Multi-Chain Prompting)
- Agents (AI Agents)
RAG: Retrieval-Augmented Generation
- Process Data.
- Chunking.
- Embeddings.
- Vector Databases.
- LLMs (Large Language Models).
MCP: Model Context Protocol
- A standard protocol.
- Set of instructions for LLMs to follow.
- Gives LLM way to use external tools.
- LLMs can use multiple tools in a single prompt.
- Access third-party APIs.
- How to query databases.
Agents: AI Agents
- LLMs can act as agents.
- Agents can perform tasks on behalf of users.
- Agents can use tools and APIs to complete tasks.
Agents: AI Agents (Continued)
- Autonomously complete task at predetermined interval:
- Check for new data.
- Process data.
- Generate report.
- Big Agents = Bad Agents
Breaking down a Workflow
- Break down a workflow into steps.
- Ask AI to do small jobs.
- Use deterministic scripts when possible.
Example 1: Indexing an Archive
- Step 1: Take Photos of Documents.
- Human can include narrative to contextualize document.
- Step 2: Convert Photos to Text (OCR).
- Step 3: Chunk Text into Sections, if necessary.
- Step 4: Agent Extracts Metadata from Text.
Example 1: Indexing an Archive (Continued)
- Step 5: Agent Summarizes Text and Metadata.
- Step 6: Parse Metadata and Summaries into structured data.
- Step 7: Store structured data in a database.
- Step 8: Human reviews and corrects structured data.
Example 2: Vectorized Database
- Step 1: Collect sources.
- Step 2: OCR sources.
- Step 3: Chunk text into sections.
- Step 4: Create embeddings for each chunk.
- Step 5: Store embeddings in a vector database along with Metadata.
- Step 6: Use RAG to query vector database.