Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,55 @@ Generates file: `knowledge_base/history.md`
- Always activate the virtual environment before using the tool: `source venv/bin/activate`
- Never delete a test case — change the state to `Blocked` if no longer applicable
- Update `roadmap.md` whenever a step is completed
- The `venv/` folder should not be shared or pushed to Git
- The `venv/` folder should not be shared or pushed to Git


## Changelog

- 2026-06-30 — Initial project setup

## Requirements

> Already listed above, but for AI integration add:
- [Ollama](https://ollama.com) installed and running
- Llama 3.2 model pulled locally

## AI Integration Setup

**1. Install Ollama:**
```bash
curl -fsSL https://ollama.com/install.sh | sh
```

**2. Start the Ollama server:**
```bash
ollama serve
```

**3. Pull the Llama 3.2 model:**
```bash
ollama pull llama3.2
```

**4. Install the Python Ollama library:**
```bash
pip install ollama
```

> Note: The `ollama serve` terminal must remain active while using the `ask` command.

## AI Command

### 🤖 Ask the AI agent a question
```bash
python agent/cli.py ask "Your question here"
```

The agent reads the entire Knowledge Base (test cases, roadmap, guidelines) before answering, ensuring responses are always contextualised to your project.

**Examples:**
```bash
python agent/cli.py ask "What should I test next?"
python agent/cli.py ask "What test cases do we have for the Login module?"
python agent/cli.py ask "What are the team guidelines for automation?"
```
44 changes: 44 additions & 0 deletions agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,5 +227,49 @@ def export_tests_history():

click.echo(f"\n✅ Test cases history exported to knowledge_base/test_cases_history.md\n")

# Command: ask a question to the AI agent
@cli.command()
@click.argument("question")
def ask(question):
"""Ask a question to the AI agent based on the Knowledge Base."""
import ollama

# Load knowledge base context
with open(TEST_CASES_PATH, "r") as f:
test_cases = json.load(f)

roadmap_path = os.path.join(BASE_DIR, "knowledge_base", "roadmap", "roadmap.md")
with open(roadmap_path, "r") as f:
roadmap = f.read()

guidelines_path = os.path.join(BASE_DIR, "knowledge_base", "guidelines", "guidelines.md")
with open(guidelines_path, "r") as f:
guidelines = f.read()

# Build context
context = f"""
You are a QA assistant. Answer based only on the following project information:

TEAM ROADMAP:
{roadmap}

QA GUIDELINES:
{guidelines}

TEST CASES:
{json.dumps(test_cases, indent=2)}

Answer the following question: {question}
"""

click.echo("\n🤖 Thinking...\n")

response = ollama.chat(
model="llama3.2",
messages=[{"role": "user", "content": context}]
)

click.echo(f"{response['message']['content']}\n")

if __name__ == "__main__":
cli()