A comprehensive workshop and codebase for building intelligent, agentic retrieval-augmented generation (RAG) applications using Pinecone vector database and Amazon Bedrock. This repository provides hands-on experience with modern AI architectures, semantic search, and tool-calling agents.
- Vector database fundamentals: Understanding Pinecone architecture and vector similarity search
- RAG pipeline development: Building end-to-end retrieval-augmented generation systems
- Agentic AI implementation: Creating intelligent agents that can use multiple tools and make decisions
- AWS integration: Leveraging Amazon Bedrock for embeddings and text generation
- Web-based RAG chat applications: Building a complete web-based chat application with Chainlit
βββ π notebooks/ # Jupyter notebooks for learning progression
β βββ 1_data_loading_pipeline.ipynb # Data ingestion and vectorization
β βββ 2_data_query_pipeline.ipynb # Simple RAG implementation
β βββ 3_agentic_rag.ipynb # Agentic RAG with tool calling
β βββ 4_clean_up.ipynb # Resource cleanup
βββ π webapp/ # Web-based RAG chat application
β βββ app.py # Chainlit chat interface
β βββ rag_pipeline.py # Core RAG pipeline
β βββ pinecone_vector_search_tool.py # Vector search tool
β βββ web_search_tool.py # Web search tool
β βββ requirements.txt # Python dependencies
βββ π workshop/ # Interactive workshop content
β βββ instruqt/ # Instruqt track materials and config
βββ π data/ # Sample dataset (Compaq 10-K filings 1994-2002)
βββ π README.md # This file
- Learn about Pinecone, AWS, and RAG architecture
- Create Pinecone account and index
- Set up development environment
- Parse and chunk text documents
- Generate embeddings using Amazon Bedrock
- Upload vectors to Pinecone index
- Query Pinecone with semantic search
- Augment prompts with retrieved context
- Generate responses using Amazon Bedrock
- Create multiple retrieval tools
- Implement agent decision-making logic
- Orchestrate complex RAG workflows
- Build interactive chat interface with Chainlit
- Deploy agentic RAG pipeline
- Test with real user interactions
- Resource management and cleanup
- Production considerations
- Next steps and resources
- Python 3.8+ installed on your system
- Pinecone account: Sign up for free
- AWS account: With access to Amazon Bedrock
git clone https://github.com/pinecone-io/agentic-ai-with-pinecone-and-aws.git
cd agentic-ai-with-pinecone-and-aws
Create a Python virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
For the webapp:
cd webapp
pip install -r requirements.txt
For the notebooks, in the project root:
pip install jupyter pinecone boto3 tqdm ddgs
For the webapp, create a .env
file in the webapp/
directory:
# Pinecone Configuration
PINECONE_API_KEY=YOUR_API_KEY
PINECONE_INDEX_NAME=agentic-ai-with-pinecone-and-aws
PINECONE_NAMESPACE=__default__
# This is for non-production projects so we know which sample app the index came from.
# Remove this and related code for production.
PINECONE_SOURCE_TAG=pinecone:agentic_ai_with_pinecone_and_aws:webapp
# AWS Configuration
AWS_REGION=us-east-1
GENERATION_MODEL_ID=anthropic.claude-3-haiku-20240307-v1:0
EMBEDDING_MODEL_ID=amazon.titan-embed-text-v2:0
# Optional: AWS Credentials (if not using IAM roles)
# AWS_ACCESS_KEY_ID=your-access-key
# AWS_SECRET_ACCESS_KEY=your-secret-key
# or
# AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-token
For the notebooks, you'll need to export the following AWS credentials (if not using IAM roles) before starting the Jupyter server:
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
# or
# AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-token
-
Start with the workshop content:
- Navigate to the
workshop/instruqt
directory - Follow the step-by-step assignments in order
- Each assignment builds upon the previous one and you'll work through Jupyter notebooks in the
notebooks
directory
- Navigate to the
-
Run the Jupyter notebooks:
To run the Jupyter notebooks, you can run the Jupyter server locally (instructions below) or through an IDE like VSCode or Cursor.
- From the root directory, run:
jupyter notebook notebooks/
- Execute notebooks in sequence: 1 β 2 β 3 β 4
- Each notebook teaches specific concepts and skills and builds upon the previous notebook
If you already have a Pinecone index with data:
- Set up your environment (see Quick start above)
- Run the chat application:
cd webapp chainlit run app.py
- Open your browser to
http://localhost:8000
- Start chatting with the agentic RAG system!
- Intelligent tool selection: AI agent decides which tools to use based on query context
- Multi-tool integration: Combines vector search and web search capabilities
- Conversation memory: Maintains context across multiple interactions
- Pinecone vector search: Semantic search over your private knowledge base
- Web search: Real-time information from the internet using DuckDuckGo
- Intelligent routing: Automatic selection of appropriate search method
- Modern UI: Clean, responsive design with Chainlit
- Real-time responses: Fast, streaming responses from the AI agent
- Conversation history: Persistent chat history during sessions
- Visual indicators: Clear distinction between user and agent messages
The repository includes Compaq Computer Corporation's 10-K filings from 1994-2002, providing:
- Financial data: Revenue, expenses, and business metrics
- Business strategy: Product development and market analysis
- Historical context: Technology industry evolution during the dot-com era
Perfect for testing RAG capabilities with real business documents!
After completing this workshop, you'll be able to:
- β Design RAG architectures: Understand when and how to use retrieval-augmented generation
- β Implement vector search: Build semantic search capabilities with Pinecone
- β Create AI agents: Develop intelligent agents that can use multiple tools
- β Integrate AWS services: Leverage Amazon Bedrock for embeddings and generation
- β Build production apps: Create deployable chat applications
- β Handle real-world data: Process and query business documents effectively
- Pinecone Documentation: Comprehensive guides and API reference
- Amazon Bedrock Documentation: AWS AI service documentation
- Chainlit Documentation: Chat application framework
- RAG Best Practices: Production considerations
We welcome contributions! Please feel free to:
- Submit issues and bug reports
- Propose new features and improvements
- Contribute code via pull requests
- Share your use cases and success stories
This project is licensed under the MIT License - see the LICENSE file for details.