domain_03 / agentic-ai-rag

Agentic AI

Building autonomous AI agents that reason, plan, and act. Designing RAG pipelines that ground LLMs in real data. I work with LangChain, LangGraph, and frontier models to create AI systems that actually work in production.

LLM AgentsRAGLangGraphLangChainOpenAIAnthropicVector DBs
Agent Type
ReAct + Graph
Memory
Long + Short term
Orchestration
LangGraph
Retrieval
Hybrid Search
// rag_architecture

RAG Pipeline Design

Production RAG goes far beyond naive retrieval. I implement advanced techniques like HyDE, MMR for diversity, and cross-encoder re-ranking to maximize retrieval accuracy and answer quality.

  • Hybrid search (dense + sparse BM25)
  • Query decomposition & expansion
  • Contextual compression
  • Re-ranking with Cohere / Cross-encoder
  • Metadata filtering & guardrails
  • Streaming responses with citations
rag_pipelinelive
Source Docs
PDFs, URLs, databases
Chunking
Semantic splitting + overlap
Vector Store
Embeddings + metadata index
Hybrid Search
Dense + sparse (BM25)
LLM Generation
Grounded, cited responses
// ai_stack

AI / ML Toolkit

LLM Frameworks
LangChain
LangGraph
LlamaIndex
Haystack
CrewAI
AutoGen
Pydantic AI
AI / LLM APIs
OpenAI GPT-4o
Anthropic Claude
Google Gemini
Cohere
Mistral
Groq
Ollama
Vector Databases
Pinecone
Chroma
Weaviate
Qdrant
pgvector
FAISS
Milvus
MLOps & Tools
Python
FastAPI
Docker
LangSmith
Weights & Biases
Hugging Face
Sentence Transformers
// agent_code

LangGraph Agent Implementation

agent.pyPython
1"syntax-keyword">class="syntax-comment"># LangGraph Agent with Tool Calling
2"syntax-keyword">from langchain_openai "syntax-keyword">import ChatOpenAI
3"syntax-keyword">from langchain_core.tools "syntax-keyword">import tool
4"syntax-keyword">from langgraph.graph "syntax-keyword">import StateGraph, END
5"syntax-keyword">from langgraph.prebuilt "syntax-keyword">import ToolNode
6"syntax-keyword">from typing "syntax-keyword">import TypedDict, Annotated
7"syntax-keyword">import operator
8
9"syntax-keyword">class AgentState(TypedDict):
10 messages: Annotated[list, operator.add]
11
12@tool
13"syntax-keyword">def search_web(query: str) -> str:
14 """Search the web ">for current information."""
15 "syntax-keyword">return f"Search results ">for: {query}"
16
17@tool
18"syntax-keyword">def run_python(code: str) -> str:
19 """Execute Python code ">in a sandbox."""
20 "syntax-keyword">return "Execution result"
21
22llm = ChatOpenAI(model="gpt-4o", temperature=0)
23tools = [search_web, run_python]
24llm_with_tools = llm.bind_tools(tools)
25
26"syntax-keyword">def call_model(state: AgentState):
27 response = llm_with_tools.invoke(state["messages"])
28 "syntax-keyword">return {"messages": [response]}
29
30"syntax-keyword">def should_continue(state: AgentState) -> str:
31 last = state["messages"][-1]
32 "syntax-keyword">return "tools" "syntax-keyword">if last.tool_calls "syntax-keyword">else END
33
34graph = StateGraph(AgentState)
35graph.add_node("agent", call_model)
36graph.add_node("tools", ToolNode(tools))
37graph.set_entry_point("agent")
38graph.add_conditional_edges("agent", should_continue)
39graph.add_edge("tools", "agent")
40agent = graph.compile()
// projects

AI Projects

Multi-Agent Research System

An autonomous research agent built with LangGraph that decomposes complex questions, delegates to specialized sub-agents, and synthesizes comprehensive answers with citations.

LangGraphOpenAITavily SearchPythonFastAPIStreamlit

Document RAG Pipeline

Enterprise-grade Retrieval Augmented Generation pipeline with hybrid search (dense + sparse), re-ranking, and multi-document reasoning over uploaded PDFs.

LangChainPineconeOpenAIFastAPIBM25Cohere Rerank

Code Review Agent

An agentic code reviewer that analyzes GitHub PRs, identifies bugs, suggests improvements, and generates detailed review comments using Claude's extended thinking.

Anthropic ClaudeLangChainGitHub APIPythonDocker

Conversational SQL Agent

A natural language to SQL agent that understands schema, generates optimized queries, and explains results in plain English. Supports Postgres and SQLite.

LangChainGPT-4oSQLAlchemyStreamlitPostgreSQL
// agent_patterns

Agent Architectures

ReAct Agent

Reason + Act loop with tool use and observation cycles

Multi-Agent

Supervisor delegates tasks to specialized sub-agents

RAG Pipeline

Retrieval-grounded generation with hybrid search

Self-Reflection

Agents that critique and refine their own outputs iteratively