Skip to content

Weaviate RAG Demo πŸ—„οΈ

A comprehensive demonstration of SuperOptiX's RAG capabilities using Weaviate vector database for advanced semantic search and knowledge retrieval.

Overview

This demo showcases how to integrate Weaviate - a powerful vector database - with SuperOptiX's RAG system to create intelligent agents capable of retrieving and synthesizing information from large knowledge bases.

This demo demonstrates:

πŸ” Weaviate Vector Database Integration - Seamless connection to Weaviate for high-performance vector storage

🧠 Advanced Semantic Search - Intelligent retrieval using Weaviate's sophisticated similarity algorithms

πŸ“š Knowledge Base Management - Efficient document storage, indexing, and retrieval workflows

⚑ Real-time Query Processing - Fast response times with Weaviate's optimized search capabilities

πŸ”„ RAG Pipeline Integration - Complete retrieval-augmented generation workflow

Prerequisites

1. Install SuperOptiX

Bash
pip install superoptix

2. Install Weaviate Dependencies

Bash
pip install weaviate-client

3. Set Up Weaviate Server

Bash
# Using Docker (recommended)
docker run -d \
  --name weaviate \
  -p 8080:8080 \
  -e QUERY_DEFAULTS_LIMIT=25 \
  -e AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
  -e PERSISTENCE_DATA_PATH='/var/lib/weaviate' \
  -e DEFAULT_VECTORIZER_MODULE='none' \
  -e ENABLE_MODULES='text2vec-transformers' \
  -e TRANSFORMERS_INFERENCE_API='http://t2v-transformers:8080' \
  semitechnologies/weaviate:1.22.4

4. Install and Serve Model

Bash
# Install a model (if not already installed)
super model install llama3.1:8b

# Start Ollama server (if using Ollama backend)
ollama serve

Quick Start

1. Pull the Demo Agent

Bash
super agent pull rag_weaviate_demo

2. Compile the Agent

Bash
super agent compile rag_weaviate_demo

3. Run the Demo

Bash
super agent run rag_weaviate_demo --goal "What is the SuperOptiX framework and its key features?"

Key Configuration Points:

πŸ”§ Vector Database Setup - Configured to connect to Weaviate at http://localhost:8080

πŸ“Š Collection Management - Uses SuperOptiXKnowledge class for document storage

🎯 Embedding Model - Leverages sentence-transformers/all-MiniLM-L6-v2 for vector generation

βš™οΈ Search Parameters - Optimized with top_k: 5 and similarity_threshold: 0.7

Playbook Configuration

The demo uses a specialized playbook with Weaviate-specific configurations:

YAML
rag:
  enabled: true
  retriever_type: weaviate
  config:
    top_k: 5
    chunk_size: 512
    chunk_overlap: 50
    similarity_threshold: 0.7
  vector_store:
    embedding_model: sentence-transformers/all-MiniLM-L6-v2
    url: http://localhost:8080
    class_name: SuperOptiXKnowledge

Customization

Modify Weaviate Connection

YAML
vector_store:
  url: http://your-weaviate-server:8080
  class_name: YourCustomClass
  auth_token: your-auth-token  # If using authentication

Adjust Search Parameters

YAML
config:
  top_k: 10  # Retrieve more documents
  similarity_threshold: 0.8  # Higher similarity threshold
  chunk_size: 1024  # Larger chunks

Add Custom Schema

YAML
vector_store:
  schema:
    properties:
      - name: content
        dataType: text
      - name: metadata
        dataType: object

Troubleshooting

Connection Issues

  • Error: "Connection refused"
  • Solution: Ensure Weaviate server is running on port 8080
  • Check: curl http://localhost:8080/v1/.well-known/ready

Client Version Issues

  • Error: "Client.init() takes 1 positional argument but 2 were given"
  • Solution: Update to Weaviate client v4: pip install weaviate-client>=4.0.0

Performance Issues

  • Slow queries: Reduce top_k or increase similarity_threshold
  • Memory issues: Adjust chunk_size and chunk_overlap

Use Cases

πŸŽ“ Academic Research - Large-scale document analysis and citation retrieval

🏒 Enterprise Search - Corporate knowledge base with semantic understanding

πŸ“° Content Management - Intelligent article and document organization

πŸ”¬ Scientific Literature - Research paper discovery and analysis


Ready to explore the power of Weaviate with SuperOptiX? πŸš€

Start with this demo to understand how vector databases can enhance your AI applications with intelligent knowledge retrieval and semantic search capabilities.