A semantic search system for car models using vector embeddings and LLM-powered response generation.
This project implements a vector similarity search system for car models using sentence transformers and ChromaDB. It includes capabilities to:
- Create and store vector embeddings for car model data
- Perform semantic similarity searches
- Generate contextual responses using LLMs (via Ollama)
- Python 3.x
- ChromaDB (Vector Database)
- Sentence Transformers (BAAI/bge-small-en-v1.5)
- Ollama (Local LLM integration)
- Pandas (Data handling)
- LangChain (LLM orchestration)
.
├── embeddings.py
├── query.py
├── vector_store.py
├── README.md
├── LICENSE.txt
├── requirements.txt
├── .gitignore
- Create a virtual environment:
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Install Ollama and download required model:
ollama pull deepseek-r1:1.5b- Prepare your data:
- Place your car model dataset in
train.csv - Required columns: Id, Key, Value
Run the embedding generation script:
python embeddings.pyThis will:
- Load data from train.csv
- Create vector embeddings
- Store them in ChromaDB
Use the query system:
from vector_store import VectorStore
from query import Query
# Initialize
vector_store = VectorStore("BAAI/bge-small-en-v1.5", "car_model", "Car Model Collection", "./vector_embedding")
query = Query(vector_store, "deepseek-r1:1.5b")
# Search
input_query = "aviator"
retrieved_data = query.query(input_query, 10)
# Get LLM-enhanced response
query_obj = {
"query": input_query,
"keys": retrieved_data['keys'],
"values": retrieved_data['values'],
"distances": retrieved_data['distances']
}
response = query.get_response(query_obj)The vector store can be configured with the following parameters:
hnsw_space: Vector similarity metric (default: 'cosine')hnsw_construction: HNSW construction parameter (default: 100)hnsw_search_ef: HNSW search parameter (default: 100)hnsw_M: HNSW M parameter (default: 100)
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is open-sourced under the MIT License - see the LICENSE file for details.