Lawrence is a co‑pilot that automates the requirements‑engineering workflow for software Product Owners and managers.
It uses AI to transform vague feature ideas into well‑structured specifications, and generates helpful documentation.
This project provides a REST API that:
- Accepts a software feature description.
- Generates clarifying questions if the feature is vague.
- Updates the feature details and pending questions.
- Maintains conversation context for iterative refinement.
- Generates a feature overview including:
- Feature description
- Acceptance criteria
- Backend tickets needed
- Frontend tickets needed
- Endpoint to export the complete feature overview documentation as Markdown or PDF.
The frontend is a separate project that provides a user interface for interacting with the Lawrence backend. It allows users to submit feature descriptions, view generated questions, and manage feature specifications.
You can find the frontend project here: Lawrence UI
- Python: 3.12
- Ollama: Installed and running with the follwing models:
mistral:latest
(Advanced 7B model with enhanced reasoning)phi3:latest
(Lightweight 3B fast model for quick responses)
Follow these steps to set up and run Lawrence locally.
python3.12 -m venv venv
Expected output: Creates an isolated Python environment in /lawrence/venv
.
Activates the virtual environment, updating your shell to use the isolated Python.
source venv/bin/activate
Expected output: Prompt changes to (venv) user@machine:~/lawrence$
.
pip install -r requirements.txt
What it does: Installs project dependencies (FastAPI, LangChain, etc.) listed in requirements.txt
.
python -m src.main
What it does: Starts the FastAPI server on http://localhost:8000
.
Lawrence uses a comprehensive testing framework to ensure code quality and reliability.
- pytest: Main testing framework
- pytest-asyncio: Async test support
- pytest-mock: Mocking utilities
- pytest-cov: Code coverage reporting
- httpx: HTTP client for API testing
- factory-boy: Test data factories
PYTHONPATH=. python run_tests.py
What it does: Runs the complete test suite with coverage reporting.
PYTHONPATH=. python run_tests.py unit
What it does: Runs only unit tests for faster feedback during development.
PYTHONPATH=. python run_tests.py integration
What it does: Runs only integration tests to verify API endpoints and service interactions.
PYTHONPATH=. pytest tests/ -v
What it does: Runs all tests with verbose output using pytest directly.
PYTHONPATH=. pytest tests/ -v --cov=src --cov-report=term-missing --cov-report=html:htmlcov
What it does: Runs tests with detailed coverage reporting in terminal and HTML format.
- Unit Tests (
tests/unit/
): Test individual functions and classes - Integration Tests (
tests/integration/
): Test API endpoints and service interactions - Fixtures (
tests/conftest.py
): Shared test data and mocks
After running tests, coverage reports are generated in:
htmlcov/
: HTML coverage reportcoverage.xml
: XML coverage report for CI tools
You can collaborate with me giving a star ⭐️ to the project or
Thanks! 😃