How balanandakumar05-cyber/ayurnex works
AYURNEX is an Ayurveda knowledge assistant: a user selects country and language, asks a question in the React app, and receives a generated answer with source metadata. The API routes requests into a retrieval-augmented answering service; retrieval embeds the question and searches PostgreSQL/pgvector before generation. A separate ingestion workflow turns PDF documents into searchable chunks. The graph preserves the documented frontend, API, RAG, storage, and ingestion capabilities. Some ingestion helpers and backend wiring are not excerpted, so those relationships are limited to source-index references or documented behavior.
Main entry points: ingest.py PDF ingestion · rag_pipeline.py Answer pipeline · retriever.py Chunk retriever · chat.py Chat endpoint
Components 20
User interface
- Chat interface
src/App.jsx - API client
src/services/api.js
API services
- Chat endpoint
backend/routes/chat.py - Chat schemas
backend/schemas/chat.py - Answer service
backend/services/rag_service.py - API application
backend/main.py
Knowledge processing
- Answer pipeline
backend/rag/rag_pipeline.py - Prompt builder
backend/rag/prompts.py - Chunk retriever
backend/rag/retriever.py - Text embeddings
backend/rag/embeddings.py - PDF ingestion
backend/rag/ingest.py - PDF extraction
backend/rag/pdf_loader.py - Text cleaning
backend/rag/text_cleaner.py - Chunk creation
backend/rag/chunker.py - RAG settings
backend/rag/config.py
Knowledge storage
- Vector database access
backend/rag/database.py - PostgreSQL pgvector
- PDF knowledge base
data/documents
Other components
- Question asker
- Gemini generation
Connections 22
- Question asker → Chat interface: asks question
src/App.jsx - Chat interface → API client: submits question
src/App.jsx - API client → API application: POST /chat
src/services/api.js - API application → Chat endpoint: registers route
backend/main.py - Chat endpoint → Chat schemas: validates request
backend/routes/chat.py - Chat endpoint → Answer service: calls service
backend/routes/chat.py - Answer service → Answer pipeline: requests answer
backend/services/rag_service.py - Answer pipeline → Chunk retriever: retrieves chunks
backend/rag/rag_pipeline.py - Answer pipeline → Prompt builder: builds prompt
backend/rag/rag_pipeline.py - Answer pipeline → Gemini generation: generates answer
- Chunk retriever → Text embeddings: embeds query
backend/rag/retriever.py - Chunk retriever → Vector database access: matches chunks
backend/rag/retriever.py - Vector database access → PostgreSQL pgvector: queries and stores
backend/rag/database.py - PDF ingestion → PDF knowledge base: scans PDFs
backend/rag/ingest.py - PDF ingestion → PDF extraction: extracts pages
backend/rag/ingest.py - PDF ingestion → Text cleaning: cleans text
backend/rag/ingest.py - PDF ingestion → Chunk creation: creates chunks
backend/rag/ingest.py - PDF ingestion → Text embeddings: embeds chunks
backend/rag/ingest.py - PDF ingestion → Vector database access: writes chunks
backend/rag/ingest.py - PDF ingestion → RAG settings: uses settings
backend/rag/ingest.py - Chunk retriever → RAG settings: uses settings
backend/rag/retriever.py - Answer service → Chat schemas: builds response
backend/services/rag_service.py