# avanipatel-16/pippa-ai-agent architecture

> Architecture diagram of the GitHub repository avanipatel-16/pippa-ai-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/avanipatel-16/pippa-ai-agent
- Repository: https://github.com/avanipatel-16/pippa-ai-agent

## Overview

Pippa is a Streamlit conversational assistant. Its main workflow accepts a user message, streams it through a LangChain agent backed by Groq, optionally searches Google via Serper, and displays the generated response. The app also keeps conversation checkpoints in a session-held LangGraph in-memory saver and renders its own message history. The graph reflects the documented architecture and the sampled apps.py; it does not infer additional subsystems from dependencies or unsampled files.

Main entry points: [`apps.py`](https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py) (LangChain agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Chat interface"]
  node_streamlit["Streamlit chat UI<br/>[apps.py]"]
  node_history["Session message history<br/>[apps.py]"]
end

subgraph group_agent["Agent runtime"]
  node_agent["LangChain agent<br/>[apps.py]"]
  node_search_tool["Google search tool<br/>[apps.py]"]
  node_streaming["Response streaming<br/>[apps.py]"]
end

subgraph group_integrations["External services"]
  node_groq["Groq LLM"]
  node_serper["Google Serper API"]
end

subgraph group_memory["Conversation state"]
  node_checkpoint[("In-memory checkpoint saver<br/>[apps.py]")]
end

node_user(("User"))

node_user -->|"enters message"| node_streamlit
node_streamlit -->|"submits query"| node_agent
node_agent -->|"requests model"| node_groq
node_agent -->|"invokes when needed"| node_search_tool
node_search_tool -->|"sends search query"| node_serper
node_agent -->|"saves checkpoints"| node_checkpoint
node_agent -->|"streams response"| node_streaming
node_streaming -->|"renders chunks"| node_streamlit
node_streamlit -->|"renders and updates"| node_history

click node_streamlit "https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py"
click node_history "https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py"
click node_agent "https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py"
click node_search_tool "https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py"
click node_streaming "https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py"
click node_checkpoint "https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.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_streamlit,node_history,node_user toneBlue
class node_agent,node_search_tool,node_streaming toneAmber
class node_groq,node_serper toneMint
class node_checkpoint toneRose
```

## Components

### Chat interface

- [Streamlit chat UI](https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py): `apps.py`
- [Session message history](https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py): `apps.py`

### Agent runtime

- [LangChain agent](https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py): `apps.py`
- [Google search tool](https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py): `apps.py`
- [Response streaming](https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py): `apps.py`

### External services

- **Groq LLM**
- **Google Serper API**

### Conversation state

- [In-memory checkpoint saver](https://github.com/avanipatel-16/pippa-ai-agent/blob/main/apps.py): `apps.py`

### Other components

- **User**

## Connections

- User → Streamlit chat UI: enters message (evidence: `README.md`)
- Streamlit chat UI → LangChain agent: submits query (evidence: `apps.py`)
- LangChain agent → Groq LLM: requests model (evidence: `README.md`)
- LangChain agent → Google search tool: invokes when needed (evidence: `apps.py`)
- Google search tool → Google Serper API: sends search query (evidence: `apps.py`)
- LangChain agent → In-memory checkpoint saver: saves checkpoints (evidence: `README.md`)
- LangChain agent → Response streaming: streams response (evidence: `apps.py`)
- Response streaming → Streamlit chat UI: renders chunks (evidence: `apps.py`)
- Streamlit chat UI → Session message history: renders and updates (evidence: `apps.py`)
