How yatinannam/veyl works
Veyl is a permission-aware, multi-tenant document Q&A product. Users sign in, upload classified documents, and ask questions; the backend ingests documents, filters retrieval by tenant and permissions, generates answers only from authorized passages, verifies citations, and audits activity. The graph includes dashboard, identity, document, retrieval, and governance capabilities. Relationships use the supplied source index and excerpts plus explicit README statements; unsampled internals are not assumed beyond those references.
Main entry points: service.py Answer orchestration · pipeline.py Extraction and chunking · search.py Permission-filtered search · api.ts Browser API client
Components 28
User dashboard
- Web dashboard
frontend/src/app/(app)/chat/page.tsx - Browser API client
frontend/src/lib/api.ts
Identity and access
- Sign-in routes
backend/app/auth/router.py - Session service
backend/app/auth/service.py - Session dependencies
backend/app/auth/deps.py - Authorization policy
backend/app/authz/policy.py
Document lifecycle
- Document routes
backend/app/documents/router.py - Document management
backend/app/documents/service.py - Original file storage
backend/app/documents/storage.py - Ingestion worker
backend/app/worker.py - Extraction and chunking
backend/app/ingestion/pipeline.py - Text extraction
backend/app/ingestion/extract.py - Text chunking
backend/app/ingestion/chunker.py
Secure answers
- Question routes
backend/app/rag/router.py - Answer orchestration
backend/app/rag/service.py - Permission-filtered search
backend/app/retrieval/search.py - Local embeddings
backend/app/retrieval/embeddings.py - Prompt construction
backend/app/llm/prompt.py - LLM provider client
backend/app/llm/client.py - Citation verification
backend/app/llm/citations.py - Conversation history
backend/app/conversations/service.py
Tenant governance
- Tenant management
backend/app/tenants/router.py - User management
backend/app/users/service.py - Append-only audit
backend/app/audit/service.py - Tenant transactions
backend/app/db/tenancy.py - PostgreSQL and pgvector
backend/app/db/schema.py
Other components
- Workspace users
- Compatible LLM provider
Connections 39
- Workspace users → Web dashboard: use
README.md - Web dashboard → Browser API client: makes requests
- Browser API client → Sign-in routes: calls API
- Browser API client → Document routes: calls API
- Browser API client → Question routes: calls API
- Sign-in routes → Session service: delegates to
backend/app/auth/router.py - Session dependencies → Session service: resolves session
backend/app/auth/deps.py - Workspace users → Document routes: upload documents
- Document routes → Document management: delegates to
backend/app/documents/router.py - Document routes → Original file storage: stores uploads
backend/app/documents/router.py - Document management → Original file storage: uses storage
backend/app/documents/service.py - Document management → Authorization policy: checks permissions
backend/app/documents/service.py - Ingestion worker → Extraction and chunking: runs ingestion
README.md - Extraction and chunking → Text extraction: extracts text
backend/app/ingestion/pipeline.py - Extraction and chunking → Text chunking: chunks text
backend/app/ingestion/pipeline.py - Extraction and chunking → Original file storage: reads originals
backend/app/ingestion/pipeline.py - Extraction and chunking → Local embeddings: embeds chunks
backend/app/ingestion/pipeline.py - Workspace users → Question routes: ask questions
- Question routes → Answer orchestration: calls
backend/app/rag/router.py - Answer orchestration → Authorization policy: authorizes query
backend/app/rag/service.py - Answer orchestration → Permission-filtered search: retrieves passages
backend/app/rag/service.py - Permission-filtered search → Authorization policy: checks access
backend/app/retrieval/search.py - Permission-filtered search → Local embeddings: embeds query
backend/app/retrieval/search.py - Answer orchestration → Conversation history: loads history
backend/app/rag/service.py - Conversation history → Permission-filtered search: rechecks readability
backend/app/conversations/service.py - Answer orchestration → Prompt construction: builds prompt
backend/app/rag/service.py - Prompt construction → LLM provider client: formats messages
backend/app/llm/prompt.py - Answer orchestration → LLM provider client: generates answer
backend/app/rag/service.py - LLM provider client → Compatible LLM provider: sends completion
backend/app/llm/client.py - Answer orchestration → Citation verification: verifies citations
backend/app/rag/service.py - Tenant management → Tenant transactions: sets tenant scope
backend/app/tenants/router.py - User management → Authorization policy: uses roles
backend/app/users/service.py - Answer orchestration → Append-only audit: records questions
backend/app/rag/service.py - Document management → Append-only audit: records changes
backend/app/documents/service.py - Session service → Append-only audit: records sign-ins
backend/app/auth/service.py - Append-only audit → PostgreSQL and pgvector: writes events
backend/app/audit/service.py - Tenant transactions → PostgreSQL and pgvector: scopes transactions
backend/app/db/tenancy.py - Permission-filtered search → PostgreSQL and pgvector: queries passages
backend/app/retrieval/search.py - Answer orchestration → PostgreSQL and pgvector: persists answers
backend/app/rag/service.py