How adityajaiswal5346/sourceiq works
Sourciq is an engineering-document RAG product: users sign in, ask a scoped question, and receive a confidence-scored answer with document citations. Offline ingestion parses and chunks source documents, embeds and indexes them, and registers document state; online queries enforce access and usage limits before retrieval, reranking, and answer generation. The graph includes the documented hybrid retrieval, guardrails, and observability capabilities. Some subsystem links are documented in the README rather than visible in sampled implementation excerpts.
Main entry points: generation/pipeline.py Query orchestrator · ingestion/pipeline.py Ingestion pipeline · query.py API routes · QueryInterface.tsx Query interface
Components 24
Web client
- Query interface
frontend/src/components/QueryInterface.tsx - Auth context
frontend/src/context/AuthContext.tsx - API client
frontend/src/api/client.ts
API and identity
- API routes
backend/app/api/query.py - Auth service
backend/app/auth/service.py
Document ingestion
- Ingestion entry
ingestion/ingest.py - Document parsers
ingestion/parsers - Header chunker
ingestion/chunkers/header_aware.py - Ingestion pipeline
backend/app/rag/ingestion/pipeline.py - Chunk embedder
backend/app/rag/ingestion/embedder.py - Vector indexer
backend/app/rag/ingestion/indexer.py
Query pipeline
- Query orchestrator
backend/app/rag/generation/pipeline.py - Hybrid search
backend/app/rag/retrieval/searcher.py - Cross-encoder reranker
backend/app/rag/retrieval/reranker.py - Answer generator
backend/app/rag/generation/generator.py
Persistence and integrations
- Document and response models
backend/app/core/models.py - Document registry
backend/app/db/registry.py - Pinecone index
- Postgres
- Voyage AI
- Cohere rerank
- Claude Sonnet
- Langfuse tracing
Other components
- Engineer
Connections 28
- Engineer → Query interface: asks question
README.md - Query interface → API client: submits query
frontend/src/components/QueryInterface.tsx - Auth context → API client: calls auth API
frontend/src/context/AuthContext.tsx - API client → API routes: sends API request
- API routes → Auth service: checks access
backend/app/api/query.py - Auth service → Postgres: verifies user and limits
backend/app/auth/service.py - API routes → Query orchestrator: runs query
backend/app/api/query.py - Ingestion entry → Ingestion pipeline: starts ingestion
ingestion/ingest.py - Ingestion pipeline → Document parsers: parses document
backend/app/rag/ingestion/pipeline.py - Ingestion pipeline → Header chunker: chunks parsed text
backend/app/rag/ingestion/pipeline.py - Ingestion pipeline → Chunk embedder: embeds chunks
backend/app/rag/ingestion/pipeline.py - Chunk embedder → Voyage AI: requests embeddings
backend/app/rag/ingestion/embedder.py - Ingestion pipeline → Vector indexer: upserts chunks
backend/app/rag/ingestion/pipeline.py - Vector indexer → Pinecone index: writes vectors
- Ingestion pipeline → Document registry: registers document
backend/app/rag/ingestion/pipeline.py - Document registry → Postgres: stores document state
- Query orchestrator → Chunk embedder: embeds question
backend/app/rag/generation/pipeline.py - Query orchestrator → Hybrid search: retrieves candidates
backend/app/rag/generation/pipeline.py - Hybrid search → Pinecone index: hybrid search
- Query orchestrator → Cross-encoder reranker: reranks candidates
backend/app/rag/generation/pipeline.py - Cross-encoder reranker → Cohere rerank: scores relevance
- Query orchestrator → Answer generator: generates answer
backend/app/rag/generation/pipeline.py - Answer generator → Claude Sonnet: requests completion
- Query orchestrator → Langfuse tracing: traces query
README.md - API routes → Document registry: lists documents
backend/app/api/query.py - Query orchestrator → Query interface: returns cited response
- Ingestion pipeline → Document and response models: uses pipeline models
backend/app/rag/ingestion/pipeline.py - Query orchestrator → Document and response models: uses response models
backend/app/rag/generation/pipeline.py