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_loop
User Query
LLM Reasoning
Tool Calls
Vector Lookup
Final Answer
Agent reasoning...
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 Calling2"syntax-keyword">from langchain_openai "syntax-keyword">import ChatOpenAI3"syntax-keyword">from langchain_core.tools "syntax-keyword">import tool4"syntax-keyword">from langgraph.graph "syntax-keyword">import StateGraph, END5"syntax-keyword">from langgraph.prebuilt "syntax-keyword">import ToolNode6"syntax-keyword">from typing "syntax-keyword">import TypedDict, Annotated7"syntax-keyword">import operator89"syntax-keyword">class AgentState(TypedDict):10 messages: Annotated[list, operator.add]1112@tool13"syntax-keyword">def search_web(query: str) -> str:14 """Search the web ">for current information."""15 "syntax-keyword">return f"Search results ">for: {query}"1617@tool18"syntax-keyword">def run_python(code: str) -> str:19 """Execute Python code ">in a sandbox."""20 "syntax-keyword">return "Execution result"2122llm = ChatOpenAI(model="gpt-4o", temperature=0)23tools = [search_web, run_python]24llm_with_tools = llm.bind_tools(tools)2526"syntax-keyword">def call_model(state: AgentState):27 response = llm_with_tools.invoke(state["messages"])28 "syntax-keyword">return {"messages": [response]}2930"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 END3334graph = 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
// 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