PaperTrail is a research-reading helper. A user enters a research topic, paper title, DOI, or paper link, and the app finds a likely seed paper plus a guided ancestor tree showing earlier material that led up to it.
This branch is the current MVP:
- Search by topic, paper title, DOI, arXiv link, or Semantic Scholar link
- Review likely starting points for the topic
- Generate a guided ancestor tree from the best seed paper
- Refine broad topics with a short clarification step before choosing a seed
- Render that tree as a layered guided ancestor map in the browser
- Frontend: React + Vite + D3
- Backend: Node.js + Express
- Local infra: PostgreSQL, Redis, Neo4j via Docker Compose
- External data sources: Semantic Scholar and arXiv
client/contains the MVP UI for searching papers and rendering the ancestor graph.backend/contains the API for search, health checks, and ancestor-tree generation.docker-compose.ymlstarts Postgres, Redis, and Neo4j for local development.- Broad prompts such as
llms,rag, oriotcan trigger a clarification card so PaperTrail can pick a better seed. - The tree now uses learning layers such as
Current paper,Direct foundations, andEarlier foundationsinstead of a generic graph-only view.
The backend can run even if those local services are unavailable. In that case it falls back to live external search where possible.
GET /api/healthGET /api/workspaceGET /api/papersGET /api/search?q=<query>POST /api/papers/ancestor-tree
Example ancestor-tree request body:
{
"title": "Attention Is All You Need",
"paperId": "204e3073870fae3d05bcbc2f6a8e263d9b72e776",
"depth": 2,
"breadth": 3
}The ancestor-tree response also includes lightweight guide metadata so the frontend can explain what to read first, not just draw the graph. The workspace endpoint returns recent saved papers plus recent research trails so the UI can feel persistent across sessions.
Current pushed checkpoint on main:
- branch:
main - commit:
a80a349 - summary:
Improve PaperTrail broad-topic refinement and tree depth
This checkpoint includes:
- clarification-aware broad-topic refinement
- smarter backend retrieval for refined searches
- adaptive tree depth for stronger seeds
- richer fallback learning trees when live citation ancestry is weak
- generation-band ancestor layout improvements
- the refined-tree crash fix
Progress across development passes is tracked in PROJECT_PROGRESS.md. Practical local startup steps are documented in RUN_INSTRUCTIONS.md. Deployment setup is documented in DEPLOYMENT.md.
cd backend && npm install
cd ../client && npm installcp backend/.env.example backend/.env
cp client/.env.example client/.envdocker compose up -dIn one terminal:
cd backend
npm run devIn another terminal:
cd client
npm run devThe frontend defaults to http://localhost:5173 and the backend to http://localhost:4000.
The repo now includes first-pass deployment support for:
- Render backend + managed Postgres via render.yaml
- Vercel frontend with SPA rewrites via client/vercel.json
- environment setup and smoke-test steps in DEPLOYMENT.md
The backend also supports managed-service env vars such as DATABASE_URL, POSTGRES_SSL, REDIS_URL, and CORS_ORIGIN.
- Add semantic branch types so the tree distinguishes:
- overview branches
- foundational theory branches
- methodology branches
- applied/supporting branches
- Improve broad-topic refinement further so prompts like
llms,agents, andragproduce cleaner candidate pools - Make adaptive depth more quality-aware so strong topics can open into deeper trees without clutter
- Persist reading plans and research trails more deeply instead of relying only on paper-level saves
- Use Neo4j for stored graph relationships instead of on-demand-only tree building
- Add caching for repeated searches and tree generation
If someone is picking up from the latest pushed main, the best next work is:
Branch semanticsMake the ancestor tree teach what each branch means, not just that it exists.Broader-topic retrieval qualityKeep improving clarification-aware search so vague prompts produce better seed pools.Adaptive depth tuningLet deeper trees open only when source quality supports it.LaterOnly after the deterministic product logic is stronger: add a focused in-app copilot over PaperTrail’s own context.
A future direction is an in-app copilot that answers questions only about material inside PaperTrail. That can come later once the core ancestor-tree flow is stable, and it would likely use RAG plus memory scoped to the user’s activity inside the app.