AI-powered product search API for e-commerce platform using FastAPI, Langchain, and FAISS.
- Natural language product search
- Vector-based similarity search
- Integration with Oracle RDB
- OpenAI-powered embeddings and LLM
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file based on.env.example
and fill in your configuration values. -
Run the application:
python main.py
The API will be available at http://localhost:8000
Once the server is running, you can access:
- Swagger UI documentation:
http://localhost:8000/docs
- ReDoc documentation:
http://localhost:8000/redoc
GET /
: Health check endpointPOST /search
: Search products using natural language query
.
├── main.py # FastAPI application
├── requirements.txt # Project dependencies
├── .env # Environment variables (create from .env.example)
└── README.md # This file
The project uses:
- FastAPI for the web framework
- Langchain for AI/ML pipeline
- FAISS for vector similarity search
- Oracle RDB for product data storage
- OpenAI for embeddings and LLM