# shahzaibkaramat67-coder/langchain_pipliner_agent architecture

> Architecture diagram of the GitHub repository shahzaibkaramat67-coder/langchain_pipliner_agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shahzaibkaramat67-coder/langchain_pipliner_agent
- Repository: https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent

## Overview

This is a command-line web-research assistant. A user submits a request; the pipeline repeatedly plans a search, URL research, or stop action, executes it, and evaluates whether the accumulated information is sufficient. Approved results are passed to a final-answer agent. The graph also shows the shared state, LLM client, and JSON response parsing. Source excerpts support the main orchestration and tool calls; the README is empty, so broader product capabilities are not documented.

Main entry points: [`pipliner.py`](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/pipliner.py) (Research loop), [`planner.py`](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/planner.py) (Action planner), [`agent.py`](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/agent.py) (LLM client), [`main.py`](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/main.py) (CLI entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_cli["CLI entry<br/>[main.py]"]
end

subgraph group_workflow["Research workflow"]
  node_pipeline["Research loop<br/>[pipliner.py]"]
  node_state["Pipeline state<br/>[state.py]"]
  node_planner["Action planner<br/>[planner.py]"]
  node_executor["Tool executor<br/>[executer.py]"]
  node_evaluator["Sufficiency evaluator<br/>[evaluate.py]"]
  node_final["Final answer<br/>[final_answer.py]"]
end

subgraph group_tools["Research tools"]
  node_search["Web search<br/>[tools.py]"]
  node_research["Page research<br/>[tools.py]"]
  node_tavily["Tavily search"]
end

subgraph group_support["Agent support"]
  node_agent["LLM client<br/>[agent.py]"]
  node_json["JSON parser"]
  node_memory["In-memory buffer<br/>[memory.py]"]
end

node_user(("User"))
node_websites["Web pages"]
node_llm["Chat model API"]

node_user -->|"submits request"| node_cli
node_cli -->|"starts workflow"| node_pipeline
node_cli -->|"creates state"| node_state
node_pipeline -->|"requests plan"| node_planner
node_pipeline -->|"updates state"| node_state
node_planner -->|"reads state"| node_state
node_planner -->|"requests plan"| node_agent
node_planner -->|"parses response"| node_json
node_pipeline -->|"executes plan"| node_executor
node_executor -->|"dispatches search"| node_search
node_executor -->|"dispatches research"| node_research
node_search -->|"queries"| node_tavily
node_research -->|"fetches pages"| node_websites
node_pipeline -->|"evaluates result"| node_evaluator
node_evaluator -->|"requests evaluation"| node_agent
node_evaluator -.->|"parses response"| node_json
node_pipeline -->|"formats approved result"| node_final
node_final -->|"requests answer"| node_agent
node_agent -->|"sends chat request"| node_llm

click node_cli "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/main.py"
click node_pipeline "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/pipliner.py"
click node_state "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/state.py"
click node_planner "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/planner.py"
click node_executor "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/executer.py"
click node_evaluator "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/evaluate.py"
click node_final "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/final_answer.py"
click node_search "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/tools.py"
click node_research "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/tools.py"
click node_agent "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/agent.py"
click node_json "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/structrure_output.py"
click node_memory "https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/memory.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_user toneBlue
class node_pipeline,node_state,node_planner,node_executor,node_evaluator,node_final toneAmber
class node_search,node_research,node_tavily,node_llm toneMint
class node_agent,node_json,node_memory toneRose
class node_websites toneIndigo
```

## Components

### User interface

- [CLI entry](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/main.py): `main.py`

### Research workflow

- [Research loop](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/pipliner.py): `pipliner.py`
- [Pipeline state](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/state.py): `state.py`
- [Action planner](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/planner.py): `planner.py`
- [Tool executor](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/executer.py): `executer.py`
- [Sufficiency evaluator](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/evaluate.py): `evaluate.py`
- [Final answer](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/final_answer.py): `final_answer.py`

### Research tools

- [Web search](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/tools.py): `tools.py`
- [Page research](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/tools.py): `tools.py`
- **Tavily search**

### Agent support

- [LLM client](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/agent.py): `agent.py`
- [JSON parser](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/structrure_output.py): `structrure_output.py`
- [In-memory buffer](https://github.com/shahzaibkaramat67-coder/langchain_pipliner_agent/blob/main/memory.py): `memory.py`

### Other components

- **User**
- **Web pages**
- **Chat model API**

## Connections

- User → CLI entry: submits request (evidence: `main.py`)
- CLI entry → Research loop: starts workflow (evidence: `main.py`)
- CLI entry → Pipeline state: creates state (evidence: `main.py`)
- Research loop → Action planner: requests plan (evidence: `pipliner.py`)
- Research loop → Pipeline state: updates state (evidence: `pipliner.py`)
- Action planner → Pipeline state: reads state (evidence: `planner.py`)
- Action planner → LLM client: requests plan (evidence: `planner.py`)
- Action planner → JSON parser: parses response (evidence: `planner.py`)
- Research loop → Tool executor: executes plan (evidence: `pipliner.py`)
- Tool executor → Web search: dispatches search (evidence: `executer.py`)
- Tool executor → Page research: dispatches research (evidence: `executer.py`)
- Web search → Tavily search: queries (evidence: `tools.py`)
- Page research → Web pages: fetches pages (evidence: `tools.py`)
- Research loop → Sufficiency evaluator: evaluates result (evidence: `pipliner.py`)
- Sufficiency evaluator → LLM client: requests evaluation (evidence: `evaluate.py`)
- Sufficiency evaluator → JSON parser: parses response (evidence: `evaluate.py`)
- Research loop → Final answer: formats approved result (evidence: `pipliner.py`)
- Final answer → LLM client: requests answer (evidence: `final_answer.py`)
- LLM client → Chat model API: sends chat request (evidence: `agent.py`)
