This project demonstrates how to set up Weaviate locally using Docker and integrate Ollama for vector embeddings and inference. It utilizes Node.js to perform semantic and generative (RAG) search for book recommendations.
This project showcases how Weaviate & Ollama power intelligent book recommendations through semantic search and generative AI (RAG).

Run Weaviate locally using Docker Compose:
docker-compose -f docker-compose.yml up -d
🔹 Note: The current docker-compose.yml
includes Ollama modules only. If you need a different vectorizer, update the configuration:
🔗 Weaviate Docker Installation Guide
Download Ollama for your OS: Ollama Official Site
Then pull the required models:
ollama pull nomic-embed-text:latest # For embeddings
ollama pull llama3.2:latest # For inference
Install dependencies:
npm i
Then execute each step to understand how Weaviate & Ollama interact.
node 1-createCollection.ts
🔹 Sets up a "Book" collection in Weaviate.
🔹 Configures Ollama for embedding (nomic-embed-text
) and generative tasks (llama3.2
).
node 2-populateCollection.ts
🔹 Loads book data into Weaviate using a Kaggle dataset.
node 3-semanticSearch.ts
🔹 Performs semantic search to find books similar to a query using vector embeddings.
node 4-generativeSearch.ts
🔹 Retrieves relevant books via semantic search.
🔹 Uses LLM-powered generation (llama3.2
) to synthesize responses.
✅ Understands meaning & context, not just keywords.
✅ Uses vector embeddings to find conceptually similar books.
✅ Ideal for queries like:
- "Find books similar to X".
- "Search for books about lost identity".
🔸 Limitations:
- Returns existing data (doesn’t generate new answers).
- Effectiveness depends on embedding quality.
✅ Retrieves relevant documents using semantic search.
✅ Passes them to LLM (Ollama's llama3.2
) to generate a human-like response.
✅ Ideal for:
- Summarizing book content
- Answering questions about books
- Generating recommendations
🔸 Limitations:
- Slower due to the additional LLM generation step.
- Context-dependent: Poor document retrieval leads to less accurate results ("garbage in, garbage out").
- Computationally intensive compared to semantic search alone.
- Optimized for natural language (book titles, summaries, reviews).
- Excels in semantic similarity tasks.
- Tuned for structured enterprise data (logs, financial docs).
- Less effective in capturing literary & thematic meaning.
- Suitable only for metadata-based queries (e.g., "Books by Stephen King after 2000").
