How yasser392/papertrail-ai works
PaperTrail AI turns a user’s research profile into a corpus-backed scientific discovery workspace: federated literature ingestion and embedding feed graph construction, clustering, search, recommendations, serendipity, and research-opportunity analysis. The frontend exposes those capabilities through the API; background pipelines own long-running corpus and analysis jobs. The README documents the user workflow and product branches; source excerpts confirm selected pipeline and analytics calls. Several routes and services were not sampled, so their internal call relationships are not inferred.
Main entry points: pipelines.py Analysis pipelines · context.py Research context · corpus.py Corpus lifecycle · engine.py Research clusters
Components 26
User experience
- Research workspace
frontend/src/pages - API client
frontend/src/services/api.ts - App shell
frontend/src/App.tsx
API and jobs
- HTTP application
backend/app/main.py - API routes
backend/app/api/routes - Background jobs
backend/app/workers/jobs.py - Analysis pipelines
backend/app/services/pipelines.py
Corpus and sources
- Federated sources
backend/app/integrations/aggregator.py - Source adapters
backend/app/integrations - Corpus lifecycle
backend/app/services/corpus.py - Paper repository
backend/app/repositories/papers.py - SPECTER2 embeddings
backend/app/ml/embeddings/encoder.py
Discovery analytics
- Concept extraction
backend/app/ml/extraction/concepts.py - Hybrid search
backend/app/ml/retrieval/hybrid.py - Vector index
backend/app/ml/retrieval/vector_index.py - Knowledge graph
backend/app/ml/knowledge_graph/builder.py - Research clusters
backend/app/ml/clustering/engine.py - Research context
backend/app/ml/recommendation/context.py - Recommendations
backend/app/ml/recommendation/engine.py - Discovery Zone
backend/app/ml/serendipity/engine.py - Research opportunities
backend/app/ml/research_gaps/analyzer.py
State and integrations
- Paper database
backend/app/models/entities.py - LLM explanations
backend/app/services/llm.py - Neo4j mirror
backend/app/ml/knowledge_graph/neo4j_store.py
Other components
- Researcher
- Publication APIs
Connections 31
- Researcher → Research workspace: uses
README.md - Research workspace → API client: requests via
- API client → HTTP application: calls API
- HTTP application → API routes: registers
backend/app/main.py - API routes → Background jobs: queues work
backend/app/api/routes/clusters.py - Background jobs → Analysis pipelines: runs jobs
- Analysis pipelines → Federated sources: searches corpus
backend/app/services/pipelines.py - Federated sources → Source adapters: dispatches sources
- Source adapters → Publication APIs: fetches papers
README.md - Analysis pipelines → Corpus lifecycle: embeds papers
backend/app/services/pipelines.py - Corpus lifecycle → SPECTER2 embeddings: encodes papers
backend/app/services/corpus.py - Corpus lifecycle → Vector index: updates index
backend/app/services/corpus.py - Corpus lifecycle → Paper repository: ingests records
backend/app/services/corpus.py - Paper repository → Paper database: persists records
backend/app/repositories/papers.py - Analysis pipelines → Knowledge graph: builds graph
backend/app/services/pipelines.py - Analysis pipelines → Research clusters: runs clustering
backend/app/services/pipelines.py - Research clusters → Knowledge graph: reads communities
backend/app/ml/clustering/engine.py - Research clusters → LLM explanations: labels clusters
backend/app/ml/clustering/engine.py - Recommendations → Research context: scores context
backend/app/ml/recommendation/engine.py - Research context → Corpus lifecycle: ensures index
backend/app/ml/recommendation/context.py - Research context → Concept extraction: extracts concepts
backend/app/ml/recommendation/context.py - Research context → Research clusters: uses clusters
backend/app/ml/recommendation/context.py - Recommendations → Hybrid search: uses hybrid retrieval
backend/app/ml/recommendation/engine.py - Hybrid search → Vector index: searches vectors
backend/app/ml/retrieval/hybrid.py - Discovery Zone → Research context: uses context
backend/app/ml/serendipity/engine.py - Discovery Zone → Knowledge graph: uses graph
backend/app/ml/serendipity/engine.py - Research opportunities → Research context: uses context
backend/app/ml/research_gaps/analyzer.py - Research opportunities → LLM explanations: phrases findings
backend/app/ml/research_gaps/analyzer.py - Analysis pipelines → Neo4j mirror: syncs graph
backend/app/services/pipelines.py - Knowledge graph → Neo4j mirror: optional mirror
README.md - Paper repository → Concept extraction: extracts evidence
backend/app/repositories/papers.py