ServerDatabase
Database Seeding (Indian Food & Prices)
Overview of the database seeding mechanism using the Indian Food Dataset CSV and initial costs.
Database Seeding (Indian Food & Prices)
This section explains the ingestion process for seeding the ForkFit database with standard Indian recipe and nutrition datasets, pricing structures, and RAG search embeddings.
Ingestion script: seed_database.py
Source datasets:
- IndianFoodDatasetCSV.csv (16,500+ Indian recipe records)
- initial_food_costs.json (Base food item price listings)
1. Raw Seeding Datasets
The raw data is stored in the following source files:
initial_food_costs.json: Key-value listing mapping food name patterns (e.g.'paneer') to baseline costs per 100 grams.IndianFoodDatasetCSV.csv: Contains details of ingredients, cuisines, preparation times, instructions, courses, and source URLs for thousands of Indian recipes.
2. Ingestion Flow
The Python ingestion script performs the following operations inside a single transactional block:
Environment Configuration
The script reads connection parameters from a .env file loaded from the path directories:
DATABASE_URL: PostgreSQL connection string.CSV_PATH: Path to the raw recipes CSV.OLLAMA_HOST/OLLAMA_BASE_URL: Base address of your local Ollama server (for generating text embeddings).EMBEDDING_MODEL: Name of the text embedding model (e.g.,'nomic-embed-text').
3. How to Run the Seeding Script
Make sure you have your virtual environment activated and dependencies installed, then run the python script:
# Ensure environment variables are loaded or declare them inline
python server/intelligence/scripts/seed_database.py