# kavya12024/logicflow architecture

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

- Interactive diagram: https://gitdiagram.com/kavya12024/logicflow
- Repository: https://github.com/kavya12024/logicflow

## Overview

LogicFlow is an autonomous code-repair agent. Users start repairs through the CLI or Streamlit dashboard; the agent detects failures, narrows the target with AST analysis, retrieves optional code context, asks a local LLM for a surgical fix, verifies it, and can publish a GitHub pull request. The graph preserves indexing and GitHub issue workflows as additional capabilities. Relationships are grounded mainly in the README’s architecture and workflow descriptions; unsampled implementation details are not inferred.

Main entry points: [`agents/core.py`](https://github.com/kavya12024/logicflow/blob/main/agents/core.py) (Repair Agent), [`main.py`](https://github.com/kavya12024/logicflow/blob/main/main.py) (CLI), [`tools/docker_test_tool.py`](https://github.com/kavya12024/logicflow/blob/main/tools/docker_test_tool.py) (Test Sandbox), [`tools/faiss_tool.py`](https://github.com/kavya12024/logicflow/blob/main/tools/faiss_tool.py) (Code Index and Retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_cli["CLI<br/>[main.py]"]
  node_dashboard["Streamlit Dashboard<br/>[streamlit_app.py]"]
end

subgraph group_repair["Repair Orchestration"]
  node_config["Configuration<br/>[config.py]"]
  node_agent["Repair Agent<br/>[core.py]"]
end

subgraph group_tools["Analysis and Verification"]
  node_ast["AST Slicing and Splicing<br/>[ast_tool.py]"]
  node_sandbox["Test Sandbox"]
  node_indexer["Code Index and Retrieval<br/>[faiss_tool.py]"]
  node_github["GitHub Issue and PR Manager<br/>[github_tool.py]"]
end

subgraph group_integrations["External Services and Data"]
  node_workspace["Repair Workspace"]
  node_ollama["Ollama LLM"]
  node_faissdata[("Persisted FAISS Index")]
  node_docker["Docker"]
  node_githubservice["GitHub"]
end

node_user(("User"))

node_user -->|"starts command"| node_cli
node_user -->|"uses dashboard"| node_dashboard
node_cli -->|"starts repair"| node_agent
node_dashboard -->|"runs workflows"| node_agent
node_cli -->|"builds index"| node_indexer
node_agent -->|"loads settings"| node_config
node_agent -->|"runs tests"| node_sandbox
node_agent -->|"slices and splices"| node_ast
node_agent -->|"retrieves context"| node_indexer
node_agent -->|"requests repair"| node_ollama
node_agent -->|"processes issues"| node_github
node_sandbox -->|"tests code"| node_workspace
node_agent -->|"repairs code"| node_workspace
node_indexer -->|"persists index"| node_faissdata
node_sandbox -.->|"runs isolated tests"| node_docker
node_github -->|"fetches issues and publishes PRs"| node_githubservice

click node_cli "https://github.com/kavya12024/logicflow/blob/main/main.py"
click node_dashboard "https://github.com/kavya12024/logicflow/blob/main/dashboard/streamlit_app.py"
click node_config "https://github.com/kavya12024/logicflow/blob/main/config.py"
click node_agent "https://github.com/kavya12024/logicflow/blob/main/agents/core.py"
click node_ast "https://github.com/kavya12024/logicflow/blob/main/tools/ast_tool.py"
click node_sandbox "https://github.com/kavya12024/logicflow/blob/main/tools/docker_test_tool.py"
click node_indexer "https://github.com/kavya12024/logicflow/blob/main/tools/faiss_tool.py"
click node_github "https://github.com/kavya12024/logicflow/blob/main/tools/github_tool.py"
click node_workspace "https://github.com/kavya12024/logicflow/tree/main/workspace/logicflow-test-repo"
click node_faissdata "https://github.com/kavya12024/logicflow/tree/main/faiss_index"

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_dashboard,node_user toneBlue
class node_config,node_agent toneAmber
class node_ast,node_sandbox,node_indexer,node_github toneMint
class node_workspace,node_ollama,node_faissdata,node_docker,node_githubservice toneRose
```

## Components

### User Interfaces

- [CLI](https://github.com/kavya12024/logicflow/blob/main/main.py): `main.py`
- [Streamlit Dashboard](https://github.com/kavya12024/logicflow/blob/main/dashboard/streamlit_app.py): `dashboard/streamlit_app.py`

### Repair Orchestration

- [Configuration](https://github.com/kavya12024/logicflow/blob/main/config.py): `config.py`
- [Repair Agent](https://github.com/kavya12024/logicflow/blob/main/agents/core.py): `agents/core.py`

### Analysis and Verification

- [AST Slicing and Splicing](https://github.com/kavya12024/logicflow/blob/main/tools/ast_tool.py): `tools/ast_tool.py`
- [Test Sandbox](https://github.com/kavya12024/logicflow/blob/main/tools/docker_test_tool.py): `tools/docker_test_tool.py`
- [Code Index and Retrieval](https://github.com/kavya12024/logicflow/blob/main/tools/faiss_tool.py): `tools/faiss_tool.py`
- [GitHub Issue and PR Manager](https://github.com/kavya12024/logicflow/blob/main/tools/github_tool.py): `tools/github_tool.py`

### External Services and Data

- [Repair Workspace](https://github.com/kavya12024/logicflow/tree/main/workspace/logicflow-test-repo): `workspace/logicflow-test-repo`
- **Ollama LLM**
- [Persisted FAISS Index](https://github.com/kavya12024/logicflow/tree/main/faiss_index): `faiss_index`
- **Docker**
- **GitHub**

### Other components

- **User**

## Connections

- User → CLI: starts command (evidence: `README.md`)
- User → Streamlit Dashboard: uses dashboard (evidence: `README.md`)
- CLI → Repair Agent: starts repair (evidence: `main.py`)
- Streamlit Dashboard → Repair Agent: runs workflows (evidence: `dashboard/streamlit_app.py`)
- CLI → Code Index and Retrieval: builds index (evidence: `main.py`)
- Repair Agent → Configuration: loads settings (evidence: `agents/core.py`)
- Repair Agent → Test Sandbox: runs tests (evidence: `README.md`)
- Repair Agent → AST Slicing and Splicing: slices and splices (evidence: `README.md`)
- Repair Agent → Code Index and Retrieval: retrieves context (evidence: `README.md`)
- Repair Agent → Ollama LLM: requests repair (evidence: `README.md`)
- Repair Agent → GitHub Issue and PR Manager: processes issues (evidence: `README.md`)
- Test Sandbox → Repair Workspace: tests code (evidence: `README.md`)
- Repair Agent → Repair Workspace: repairs code (evidence: `README.md`)
- Code Index and Retrieval → Persisted FAISS Index: persists index (evidence: `README.md`)
- Test Sandbox → Docker: runs isolated tests (evidence: `README.md`)
- GitHub Issue and PR Manager → GitHub: fetches issues and publishes PRs (evidence: `README.md`)
