This repository serves as a progressive playground in the context of Generative AI and LLM agents applied in my master's degree in AI. It documents the evolution from basic Prompt Engineering and API integrations, through Retrieval-Augmented Generation (RAG) and tool calling, culminating in stateful, Multi-Agent architectures.
The core engineering approach across these projects is building demo versions of AI systems. These prototypes focus heavily on mitigating the most common pitfalls of modern LLMs:
- Preventing Hallucinations: Using strict grounding in local vector databases (RAG) and dynamic web search (Tavily).
- Mitigating "Role Breakout": Using advanced Prompt Engineering (Negative constraints, Anti-metatext rules) to ensure AI agents stay in their designated lanes.
- Evaluation Frameworks: Implementing LLM-as-a-Judge patterns and structured Pydantic outputs to mathematically validate model performance (Recall, Precision, Formatting).
- State Management: Transitioning from stateless LCEL chains to cyclical, memory-persistent graphs using
LangGraph.
Below is a summary of the 5 prototypes included in this repository. Click on each project's folder for more details.
- Focus: Hybridizing Unsupervised ML with GenAI.
- Stack: Scikit-Learn (PCA, GMM), Spotify API, Gemini 2.0 Flash.
- Description: A full-stack app that extracts mathematical audio features from a user's favorite tracks, clusters them using GMM and uses an LLM to deliver a sarcastic, psychoanalytical "roast" of their personality without leaking raw metrics.
- Focus: LangChain Expression Language (LCEL) & State Management.
- Stack: LangChain Core, Groq API (Llama-3-70b), Streamlit.
- Description: A lightweight app to cure the "blank page syndrome." It utilizes strict negative constraints to force engaging, hook-driven copywriting tailored to specific social networks, in an attempt to avoid a robotic tone.
- Focus: Vectorization, Embeddings & Semantic Search.
- Stack: FAISS, HuggingFace (
all-MiniLM-L6-v2), PyMuPDF, Groq API. - Description: A localized RAG pipeline that ingests technical PDFs. It demonstrates strict anti-hallucination prompting, forcing the model to answer only based on the retrieved context or admit ignorance.
- Focus: Tool Calling, AgentExecutor & LLM-as-a-Judge.
- Stack: LangChain Agents, DuckDuckGo Search, Custom Python Heuristics, Gemini.
- Description: An autonomous MLOps tutor that audits infrastructure code (Docker, K8s, Terraform and the main three cloud providers). This project heavily emphasizes quantitative evaluation, using a secondary LLM to score the primary agent's pedagogical value and precision across a Golden Dataset of 20 edge cases.
- Focus: LangGraph, Multi-Agent Orchestration & Real-time RAG.
- Stack: LangGraph, Tavily Search API, MemorySaver.
- Description: A stateful Multi-Agent system that routes user queries through the imitation of an academic faculty (Researcher, Ontologist, Ethicist, Epistemologist). It retrieves live news (if needed to respond to the user's query) and synthesizes it into deep philosophical essays while maintaining strict "Lane Keeping" to prevent cascading failures across the graph.
All projects in this repository are deployed as independent Streamlit applications. To run any of them locally:
-
Clone the repository:
git clone https://github.com/ygs1629/LLM_agents_prototypes.git cd LLM_agents_prototypes -
Navigate to the desired folder:
cd 05-multi-agent-philosophy -
Install the dependencies (preferably in a dedicated environment):
pip install -r requirements.txt
-
Run the streamlit app:
streamlit run app.py
Note: You will need to provide your own free API Keys for Gemini, Groq, Spotify, or Tavily depending on the project, entered directly in the app's UI. The web application is configured in Spanish. The description here is in English for portfolio presentation.