# carol-here/testcase-generation-using-rag-based-ai architecture

> Architecture diagram of the GitHub repository carol-here/testcase-generation-using-rag-based-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/carol-here/testcase-generation-using-rag-based-ai
- Repository: https://github.com/carol-here/testcase-generation-using-rag-based-ai

## Overview

Shiken Jirei is a Streamlit application that turns a user story into structured test cases. Its main workflow collects language and batch settings, retrieves similar examples from LanceDB, prompts an external LLM, parses the response, and displays downloadable results. The repository also documents a separate ingestion pipeline that adds embedded source documents to the vector store. Some wiring is supported only by README descriptions; unsampled implementation details are not inferred.

Main entry points: [`streamlit/streamlit_app.py`](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py) (Batch generation), [`lancedb_data/testcases.lance`](https://github.com/carol-here/testcase-generation-using-rag-based-ai/tree/main/lancedb_data/testcases.lance) (Test case index), [`llm/datapipeline.py`](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/llm/datapipeline.py) (Data ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app["Streamlit interface<br/>[streamlit_app.py]"]
  node_export["JSON / Excel export<br/>[streamlit_app.py]"]
end

subgraph group_generation["Generation workflow"]
  node_generator["Batch generation<br/>[streamlit_app.py]"]
  node_parser["Test case parser<br/>[streamlit_app.py]"]
end

subgraph group_knowledge["RAG data"]
  node_embedder["Story embedder<br/>[streamlit_app.py]"]
  node_retrieval["Context retrieval<br/>[streamlit_app.py]"]
  node_vectorstore[("Test case index<br/>[testcases.lance]")]
  node_ingestion["Data ingestion<br/>[datapipeline.py]"]
end

subgraph group_integrations["External services"]
  node_huggingface{{"Hugging Face API"}}
  node_openrouter{{"OpenRouter API"}}
end

node_user(("User"))

node_user -->|"enters story"| node_app
node_app -->|"starts generation"| node_generator
node_generator -->|"requests context"| node_retrieval
node_retrieval -->|"encodes story"| node_embedder
node_retrieval -->|"searches examples"| node_vectorstore
node_generator -->|"sends prompt"| node_huggingface
node_generator -->|"sends prompt"| node_openrouter
node_generator -->|"parses responses"| node_parser
node_app -->|"offers downloads"| node_export
node_ingestion -->|"stores embeddings"| node_vectorstore
node_generator -->|"returns test cases"| node_app

click node_app "https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py"
click node_generator "https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py"
click node_parser "https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py"
click node_export "https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py"
click node_embedder "https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py"
click node_retrieval "https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py"
click node_vectorstore "https://github.com/carol-here/testcase-generation-using-rag-based-ai/tree/main/lancedb_data/testcases.lance"
click node_ingestion "https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/llm/datapipeline.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_app,node_export,node_user toneBlue
class node_generator,node_parser toneAmber
class node_embedder,node_retrieval,node_vectorstore,node_ingestion toneMint
class node_huggingface,node_openrouter toneRose
```

## Components

### User interface

- [Streamlit interface](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py): `streamlit/streamlit_app.py`
- [JSON / Excel export](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py): `streamlit/streamlit_app.py`

### Generation workflow

- [Batch generation](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py): `streamlit/streamlit_app.py`
- [Test case parser](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py): `streamlit/streamlit_app.py`

### RAG data

- [Story embedder](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py): `streamlit/streamlit_app.py`
- [Context retrieval](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/streamlit/streamlit_app.py): `streamlit/streamlit_app.py`
- [Test case index](https://github.com/carol-here/testcase-generation-using-rag-based-ai/tree/main/lancedb_data/testcases.lance): `lancedb_data/testcases.lance`
- [Data ingestion](https://github.com/carol-here/testcase-generation-using-rag-based-ai/blob/main/llm/datapipeline.py): `llm/datapipeline.py`

### External services

- **Hugging Face API**
- **OpenRouter API**

### Other components

- **User**

## Connections

- User → Streamlit interface: enters story (evidence: `README.md`)
- Streamlit interface → Batch generation: starts generation (evidence: `streamlit/streamlit_app.py`)
- Batch generation → Context retrieval: requests context (evidence: `streamlit/streamlit_app.py`)
- Context retrieval → Story embedder: encodes story (evidence: `README.md`)
- Context retrieval → Test case index: searches examples (evidence: `streamlit/streamlit_app.py`)
- Batch generation → Hugging Face API: sends prompt (evidence: `README.md`)
- Batch generation → OpenRouter API: sends prompt (evidence: `README.md`)
- Batch generation → Test case parser: parses responses (evidence: `streamlit/streamlit_app.py`)
- Streamlit interface → JSON / Excel export: offers downloads (evidence: `README.md`)
- Data ingestion → Test case index: stores embeddings (evidence: `README.md`)
- Batch generation → Streamlit interface: returns test cases (evidence: `streamlit/streamlit_app.py`)
