How mayank953/meridian-ai-learner works
Meridian AI is a web app for document-grounded Q&A and AI-assisted purchase audits. The browser UI calls a FastAPI backend: uploads are retained and indexed, while questions retrieve relevant document chunks for an answer; audit requests run risk, tax, and financial-control reviews followed by CFO synthesis. The graph includes the documented local/cloud storage and vector-search options. Some frontend component internals and backend storage implementations were not excerpted, so uncertain connections are omitted; README-documented flows and visible source calls are shown.
Main entry points: agents.py Audit supervisor · endpoints.py API routes · App.tsx React app · api.ts API client
Components 28
Web interface
- React app
frontend/src/App.tsx - Document Q&A tab
frontend/src/components/RagQATab.tsx - Document upload tab
frontend/src/components/DocumentUploadTab.tsx - Audit tab
frontend/src/components/AuditTab.tsx - System status tab
frontend/src/components/SystemStatusTab.tsx - API client
frontend/src/lib/api.ts
Backend API
- FastAPI app
backend/api/main.py - API routes
backend/api/endpoints.py - Request and response schemas
backend/api/schemas.py
Document Q&A
- PDF ingestion and chunking
backend/rag/data_ingestion.py - Original document storage
backend/rag/document_store.py - Retrieval and answer chain
backend/rag/retrieval.py - Vector search store
backend/rag/vector_store.py - Text embeddings
backend/rag/embeddings.py
Purchase audit
- Audit supervisor
backend/agent/agents.py - Risk and compliance review
backend/agent/agents.py - Tax and treasury review
backend/agent/agents.py - Financial control review
backend/agent/agents.py - CFO memo synthesis
backend/agent/agents.py - Audit tools
backend/agent/tools.py - Audit prompts
backend/agent/prompts.py - Agent middleware
backend/agent/middleware.py
Shared services
- Runtime settings
backend/config/settings.py - Gemini chat model
backend/rag/llm.py
Other components
- Browser user
- Google Gemini
- Vector search service
- Cloud Storage
Connections 37
- Browser user → React app: uses
README.md - React app → Document Q&A tab: routes to
frontend/src/App.tsx - React app → Document upload tab: hosts
- React app → Audit tab: hosts
- React app → System status tab: hosts
- Document Q&A tab → API client: sends queries
README.md - Document upload tab → API client: sends PDFs
README.md - Audit tab → API client: submits request
README.md - System status tab → API client: requests status
- API client → API routes: calls API
README.md - FastAPI app → API routes: registers routes
backend/api/main.py - API routes → Request and response schemas: validates and returns
backend/api/endpoints.py - API routes → PDF ingestion and chunking: indexes uploads
backend/api/endpoints.py - API routes → Original document storage: saves originals
backend/api/endpoints.py - API routes → Retrieval and answer chain: asks question
backend/api/endpoints.py - PDF ingestion and chunking → Original document storage: reads stored PDFs
backend/rag/data_ingestion.py - PDF ingestion and chunking → Vector search store: adds chunks
backend/rag/data_ingestion.py - Retrieval and answer chain → Vector search store: searches chunks
backend/rag/retrieval.py - Retrieval and answer chain → Gemini chat model: generates answer
backend/rag/retrieval.py - Vector search store → Text embeddings: embeds queries
backend/rag/vector_store.py - Vector search store → Vector search service: uses in cloud mode
- Original document storage → Cloud Storage: uses in cloud mode
- API routes → Audit supervisor: runs audit
backend/api/endpoints.py - Audit supervisor → Risk and compliance review: runs first
backend/agent/agents.py - Audit supervisor → Tax and treasury review: runs second
backend/agent/agents.py - Audit supervisor → Financial control review: runs third
backend/agent/agents.py - Audit supervisor → CFO memo synthesis: synthesizes reports
backend/agent/agents.py - Risk and compliance review → Audit tools: uses tools
backend/agent/agents.py - Tax and treasury review → Audit tools: uses tools
backend/agent/agents.py - Financial control review → Audit tools: uses tools
backend/agent/agents.py - Audit supervisor → Audit prompts: configures reviews
backend/agent/agents.py - Audit supervisor → Agent middleware: builds agent stack
backend/agent/agents.py - Audit supervisor → Gemini chat model: invokes model
backend/agent/agents.py - Audit tools → Gemini chat model: uses model
backend/agent/tools.py - Gemini chat model → Google Gemini: calls
backend/rag/llm.py - Runtime settings → Gemini chat model: configures
backend/rag/llm.py - Runtime settings → Text embeddings: selects model
backend/rag/embeddings.py