Production-ready Streamlit application with LangChain agents, RAG, moderation layers, guardrails, and multiple tools.
Streamlit UI with tabs: Chat, Setup, and Help
Security: Toxicity, injection, PII masking
Quality: Citations, tone, professional responses
FAISS + PDF processing + Knowledge search
# 1. Make sure Ollama is running
ollama serve
ollama pull llama3.1
# 2. Navigate to the directory
cd "Full Agent + streamlit + langchain"
# 3. Run with helper script (recommended)
chmod +x scripts/docker-run.sh
./scripts/docker-run.sh run
# OR use docker-compose directly
docker-compose up --build
# 4. Access the app
# Open: http://localhost:8505
# 1. System dependencies (Run PowerShell as Administrator)
.\setup\windows\install.ps1
# 2. Python environment & dependencies
cd "Full Agent + streamlit + langchain"
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
# Generate the FAISS index from PDFs
python src/rag/generate_vector_db.py
# If you have an NVIDIA GPU
.\setup\windows\fix_pytorch_cuda.bat
# Start Ollama and run the app
ollama serve
ollama pull llama3.1
streamlit run ui.py
# 1. System dependencies
chmod +x setup/mac/install.sh && ./setup/mac/install.sh
# 2. Python environment & dependencies
cd "Full Agent + streamlit + langchain"
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Generate the FAISS index from PDFs
python src/rag/generate_vector_db.py
# Start Ollama and run the app
ollama serve
ollama pull llama3.1
streamlit run ui.py
# Navigate to the directory
cd "Full Agent + streamlit + langchain"
# Configure Poetry
poetry config virtualenvs.in-project true
# Install dependencies
poetry install
# Make sure Ollama is running
ollama serve
ollama pull llama3.1
# Run the Streamlit app
poetry run streamlit run ui.py
# Access: http://localhost:8501
The project includes a ready-to-use prompt file that you can copy and paste into Copilot, ChatGPT, Claude, or any AI assistant.
COPILOT_INSTALL_PROMPT.md in the project root
# Location of the Copilot prompt file:
COPILOT_INSTALL_PROMPT.md
# The file contains a detailed prompt you can use with:
# - GitHub Copilot Chat
# - ChatGPT / GPT-4
# - Claude
# - Any AI coding assistant
# Simply copy the prompt and paste it into your AI tool!
FAISS + PDF processing + Embeddings
# Generate the FAISS index from PDFs
python src/rag/generate_vector_db.py
# src/moderation/manager.py
class ModerationManager:
def check_input(self, text: str) -> ModerationResult:
if self._is_toxic(text):
return ModerationResult(blocked=True, reason="Toxic content")
if self._is_injection(text):
return ModerationResult(blocked=True, reason="Injection attempt")
return ModerationResult(blocked=False, cleaned=self._mask_pii(text))
# src/guardrails/validators.py
class ResponseValidator:
def validate(self, response: str) -> ValidationResult:
warnings = []
if self._lacks_citations(response):
warnings.append("Response lacks source citations")
if self._is_overly_apologetic(response):
warnings.append("Tone is unprofessional")
return ValidationResult(warnings=warnings)
Conversational interface with tools
LLM, RAG, and persistence config
Documentation and examples
Full Agent + streamlit + langchain/
├── ui.py # Main Streamlit interface
├── config/ # YAML configurations
│ ├── model_config.yaml # LLM settings
│ └── prompt_templates.yaml
├── src/
│ ├── moderation/ # Security Layer
│ │ └── manager.py # Toxicity, injection, PII
│ ├── guardrails/ # Quality Layer
│ │ └── validators.py # Citations, tone
│ ├── rag/ # RAG Implementation
│ │ ├── retriever.py
│ │ └── generate_vector_db.py
│ ├── tools/ # Agent tools
│ └── llm/ # LLM clients
└── data/
├── docs/books/ # PDF documents
└── embeddings/ # FAISS index