Skip to content
HarshXAIPublic

About

Evidence-grounded RAG over SEC EDGAR filings: hybrid retrieval, reranking, citations and guardrails.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

VESPER - Verifiable Evidence-grounded Semantic Processing and Extraction Runtime

CI/CD Tests Coverage p95 Latency Eval Score Cost Savings License Python TypeScript

flowchart LR
    SEC["SEC EDGAR filings"] --> ING["Ingestion service"]
    AF["Airflow DAGs<br/>ingest · embed · nightly eval"] -.-> ING
    ING --> MED["Medallion pipeline<br/>Bronze → Silver → Gold"]
    MED --> PG[("PostgreSQL + pgvector<br/>chunks + embeddings")]
    UI["Analyst UI<br/>(Next.js)"] -->|query| GW["FastAPI gateway<br/>auth · budget · guardrails"]
    GW --> RAG["Hybrid retrieval<br/>vector + BM25 → rerank"]
    PG --> RAG --> LLM["LLM answer<br/>with citations"]
    LLM -->|SSE stream| UI
    GW -.-> OBS["Prometheus · Grafana · Jaeger"]
    OBS --> OPS["Ops dashboard"]
    EVAL["Evaluator"] -.-> GW
Loading

Overview

VESPER is a production-grade, self-healing AI platform designed for financial intelligence and data analysis. Built on AWS with an open-source-first philosophy, VESPER provides evidence-grounded answers with full citation tracking and provenance.

Key Features

  • 🔍 Evidence-Grounded Answers - Every response includes verifiable citations
  • 📊 Multi-Source Analysis - Cross-company comparisons with attribution
  • ⚠️ Conflict Detection - Automatic surfacing of conflicting information
  • 🔄 Self-Healing - Automated drift detection and remediation
  • 🏥 Domain Portability - Switch domains (finance → healthcare) with one ENV change

📖 Demo Script | 🎯 Features | 📸 Screenshots | 🔀 Domain Swap

Architecture

VESPER follows a layered architecture:

  1. Data Layer - Medallion Architecture (Bronze/Silver/Gold) on AWS S3 with Apache Iceberg
  2. Retrieval Layer - Hybrid semantic search with PostgreSQL + pgvector
  3. Reasoning Layer - Multi-agent LLM system with dynamic model routing
  4. Safety Layer - Multi-tiered guardrails and policy enforcement
  5. Monitoring Layer - Self-healing observability with automated drift detection
  6. Infrastructure Layer - Kubernetes-orchestrated, event-driven serving
  7. UI Layer - Dual interfaces (Analyst Chat UI + Ops Dashboard)

Project Structure

vesper/
├── apps/
│   └── api-gateway/        # FastAPI gateway: RAG, guardrails, auth, budget, metrics, tracing, eval routes
├── services/
│   ├── ingestion/          # SEC EDGAR connector, storage, filing models
│   ├── processing/         # HTML/PDF parsing, section + table extraction, NER, chunking, Silver/Gold transforms, provenance
│   └── evaluator/          # Offline evaluation runner
├── orchestration/
│   └── dags/               # Airflow: SEC ingestion, embedding backfill, nightly evaluation
├── frontends/
│   ├── analyst-ui/         # Next.js chat interface (SSE streaming)
│   └── ops-ui/             # Next.js operations dashboard
├── monitoring/             # Prometheus config + Grafana dashboards
├── infrastructure/
│   └── terraform/          # AWS infrastructure as code
├── scripts/                # Embedding, seeding, load tests, deploy checks
├── docs/                   # Features, runbooks, dashboards, demo script
├── tests/                  # Test suites
└── docker-compose.yml      # Local development environment

Tech Stack

Core Infrastructure

  • Cloud Platform: AWS (S3, EKS, RDS, MSK, ElastiCache, MWAA)
  • Infrastructure as Code: Terraform
  • Container Orchestration: Kubernetes (EKS) with KEDA autoscaling
  • Service Mesh: Istio (optional for advanced scenarios)

Data Layer

  • Storage: Amazon S3
  • Table Format: Apache Iceberg / Delta Lake
  • Processing: AWS Glue, Apache Spark
  • Orchestration: Apache Airflow (AWS MWAA)
  • Streaming: Apache Kafka (AWS MSK)
  • Versioning: DVC (Data Version Control)

Retrieval & Database

  • Vector Database: PostgreSQL with pgvector extension
  • Caching: Redis (AWS ElastiCache)
  • Search: Hybrid (BM25 + Dense Embeddings) with Cross-Encoder Reranking

AI/ML

  • LLM Framework: LangChain + LangGraph
  • Model Serving: vLLM / Text Generation Inference
  • Embeddings: OpenAI Ada / Sentence Transformers
  • Experiment Tracking: MLflow
  • Guardrails: NVIDIA NeMo Guardrails, Guardrails AI

APIs & Services

  • API Framework: FastAPI (Python 3.11+)
  • Message Queue: Kafka (MSK) / SQS
  • Authentication: JWT + OAuth 2.0
  • API Gateway: AWS ALB / API Gateway

