This repository contains the lessons, practical code and exercises for Week 3 of the Agentic AI Developer Certification Program by Ready Tensor. Week 3 builds on the modular prompt engineering concepts introduced in Week 2 and adds practical examples of multi-turn conversations and robust system prompts.
- Making your first LLM calls and grounding them in publication content
- Designing safe, consistent, and modular system prompts
- Managing chat memory in long conversations
- Adding memory persistence for session continuity
- Implementing a full RAG pipeline using vector databases and embeddings
Make basic LLM calls using LangChain and Groq. Learn to ground questions in documents and maintain context in multi-turn conversations.
Design modular system prompts that define assistant behavior, tone, and safety boundaries. See how prompt structure impacts reliability and security.
Explore how to manage growing conversation history using three strategies: stuffing, recent-only, and summarization — and analyze their trade-offs.
Add memory persistence to your assistant so users can resume chats across sessions. Covers LangChain’s memory types and custom database implementations.
Build a complete RAG system that semantically retrieves publication content and uses it to generate grounded, context-aware responses in real time.
rt-agentic-ai-cert-week3/
├── code/
│ ├── config/
│ │ ├── config.yaml # App config
│ │ └── prompt_config.yaml # Prompt configurations for system prompt examples
│ ├── paths.py # File path configurations
│ ├── prompt_builder.py # Modular prompt construction functions
│ ├── run_wk3_l1_example_1_2.py # Lesson 1: Basic LLM calls and publication grounding
│ ├── run_wk3_l1_example_3.py # Lesson 1: Interactive terminal chat example
│ ├── run_wk3_l2_sys_prompt_example.py # Lesson 2: System prompt examples and testing
│ ├── run_wk3_l3a_memory_strategies.py # Lesson 3A: Memory strategies comparison
│ ├── run_wk3_l4_vector_db_ingest.py # Lesson 4: Vector DB ingestion script
│ ├── run_wk3_l4_vector_db_rag.py # Lesson 4: Vector DB RAG example
│ └── utils.py # Utility functions
├── data/ # Sample publications for exercises
│ ├── 57Nhu0gMyonV.md
│ ├── ljGAbBceZbpv.md
│ ├── tum5RnE4A5W8.md
│ ├── yzN0OCQT7hUS-sample-questions.yaml # Sample questions used in lesson 3 exercise
│ └── yzN0OCQT7hUS.md
├── lessons/ # Lesson content and exercises
├── outputs/ # Generated prompts and LLM responses
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
-
Clone the repository:
git clone https://github.com/readytensor/rt-agentic-ai-cert-week3.git cd rt-agentic-ai-cert-week3 -
Install dependencies:
pip install -r requirements.txt
-
Set up your Groq API key:
Create a
.envfile in the root directory and add your API key:GROQ_API_KEY=your-api-key-hereYou can get your API key from Groq.
This repository includes scripts to help you experiment with different types of interactions and prompt configurations.
-
run_wk3_l1_example_1_2.py- Example 1: A simple LLM call answering a general question about VAEs.
- Example 2: The same question, but grounded in the publication content.
-
run_wk3_l1_example_3.py- An interactive terminal-based chat with the assistant, showing how multi-turn conversations work and how context is managed.
-
run_wk3_l2_sys_prompt_example.py- Tests system prompt configurations (basic and advanced) to see how they handle manipulative questions and maintain professional tone and safety.
run_wk3_l3a_memory_strategies.py- Compares three memory management strategies: stuffing everything, trimming to recent messages, and summarizing conversation history.
- Simulates a long conversation using real questions, saving detailed results (Q&A pairs, token usage, and final prompts) in the
outputs/directory. - Includes an interactive mode for running a single strategy or a full comparison report.
-
run_wk3_l4_vector_db_ingest.py- Vector Database Ingestion: Initializes a ChromaDB instance with persistent storage, chunks publications into smaller documents, embeds them using HuggingFace transformers, and stores them in the vector database for semantic search.
-
run_wk3_l4_vector_db_rag.py- Retrieval-Augmented Generation (RAG): Interactive terminal-based chat that retrieves relevant documents from the vector database based on user queries and generates contextual responses using retrieved content. Includes configurable similarity thresholds and result counts.
Each script saves outputs and transcripts in the outputs/ directory for easy review and comparison.
This project is licensed under the CC BY-NC-SA 4.0 License – see the LICENSE file for details.
Ready Tensor, Inc.
- Email: contact at readytensor dot com
- Issues & Contributions: Open an issue or pull request on this repository
- Website: Ready Tensor