How harsh-0000/fy_project works
Irium is a FinTech research and document-analysis application. A user submits a query through the chat UI or research API; the API protects it, then the research service applies cache/workflow orchestration to produce a routed answer with evidence and citations. Complex research plans tasks, searches, reads, consolidates evidence, writes, and critiques with retry; document uploads follow parsing and analysis paths. Other major capabilities include auth, chat memory/history, PII controls, observability, and health checks. Edges follow excerpts, source-index references, or README statements; unsampled feature links are omitted where evidence does not establish a caller.
Main entry points: research_graph.py Research graph · llm.py LLM service · research.py Research endpoint · document_service.py Document service
Components 30
User Entry
- Chat interface
frontend/app.js - FastAPI application
app/main.py - Research endpoint
app/api/routes/research.py
Research Workflow
- Tier router
app/agents/router.py - Research graph
app/workflows/research_graph.py - Simple answers
app/agents/simple.py - Fact verification
app/agents/verification.py - Research planner
app/agents/planner.py - Search reader
app/agents/reader.py - Evidence consolidation
app/agents/evidence.py - Answer writer
app/agents/writer.py - Quality critic
app/agents/critic.py
Document Analysis
- Document endpoints
app/api/routes/documents.py - Document service
app/services/document_service.py - Format parsers
app/documents/parser.py - Document validator
app/documents/validator.py - Document analysis agent
app/agents/document_analysis.py
Shared Services
- LLM service
app/services/llm.py - Search service
app/services/search.py - Tavily search
app/providers/tavily.py - Response cache
app/services/cache.py - PII protection
app/services/pii_detector.py - User memory
app/services/memory.py - Chat history
app/services/chat_history.py - Authentication
app/services/auth.py
Data and Operations
- Application database
app/database/session.py - Tracing and metrics
app/core/observability.py - Health checks
app/api/routes/health.py
Other components
- Research user
- LLM providers
Connections 38
- Research user → Chat interface: uses
- Chat interface → FastAPI application: sends queries
- Research user → Research endpoint: submits query
- FastAPI application → Research endpoint: mounts routes
app/main.py - Research endpoint → PII protection: protects query
app/api/routes/research.py - Research endpoint → Authentication: resolves user
app/api/routes/research.py - Research endpoint → Research graph: runs research
- Research endpoint → Chat history: saves conversation
app/api/routes/research.py - Research endpoint → Response cache: uses cache
app/api/routes/research.py - Research graph → Tier router: classifies query
app/workflows/research_graph.py - Research graph → Simple answers: routes simple
app/workflows/research_graph.py - Research graph → Fact verification: routes verification
app/workflows/research_graph.py - Research graph → Research planner: routes complex
app/workflows/research_graph.py - Research graph → Search reader: extracts findings
app/workflows/research_graph.py - Research graph → Evidence consolidation: consolidates evidence
app/workflows/research_graph.py - Research graph → Answer writer: writes answer
app/workflows/research_graph.py - Research graph → Quality critic: reviews answer
app/workflows/research_graph.py - Research graph → Search service: retrieves sources
app/workflows/research_graph.py - Research graph → Tracing and metrics: records metrics
app/workflows/research_graph.py - Tier router → LLM service: classifies fallback
app/agents/router.py - Simple answers → LLM service: generates answer
app/agents/simple.py - Fact verification → Search service: checks current facts
app/agents/verification.py - Research planner → LLM service: decomposes query
app/agents/planner.py - Search reader → LLM service: extracts information
app/agents/reader.py - Answer writer → LLM service: synthesizes answer
app/agents/writer.py - Quality critic → LLM service: evaluates draft
app/agents/critic.py - Search service → Tavily search: queries provider
app/services/search.py - Search service → Response cache: caches results
app/services/search.py - LLM service → LLM providers: invokes model
app/services/llm.py - Document endpoints → Document service: handles uploads
- Document service → Document validator: validates files
app/services/document_service.py - Document service → Format parsers: parses content
app/services/document_service.py - Document service → Application database: stores documents
- Document analysis agent → LLM service: analyzes documents
- FastAPI application → Tracing and metrics: records requests
app/main.py - Health checks → LLM providers: checks readiness
- Authentication → Application database: reads users
app/services/auth.py - User memory → Application database: persists memory