How jogindernrajput/langchain-agent works
Agentic Research Agent is a provider-agnostic research assistant with CLI and HTTP entry points, a ReAct tool-using mode, and a supervisor-driven multi-agent RAG mode. The principal workflow accepts a question, selects a configured service, runs an agent graph, and returns an answer; knowledge-base ingestion and retrieval support the RAG branches. The graph distinguishes retrieval, synthesis, and critique in multi-agent mode. Some API startup and graph wiring excerpts are incomplete, so only documented or sampled connections are shown.
Main entry points: multiagent/service.py MultiAgentRAG · agents/service.py ResearchAgent · retriever.py Hybrid retriever · graph.py ReAct graph
Components 24
Agent orchestration
- Mode selector
src/agentic_research_agent/service_factory.py - ResearchAgent
src/agentic_research_agent/agents/service.py - ReAct graph
src/agentic_research_agent/agents/graph.py - MultiAgentRAG
src/agentic_research_agent/multiagent/service.py - Supervisor graph
src/agentic_research_agent/multiagent/graph.py - Retrieval stage
src/agentic_research_agent/multiagent/graph.py - Synthesis stage
src/agentic_research_agent/multiagent/graph.py - Grounding critic
src/agentic_research_agent/multiagent/graph.py
Retrieval and knowledge
- Knowledge base
src/agentic_research_agent/tools/knowledge_base.py - Hybrid retriever
src/agentic_research_agent/rag/retriever.py - Query expansion
src/agentic_research_agent/rag/query_transform.py - Cross-encoder reranker
src/agentic_research_agent/rag/reranker.py - Source documents
data/knowledge_base
Tools and models
- Web search
src/agentic_research_agent/tools/web_search.py - Calculator
src/agentic_research_agent/tools/calculator.py - Chat model factory
src/agentic_research_agent/core/llm.py
Configuration and memory
- Settings
src/agentic_research_agent/config/settings.py - Conversation checkpointer
src/agentic_research_agent/agents/checkpointer.py
Other components
- Question asker
- LLM provider
- Answer consumer
- DuckDuckGo
Connections 34
- Question asker → CLI: asks via
- Question asker → HTTP API: submits to
- CLI → Mode selector: builds service
- HTTP API → Mode selector: builds service
- Mode selector → ResearchAgent: selects single
- Mode selector → MultiAgentRAG: selects multiagent
- ResearchAgent → ReAct graph: builds and invokes
- MultiAgentRAG → Supervisor graph: builds and invokes
- ResearchAgent → Chat model factory: builds model
- MultiAgentRAG → Chat model factory: builds model
- ResearchAgent → Knowledge base: builds index
- ResearchAgent → Conversation checkpointer: builds memory
- MultiAgentRAG → Knowledge base: builds index
- MultiAgentRAG → Hybrid retriever: builds retriever
- MultiAgentRAG → Query expansion: builds expander
- MultiAgentRAG → Conversation checkpointer: builds memory
- ReAct graph → Web search: dispatches tool
- ReAct graph → Knowledge base: dispatches tool
- ReAct graph → Calculator: dispatches tool
- Supervisor graph → Retrieval stage: routes to
- Supervisor graph → Synthesis stage: routes to
- Supervisor graph → Grounding critic: routes to
- Retrieval stage → Query expansion: expands query
- Retrieval stage → Hybrid retriever: retrieves chunks
- Hybrid retriever → Knowledge base: dense-searches
- Hybrid retriever → Source documents: ranks lexically
- Hybrid retriever → Cross-encoder reranker: optionally reranks
- Query expansion → Chat model factory: invokes model
- Chat model factory → LLM provider: constructs provider
- ResearchAgent → Settings: reads configuration
- MultiAgentRAG → Settings: reads configuration
- Web search → DuckDuckGo: searches web
- ResearchAgent → Answer consumer: returns answer
- MultiAgentRAG → Answer consumer: returns answer