How anf4al/veritas works
Veritas is an enterprise, multi-tenant research workspace. Users authenticate, select an authorized company, ask natural-language questions, and receive grounded answers with citations. The backend plans bounded agent steps, invokes enterprise tools, retrieves tenant- and permission-filtered evidence, reranks candidates, and generates an answer through a configurable LLM provider. A parallel ingestion path extracts and indexes documents. Administrative, MCP, observability, and evaluation capabilities are represented separately. Some endpoint wiring and unsampled helper calls are inferred only where README capabilities and sampled module responsibilities support them.
Components 26
User Experience
- React Workspace
frontend/src/App.tsx - Session Context
frontend/src/context/AuthContext.tsx - Chat Workspace
frontend/src/components/chat/ChatWorkspace.tsx
Access and API
- FastAPI Server
backend/app/main.py - Authentication API
backend/app/api/v1/auth.py - Chat API
backend/app/api/v1/chat.py - Document API
backend/app/api/v1/documents.py - JWT and RBAC
backend/app/auth/permissions.py
Knowledge Platform
- SQLite Database
backend/app/core/database.py - Ingestion Pipeline
backend/app/ingestion/pipeline.py - Text Processing
backend/app/ingestion/chunker.py - Embedding Provider
backend/app/retrieval/embeddings.py - Tenant Vector Store
backend/app/retrieval/tenant_store.py - Query Expansion
backend/app/retrieval/query_expander.py - XGBoost Reranker
backend/app/reranking/model.py
Agent Intelligence
- Agent Orchestrator
backend/app/agents/orchestrator.py - Tool Registry
backend/app/tools/registry.py - Enterprise Tools
backend/app/tools/knowledge.py - LLM Provider
backend/app/llm/factory.py - MCP JSON-RPC
backend/app/mcp/server.py - MCP Tool Adapter
backend/app/mcp/adapter.py
Operations
- Telemetry and Metrics
backend/app/observability/tracer.py - Evaluation Runner
backend/app/evaluation/runner.py - Benchmark Metrics
backend/app/evaluation/metrics.py
Other components
- Enterprise User
- OpenAI or Grok
Connections 26
- Enterprise User → React Workspace: uses
- React Workspace → Session Context: provides session
- Session Context → Authentication API: authenticates
- Authentication API → JWT and RBAC: checks permissions
- Authentication API → SQLite Database: reads users
- Chat Workspace → Chat API: submits query
- Chat API → JWT and RBAC: authorizes request
- Chat API → Agent Orchestrator: executes query
- Agent Orchestrator → Tool Registry: dispatches tools
- Tool Registry → Enterprise Tools: resolves tools
- Enterprise Tools → Query Expansion: expands query
- Enterprise Tools → Tenant Vector Store: retrieves candidates
- Enterprise Tools → XGBoost Reranker: reranks evidence
- Agent Orchestrator → LLM Provider: generates answer
- LLM Provider → OpenAI or Grok: calls provider
- Agent Orchestrator → Telemetry and Metrics: records spans
- Agent Orchestrator → Chat Workspace: returns citations
- Document API → Ingestion Pipeline: ingests upload
- Ingestion Pipeline → Text Processing: extracts chunks
- Ingestion Pipeline → Embedding Provider: embeds chunks
- Ingestion Pipeline → Tenant Vector Store: indexes vectors
- Ingestion Pipeline → SQLite Database: stores metadata
- MCP JSON-RPC → MCP Tool Adapter: dispatches RPC
- MCP Tool Adapter → Tool Registry: calls tools
- Evaluation Runner → Benchmark Metrics: computes scores
- Evaluation Runner → Agent Orchestrator: benchmarks queries