Production-ready Streamlit application with LangGraph state machines, RAG, moderation layers, guardrails, and explicit control flow.
Explicit control flow with nodes and edges
Support for iterative agent behaviors
Dynamic routing based on state
Track state at every step of execution
# 1. Make sure Ollama is running
ollama serve
ollama pull llama3.1
# 2. Navigate to the directory
cd "Full Agent + streamlit + langgraph"
# 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. Navigate to the project
cd "Full Agent + streamlit + langgraph"
# 2. Run the automated installer (PowerShell as Admin)
.\setup\windows\install.ps1
# 3. Setup Python environment & dependencies
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
.\setup\windows\fix_pytorch_cuda.bat after setup for acceleration.
# 1. Installation & Setup
cd "Full Agent + streamlit + langgraph"
chmod +x setup/mac/install.sh && ./setup/mac/install.sh
# 2. Python environment & dependencies
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
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/agent/graph.py
from langgraph.graph import StateGraph, END
from typing import TypedDict, Annotated
class AgentState(TypedDict):
messages: Annotated[list, add_messages]
tool_calls: list
final_response: str
def create_agent_graph():
graph = StateGraph(AgentState)
# Add nodes
graph.add_node("agent", agent_node)
graph.add_node("tools", tool_node)
# Add edges
graph.set_entry_point("agent")
graph.add_conditional_edges(
"agent",
router,
{"tools": "tools", "end": END}
)
graph.add_edge("tools", "agent") # Cycle back
return graph.compile()
# 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))
Conversational interface with tools
LLM, RAG, and persistence config
Documentation and examples
Full Agent + streamlit + langgraph/
├── ui.py # Main Streamlit interface
├── config/ # YAML configurations
│ ├── model_config.yaml # LLM settings
│ └── prompt_templates.yaml
├── src/
│ ├── agent/ # LangGraph Agent
│ │ ├── graph.py # StateGraph definition
│ │ ├── nodes.py # Node functions
│ │ └── state.py # State schema
│ ├── 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