Skip to content

πŸŽ“ A FastAPI-powered semantic search API for CSUF course catalog, enabling intelligent course discovery through natural language queries

License

Notifications You must be signed in to change notification settings

clxmente/tuffysearch-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TuffySearch API πŸŽ“

Python Version License: MIT FastAPI LangChain

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.

✨ Features

  • πŸ” 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

πŸ› οΈ Technologies

  • 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

πŸš€ Getting Started

Prerequisites

  • Python 3.12 or higher
  • Docker (optional, for containerized deployment)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/tuffysearch-api.git
cd tuffysearch-api
  1. Install dependencies using uv:
uv sync
  1. Run the setup script to create embeddings:
uv run setup_embeddings.py
  1. Start the API server:
uv run fastapi dev main.py

Docker Deployment

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

πŸ“š API Documentation

Once the server is running, visit:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Example Request

curl -X GET "http://localhost:8000/search?q=income%20inequality&min_level=100&max_level=400"

πŸ“ License

This project is licensed under the MIT License

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

About

πŸŽ“ A FastAPI-powered semantic search API for CSUF course catalog, enabling intelligent course discovery through natural language queries

Topics

Resources

License

Stars

Watchers

Forks