How rgnarmadha/chatbot-trial works
This is a LangGraph conversational chatbot whose CLI accepts a user turn, runs a stateful router loop, and returns a final answer. The router can request knowledge retrieval or an MCP tool call before dispatching to the responder. A separate ingestion workflow loads and chunks documents, embeds them, and persists vectors for retrieval. The graph captures the documented runtime branches and source-visible calls; MCP server details and some LLM backend behavior are not fully sampled, so uncertain integrations are omitted.
Main entry points: graph.py Graph runner · pipeline.py Ingestion pipeline · registry.py MCP registry · router.py Action router
Components 22
Conversation workflow
- CLI entry
main.py - Chat interface
cli/interface.py - Graph runner
agent/graph.py - Conversation state
agent/state.py - Action router
agent/nodes/router.py - System prompts
agent/prompts/system.py - Retrieval node
agent/nodes/retriever.py - Tool caller
agent/nodes/tool_caller.py - Response node
agent/nodes/responder.py
Knowledge base
- Ingestion pipeline
rag/ingestion/pipeline.py - Document loaders
rag/ingestion/loaders.py - Document chunker
rag/ingestion/chunker.py - Text embeddings
rag/embeddings.py - RAG retriever
rag/retriever.py - Vector store
rag/store.py
MCP tools
- MCP registry
mcp_tools/registry.py - MCP client
mcp_tools/client.py
Runtime services
- LLM backend
llm/backend.py - Application settings
config/settings.py
Other components
- Chat user
- LLM service
- MCP servers
Connections 26
- Chat user → Chat interface: enters turn
README.md - CLI entry → Graph runner: builds graph
main.py - CLI entry → Chat interface: starts loop
main.py - Chat interface → Graph runner: runs turn
cli/interface.py - Graph runner → Action router: dispatches
agent/graph.py - Graph runner → Retrieval node: dispatches
agent/graph.py - Graph runner → Tool caller: dispatches
agent/graph.py - Graph runner → Response node: dispatches
agent/graph.py - Graph runner → Conversation state: tracks state
agent/graph.py - Action router → LLM backend: requests decision
agent/nodes/router.py - Response node → LLM backend: generates answer
agent/nodes/responder.py - Action router → System prompts: formats prompt
agent/nodes/router.py - Response node → System prompts: uses prompt
agent/nodes/responder.py - Retrieval node → RAG retriever: retrieves context
agent/nodes/retriever.py - Tool caller → MCP registry: calls tool
agent/nodes/tool_caller.py - Graph runner → MCP registry: discovers tools
agent/graph.py - MCP registry → MCP client: routes calls
mcp_tools/registry.py - MCP client → MCP servers: connects
mcp_tools/client.py - Ingestion pipeline → Document loaders: loads documents
rag/ingestion/pipeline.py - Ingestion pipeline → Document chunker: chunks documents
rag/ingestion/pipeline.py - Ingestion pipeline → Text embeddings: embeds chunks
rag/ingestion/pipeline.py - Ingestion pipeline → Vector store: upserts vectors
rag/ingestion/pipeline.py - RAG retriever → Text embeddings: embeds query
rag/retriever.py - RAG retriever → Vector store: queries vectors
rag/retriever.py - LLM backend → Application settings: reads config
llm/backend.py - MCP registry → Application settings: reads servers
mcp_tools/registry.py