A powerful semantic search API for the California State University, Fullerton course catalog. TuffySearch enables intelligent course discovery through natural language queries, making it easier for students to find relevant courses based on their interests and requirements. Built with FastAPI and powered by HuggingFace's sentence-transformers/all-MiniLM-L6-v2
model for embeddings, the API uses FAISS (via LangChain) as an in-memory vector database for lightning-fast similarity search across the entire course catalog.
- π Semantic Search: Find courses using natural language queries
- π― Course Level Filtering: Filter results by course level (100-599)
- β‘ Rate Limiting: 100 requests per hour per IP
- π Fast Performance: Built with FastAPI and FAISS for efficient vector search
- π€ Advanced Embeddings: Powered by HuggingFace's sentence-transformers
- FastAPI: Modern, fast web framework for building APIs
- LangChain: Framework for developing applications powered by language models
- FAISS: Library for efficient similarity search
- HuggingFace Embeddings: State-of-the-art sentence embeddings
- Docker: Containerization for easy deployment
- Python 3.12 or higher
- Docker (optional, for containerized deployment)
- Clone the repository:
git clone https://github.com/yourusername/tuffysearch-api.git
cd tuffysearch-api
- Install dependencies using uv:
uv sync
- Run the setup script to create embeddings:
uv run setup_embeddings.py
- Start the API server:
uv run fastapi dev main.py
Build and run using Docker:
docker build -t tuffysearch-api .
docker run -p 80:80 tuffysearch-api --restart=always
# OR with compose
docker compose up -d --build
Once the server is running, visit:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
curl -X GET "http://localhost:8000/search?q=income%20inequality&min_level=100&max_level=400"
This project is licensed under the MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request