Skip to content

Commit ee6a1f6

Browse files
Merge pull request #90 from ContextualAI/matthew-tutorial
Matthew tutorial
2 parents 0bf36c7 + ea35c70 commit ee6a1f6

10 files changed

+1161
-0
lines changed

16-matthew-mcconaughey/McConaughey.ipynb

Lines changed: 1026 additions & 0 deletions
Large diffs are not rendered by default.

16-matthew-mcconaughey/README.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Building Matthew McConaughey with Contextual AI 🚀
2+
3+
## Overview
4+
5+
Build your own Matthew McConaughey AI agent! This project demonstrates how to create a RAG-powered conversational agent that embodies Matthew McConaughey's wisdom, philosophy, and personality. Inspired by his interview with Joe Rogan where he expressed interest in "a private LLM, fed only with his books, notes, journals, and aspirations," we'll build exactly that using Contextual AI's managed RAG solution.
6+
7+
**What You'll Build**: An interactive AI agent that speaks like Matthew McConaughey, drawing from his speeches, interviews, lessons, and life advice—fully grounded in his actual words with no outside influence.
8+
9+
**Time Required**: Under 20 minutes for a fully functional Matthew McConaughey AI agent
10+
11+
## What You'll Learn
12+
13+
This tutorial covers everything you need to build a personality-driven RAG agent:
14+
15+
- **Creating a RAG Agent** - Set up datastores, ingest documents, and configure agents with custom personalities
16+
- **Querying the Agent** - Have conversations with your McConaughey agent and get wisdom grounded in his actual words
17+
- **Evaluating "McConaugheyness"** - Measure how well your agent captures his unique voice and philosophy
18+
- **Custom System Prompts** - Learn to craft prompts that maintain personality consistency
19+
20+
## Project Content
21+
22+
### 1. Agent Setup (5 minutes)
23+
- Create a Contextual AI workspace and API key
24+
- Set up a datastore for McConaughey's content
25+
- Ingest speeches, interviews, and life lessons
26+
- Configure an agent with custom personality prompts
27+
28+
### 2. Document Collection
29+
The project uses authentic Matthew McConaughey content including:
30+
- **13 Lessons Learned by Matthew McConaughey.pdf** - Life wisdom and principles
31+
- **7 Takeaways from Matthew McConaughey and Greenlights.pdf** - Key insights from his book
32+
- **Joe Rogan - Matthew.pdf** - Podcast interview transcript
33+
- **Matthew McConaughey's Advice for Creating Your Best 2025.pdf** - Goal-setting wisdom
34+
- **The Art of a Courageous Life.pdf** - Philosophy on courage and living authentically
35+
- **The Hidden Art Of Reinventing Yourself.pdf** - Transformation and personal growth
36+
- **The Origin Story of 'Alright, Alright, Alright'.pdf** - His iconic catchphrase origin
37+
- **To Make the Loss of These Lives Matter.pdf** - Speech on meaningful topics
38+
39+
### 3. Agent Interaction (5 minutes)
40+
Learn to:
41+
- Ask questions about life advice, acting, and philosophy
42+
- Receive responses that sound authentically like McConaughey
43+
- Maintain conversational context across multiple queries
44+
- Get answers grounded in his actual writings and speeches
45+
46+
### 4. Personality Evaluation (5 minutes)
47+
- Use the **LMUnit** evaluation framework to assess "McConaugheyness"
48+
- Test for authenticity, wisdom consistency, and voice matching
49+
- Measure how well the agent captures his unique communication style
50+
- Evaluate retrieval accuracy and response grounding
51+
52+
### 5. Custom Prompt Engineering (5 minutes)
53+
- Craft system prompts that maintain personality consistency
54+
- Handle first-person vs. third-person references correctly
55+
- Ensure responses stay grounded in source material
56+
- Create instructions for authentic voice replication
57+
58+
## Key Features Demonstrated
59+
60+
### Personality-Driven RAG
61+
- Custom system prompts that embody McConaughey's speaking style
62+
- First-person perspective handling for authentic responses
63+
- Wisdom and philosophy extraction from diverse sources
64+
65+
### Intelligent Document Processing
66+
- Automatic parsing of speeches, interviews, and articles
67+
- Support for PDF transcripts and varied document formats
68+
- Metadata extraction for proper attribution
69+
70+
### Authentic Response Generation
71+
- Responses that capture McConaughey's unique voice
72+
- Grounding in actual quotes and teachings
73+
- Proper source citation for verification
74+
75+
### Production-Ready Architecture
76+
- Secure datastore management
77+
- API-first design for integration
78+
- Scalable agent deployment
79+
80+
## Getting Started
81+
82+
### Prerequisites
83+
- Google Colab account (or local Jupyter environment)
84+
- Contextual AI workspace ([Sign up free](https://app.contextual.ai/))
85+
- API key from your Contextual workspace
86+
87+
### Quick Start
88+
1. Open the notebook: `McConaughey.ipynb`
89+
2. Set up your `CONTEXTUAL_API_KEY` in Colab secrets or `.env` file
90+
3. Follow the step-by-step instructions
91+
4. Start chatting with your McConaughey agent!
92+
93+
## Sample Questions You Can Ask
94+
95+
After completing the tutorial, your agent will be able to answer questions like:
96+
97+
- "Tell me the story behind 'alright, alright, alright'"
98+
- "What are your thoughts on living a courageous life?"
99+
- "What lessons have you learned about success and failure?"
100+
- "How do you approach reinventing yourself?"
101+
- "What advice do you have for setting goals?"
102+
- "What does 'greenlights' mean to you?"
103+
104+
## The Inspiration
105+
106+
This project was inspired by Matthew McConaughey's interview with Joe Rogan where he described wanting:
107+
108+
> "a private LLM, fed only with his books, notes, journals, and aspirations, so he can ask it questions and get answers based solely on that information, without any outside influence"
109+
110+
Using Contextual AI's RAG platform, we've built exactly that—an agent that speaks with McConaughey's voice, drawing only from his actual words and wisdom.
111+
112+
## Integration Options
113+
114+
### API Integration
115+
Use this agent in your existing applications:
116+
- REST API endpoints for all functionality
117+
- Python client library (`pip install contextual-client`)
118+
- Streaming responses for real-time conversations
119+
120+
## Related Examples
121+
122+
- 🔗 **Full Workshop Tutorial**: [08-ai-workshop](../08-ai-workshop/)
123+
- 🔗 **LMUnit Evaluation**: [03-standalone-api/01-lmunit](../03-standalone-api/01-lmunit/)
124+
- 🔗 **Parse API Demo**: [03-standalone-api/04-parse](../03-standalone-api/04-parse/)
125+
- 🔗 **Agent Performance**: [06-improve-agent-performance](../06-improve-agent-performance/)
126+
127+
## Support
128+
129+
- 📧 **Email**: [email protected]
130+
- 📖 **Documentation**: [docs.contextual.ai](https://docs.contextual.ai/)
131+
- 🏢 **Platform**: [app.contextual.ai](https://app.contextual.ai/)
132+
133+
---
134+
135+
**Ready to channel some McConaughey wisdom?** Open `McConaughey.ipynb` and build your own AI agent that embodies his unique perspective on life! Alright, alright, alright! 🎬
Binary file not shown.
808 KB
Binary file not shown.
Binary file not shown.
531 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)