A Retrieval-Augmented Generation (RAG) system specialized for COSENTYX medication information using Groq LLM and Qdrant vector database.
rag_system/
├── config/
│ ├── crawler.yaml # Crawler configuration
│ └── llm.yaml # LLM model settings
├── data/
│ └── headings.json # Topic headings for context
├── src/
│ ├── crawler/ # Web crawler implementation
│ ├── utils/ # Utility functions
│ └── vector_db/ # Qdrant database setup
└── scripts/
├── run_api.py # RAG chat interface
└── run_crawler.py # Document ingestion
- Topic-aware responses using predefined medical topics
- Document crawling and processing for PDF and web content
- Vector similarity search using Qdrant
- Interactive chat interface using phi-playground
- Structured response format with confidence scoring
- Install dependencies:
poetry install- Set up environment variables in
.env:
GROQ_API_KEY=your_groq_api_key
QDRANT_API_KEY=your_qdrant_api_key
QDRANT_URL=your_qdrant_url
- Configure settings in
config/:
crawler.yaml: Set collection name and crawl depthllm.yaml: Configure LLM model and parameters
- Crawl and index documents:
python scripts/run_crawler.py- Start the RAG chat interface:
python scripts/run_api.py- Access the chat interface at: http://localhost:7777
The system provides structured responses:
Topic Check: [Topic relevance]
Answer: [Detailed response]
Sources: [Reference sources]
Confidence: [0.0-1.0 score]
max_depth: 3
collection_name: "cons_dummy2"model_id: "deepseek-r1-distill-llama-70b"
temperature: 0.1
max_tokens: 2048- phi-agent: For LLM integration and playground
- Groq: LLM provider
- Qdrant: Vector database
- SentenceTransformers: Text embeddings
- The system is specifically designed for COSENTYX medication information
- Only responds to topics present in headings.json
- Uses structured topic checking for relevant responses