How atharva481/resin works
RESIN is an academic research workstation: researchers discover and organize papers, index full text, and ask questions answered from retrieved paper evidence with citations. The map includes the documented ingestion, multi-paper agent, summaries, and daily-triage capabilities. Some subsystem links are documented in the README but their implementation files were not sampled; those paths identify the existing enclosing directories, not inspected implementations.
Main entry points: embed.py Index Endpoints · chat.py Chat Endpoints · App.tsx Web App · main.py FastAPI App
Components 27
Research Workspace
- Web App
frontend/src/App.tsx - Discovery Feed
frontend/src/pages/Feed.tsx - Paper Views
frontend/src/pages/Papers.tsx - Library
frontend/src/pages/Library.tsx - Paper Chat
frontend/src/components/PaperChat.tsx - RAG API Client
frontend/src/lib/ragApi.ts
Backend API
- FastAPI App
backend/app/main.py - Token Auth
backend/app/core/auth.py - Chat Endpoints
backend/app/api/chat.py - Index Endpoints
backend/app/api/embed.py - Paper Search Proxy
backend/app/api/search.py
Paper Ingestion
- Canonical Resolution
backend/app/services/paper_resolution.py - Open-Access Discovery
backend/app/services/open_access.py - PDF Extraction
backend/app/services/pdf.py - Chunking and Indexing
backend/app/services/indexing.py
Search and Synthesis
- Embedding Service
backend/app/services/embeddings.py - Vector Retrieval
backend/app/services/retrieval.py - Grounded Chat and Summary
backend/app/services/rag.py - Research Agent
backend/app/agent/agent.py - Agent Tools
backend/app/agent/tools.py - Chat History
backend/app/services/chat_service.py
Daily Triage
- Daily Triage Worker
resin-triage/daily-triage.js - Feed Ingestion
resin-triage/ingest-feeds.js
Other components
- Researcher
- Supabase and pgvector
backend/app/core/supabase.py - Gemini Models
- Scholarly Sources
Connections 33
- Researcher → Web App: uses
README.md - Web App → Discovery Feed: routes to
frontend/src/App.tsx - Web App → Paper Views: routes to
frontend/src/App.tsx - Web App → Library: routes to
frontend/src/App.tsx - Paper Views → Paper Chat: offers chat
- Paper Chat → RAG API Client: requests answers
- RAG API Client → FastAPI App: calls API
README.md - FastAPI App → Chat Endpoints: mounts routes
backend/app/main.py - FastAPI App → Index Endpoints: mounts routes
backend/app/main.py - FastAPI App → Paper Search Proxy: mounts routes
backend/app/main.py - Chat Endpoints → Token Auth: validates users
backend/app/api/chat.py - Chat Endpoints → Grounded Chat and Summary: delegates chat
backend/app/api/chat.py - Chat Endpoints → Research Agent: dispatches agent
backend/app/api/chat.py - Chat Endpoints → Chat History: persists turns
backend/app/api/chat.py - Index Endpoints → Token Auth: validates users
backend/app/api/embed.py - Index Endpoints → Canonical Resolution: resolves papers
backend/app/api/embed.py - Index Endpoints → Open-Access Discovery: discovers documents
backend/app/api/embed.py - Index Endpoints → PDF Extraction: extracts documents
backend/app/api/embed.py - Index Endpoints → Chunking and Indexing: starts indexing
backend/app/api/embed.py - Open-Access Discovery → Scholarly Sources: searches sources
README.md - Chunking and Indexing → Embedding Service: creates vectors
backend/app/services/indexing.py - Chunking and Indexing → Supabase and pgvector: writes index
backend/app/services/indexing.py - Paper Search Proxy → Scholarly Sources: proxies searches
backend/app/api/search.py - Grounded Chat and Summary → Vector Retrieval: retrieves evidence
backend/app/services/rag.py - Vector Retrieval → Embedding Service: embeds queries
backend/app/services/retrieval.py - Vector Retrieval → Supabase and pgvector: searches vectors
backend/app/services/retrieval.py - Grounded Chat and Summary → Gemini Models: generates answers
README.md - Embedding Service → Gemini Models: requests embeddings
backend/app/services/embeddings.py - Research Agent → Agent Tools: uses tools
README.md - Agent Tools → Vector Retrieval: searches library
backend/app/agent/tools.py - Daily Triage Worker → Feed Ingestion: uses feed data
- Daily Triage Worker → Scholarly Sources: queries papers
README.md - Daily Triage Worker → Gemini Models: filters candidates
README.md