Monitoring & Observability

  • Metrics: Prometheus + Grafana
  • Tracing: OpenTelemetry
  • Logging: CloudWatch / ELK Stack
  • Drift Detection: EvidentlyAI
  • APM: LangSmith / Arize

Frontend

  • Framework: Next.js 14+ (React, TypeScript)
  • Styling: Tailwind CSS
  • State Management: Zustand / React Query
  • Real-time: WebSockets / Server-Sent Events
  • Charts: ECharts / Recharts

DevOps

  • CI/CD: GitHub Actions
  • Container Registry: AWS ECR
  • Secrets Management: AWS Secrets Manager
  • Deployment: Helm + ArgoCD

Prerequisites

  • AWS Account with appropriate permissions
  • Docker (20.10+) and Docker Compose (2.0+)
  • Terraform (1.5+)
  • Python (3.11+)
  • Node.js (20+) and pnpm
  • kubectl and helm for Kubernetes management
  • AWS CLI configured with credentials

Quick Start

1. Clone and Setup

git clone <repository-url>
cd vesper
cp .env.example .env
# Edit .env with your configuration

2. Local Development Environment

# Start local development stack
docker-compose up -d

# This starts:
# - PostgreSQL with pgvector
# - Redis
# - Kafka (Redpanda)
# - MinIO (S3-compatible)
# - Airflow
# - Prometheus & Grafana

Quick Demo

# 1. Seed demo data (10 SEC filings for AAPL, AMZN, MSFT)
python scripts/demo_seed.py

# 2. Warm the cache with top 20 queries
python scripts/cache_warmers.py --persist

# 3. Run demo (see docs/DEMO_SCRIPT.md for full walkthrough)
curl -X POST http://localhost:8000/api/v1/query \
  -H "Content-Type: application/json" \
  -d '{"query": "What was Apple'\''s revenue for FY 2024?"}'

# 4. Switch to healthcare domain (no code changes!)
DOMAIN=healthcare docker-compose up -d

3. Infrastructure Provisioning (AWS)

cd infrastructure
terraform init
terraform plan -out=tfplan
terraform apply tfplan

4. Deploy Services

# Build and push Docker images
./scripts/build-and-push.sh

# Deploy to Kubernetes
./scripts/deploy.sh

5. Access UIs

Development

Service Development

Each service is independently developable:

cd services/api-gateway
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -e .
pytest

Running Tests

# Unit tests
./scripts/test-unit.sh

# Integration tests
./scripts/test-integration.sh

# E2E tests
./scripts/test-e2e.sh

Code Quality

# Linting
./scripts/lint.sh

# Type checking
./scripts/typecheck.sh

# Security scanning
./scripts/security-scan.sh

Configuration

Configuration is managed via:

  • Environment Variables: .env files per environment
  • AWS Secrets Manager: Sensitive credentials
  • ConfigMaps: Kubernetes configuration
  • Terraform Variables: Infrastructure parameters

See Configuration Guide for details.

Deployment

Environments

  • Development: Local Docker Compose
  • Staging: AWS EKS (staging namespace)
  • Production: AWS EKS (production namespace)

Deployment Pipeline

  1. PR → GitHub Actions runs tests & builds
  2. Merge to main → Auto-deploy to staging
  3. Manual approval → Deploy to production
  4. Automated rollback on health check failures

See Deployment Guide for details.

Monitoring & Observability

  • Metrics Dashboard: Grafana dashboards for each service
  • Distributed Tracing: OpenTelemetry traces in Jaeger
  • Log Aggregation: CloudWatch / ELK with correlation IDs
  • Alerting: PagerDuty integration for critical alerts
  • Evaluation Metrics: Nightly eval runs tracked in MLflow

See Monitoring Guide for details.

Security

  • Authentication: JWT tokens with short expiry
  • Authorization: RBAC with policy-based access control
  • Secrets: AWS Secrets Manager + encrypted at rest
  • Network: VPC isolation, security groups, NACLs
  • Data: Encryption at rest (S3, RDS) and in transit (TLS 1.3)
  • Compliance: Audit logs for all data access and model decisions

See Security Guide for details.

Architecture Decisions

Key architectural decisions are documented in Architecture Decision Records.

Contributing

See CONTRIBUTING.md for development workflow and guidelines.

License

MIT. See LICENSE.

Project Status

✅ Complete. All phases shipped (see PROJECT_STATUS.md):

  • RAG pipeline with real-time SSE streaming
  • Analyst chat UI (Next.js) and operations dashboard with embedded Grafana panels
  • Medallion data pipeline (Bronze → Silver → Gold) orchestrated with Airflow
  • 1,000+ document chunks with embeddings in pgvector
  • Observability with Prometheus, Grafana and Jaeger

About

Evidence-grounded RAG over SEC EDGAR filings: hybrid retrieval, reranking, citations and guardrails.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages