A Retrieval-Augmented Generation (RAG) web service built with FastAPI, following modern Python best practices.
- FastAPI-based REST API for RAG operations
- Configuration management with pydantic
- Logging with loguru
- Testing with pytest
- Code quality tools (black, flake8, mypy)
- CI/CD ready
- Pre-commit hooks
- Docker support
- Python 3.8+
- Poetry
- Clone the repository:
git clone <repository-url>
cd basic-rag
- Install dependencies:
poetry install
- Set up pre-commit hooks:
poetry run pre-commit install
- Create
.env
file:
cp .env.example .env
- Run the development server:
poetry run uvicorn app.main:app --reload
- Visit the API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Run tests:
poetry run pytest
Run tests with coverage:
poetry run pytest --cov=app tests/
.
├── app/
│ ├── api/ # API routes
│ ├── core/ # Core functionality
│ ├── schemas/ # Pydantic models
│ └── services/ # Business logic
├── tests/ # Test files
├── docs/ # Documentation
├── .env # Environment variables
├── .pre-commit-config.yaml
├── pyproject.toml # Project dependencies
└── README.md
This project is licensed under the terms of the MIT license.