AI-Powered Test Intelligence Assistant β Ask natural language questions about your test automation project and get answers grounded in actual test data.
Built with RAG (Retrieval-Augmented Generation). Runs 100% locally. Zero API cost.
Instead of manually searching through test reports, logs, and documentation:
β Before: AWS CLI scan β copy output β paste to AI β wait β get answer
β
After: Type question in browser β instant answer with sources
Example questions:
- "What failure codes are tracked in the system?"
- "How many test cases are automated?"
- "What environments are supported?"
- "What security tests exist?"
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TestBrain Architecture β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
YOUR TEST REPO TESTBRAIN YOU
(source data) (RAG system) (user)
ββββββββββββββ ββββββββββββββββββββ ββββββββββββ
β .md docs β β β β Browser β
β .json rpts βββindexββΊβ ChromaDB βββaskβββ localhost β
β test data β β (vector search) β β :8501 β
ββββββββββββββ β β β ββββββββββββ
β βΌ β
β Sentence-BERT β
β (embeddings) β
β β β
β βΌ β
β Ollama/Llama βββanswerββΊ
β (generation) β
ββββββββββββββββββββ
All components run LOCALLY on your machine.
No data leaves your laptop. No API keys needed.
| Component | Technology | Purpose | Cost |
|---|---|---|---|
| LLM | Ollama + Llama 3.2 (1B) | Generates natural language answers | Free |
| Embeddings | Sentence-BERT (all-MiniLM-L6-v2) | Converts text to searchable vectors | Free |
| Vector DB | ChromaDB | Stores and searches embeddings | Free |
| Framework | LangChain | Orchestrates the RAG pipeline | Free |
| UI | Streamlit | Web interface | Free |
Total cost: $0 β everything runs locally.
- Python 3.9+
- Ollama installed
# 1. Clone this repo
git clone https://github.com/vpdinesh/TestBrain.git
cd TestBrain
# 2. Create virtual environment
python3 -m venv rag_env
source rag_env/bin/activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Start Ollama and pull model
brew services start ollama # macOS
ollama pull llama3.2:1b # Downloads 1.3GB model# Step 1: Index your test documents
python3 indexer.py --path /path/to/your/test/repo
# Step 2: Launch TestBrain
streamlit run app.pyOpen http://localhost:8501 in your browser. Done!
python3 indexer.py --path /path/to/your/automation/repoTestBrain will automatically find and index:
- All
.mdfiles (documentation, test plans, guides) - All
.jsonfiles inreports/ortest-reports/directories - Test data configuration files
export TEST_REPO_PATH=/path/to/your/repo
python3 indexer.pyEdit indexer.py and modify DEFAULT_PATTERNS:
DEFAULT_PATTERNS = [
"**/*.md", # All markdown
"**/reports/*.json", # JSON reports
"**/test-results/*.xml", # JUnit XML (add parser)
"**/docs/**/*.txt", # Text docs
]After generating new test reports or adding documentation:
source rag_env/bin/activate
python3 indexer.py --path /path/to/your/repoTakes 30-60 seconds. The Streamlit app automatically picks up the new data on next query.
Documents β Chunk (1000 chars) β Embed (384-dim vectors) β Store in ChromaDB
Question β Embed β Find 5 most similar chunks β Build prompt β LLM answers
Key concepts:
- Chunking: Split large docs into small searchable pieces (like cutting a book into pages)
- Embeddings: Convert text to numbers that capture meaning (like a barcode for text)
- Vector Search: Find chunks with similar meaning to your question (not just keyword match)
- Generation: LLM reads the relevant chunks and writes a natural language answer
| Variable | Default | Description |
|---|---|---|
--path |
Current directory | Path to your test repo |
TEST_REPO_PATH |
(none) | Alternative to --path flag |
TESTBRAIN_MODEL |
llama3.2:1b |
Ollama model to use |
# Larger model (better quality, slower)
ollama pull llama3.2:3b
export TESTBRAIN_MODEL=llama3.2:3b
streamlit run app.py
# Or even larger
ollama pull llama3.1:8b
export TESTBRAIN_MODEL=llama3.1:8bTestBrain/
βββ app.py β Streamlit web UI
βββ indexer.py β Document indexer
βββ requirements.txt β Python dependencies
βββ .gitignore β Excludes env, db, cache
βββ README.md β This file
βββ screenshots/ β UI screenshots
β βββ testbrain_ui.png
βββ chroma_db/ β Generated vector database (gitignored)
| Current Limitation | Future Enhancement |
|---|---|
| Small model (1B params) | Support for larger models (7B, 13B) |
| Static indexing | Auto re-index on file changes |
| No conversation memory | Multi-turn conversations |
| Text files only | PDF, DOCX, HTML parsing |
| Single user | Team deployment with shared index |
- Fork the repo
- Create a feature branch
- Add your enhancement
- Submit a pull request
MIT License β free to use, modify, and distribute.
π TestBrain
RAG-powered Test Intelligence Assistant.
https://github.com/vpdinesh/TestBrain
Dinesh V P β Senior Automation Engineer
LinkedIn
Built as part of exploring GenAI applications in Quality Engineering.
