All projects

Hobby2026

PhD Analyzer

A personal PhD search board with a Claude agent at its core: it finds universities, supervisors, papers, research gaps and open positions from real sources, and saves nothing it cannot back with a link.

Modules
14
Scholarly sources
OpenAlex · Semantic Scholar · arXiv · Crossref
PhD portals
8, 3 searched directly
Direction score
8 weighted criteria

01Overview

PhD Analyzer puts a whole PhD search on one board: the applicant's profile and hard criteria, universities with their rankings and language-test rules, supervisors, papers, research gaps, publication venues, open PhD positions, what students say on Reddit, deadlines and today's tasks. At the center sits Talvis, a Claude agent that sees the entire board on every turn and fills it from real sources.

Talvis can only write to the board through its own tools, and the tools enforce the rules: a paper is saved by its ID and its metadata is fetched from the source, a gap needs evidence papers already in the library, a verified deadline needs an official page, and a position or a student quote needs a link that really appeared in a search result. Long tasks - finding universities that meet the criteria, scouting one for supervisors, gap analysis, portal scans, Reddit analysis, comparing research directions, estimating the admission chance - run as background jobs and post a report to the chat.

It runs as a local Node server with a React board in Azerbaijani, on the author's own Claude subscription through the Claude Agent SDK. Dated tasks and deadlines can be mirrored into MySpace, the author's task manager, with completion synced both ways. The same build also runs in a container, with Postgres as the durable store and a password in front.

02The problem

A PhD search is spread over rankings, official admission pages, funding calls, PhD portals, publication databases and forums. The facts that decide an application - whether an English-test waiver applies to this applicant, the deadline for this intake, who at a university still publishes on the topic - sit on different sites, often behind JavaScript, inside PDFs or in closed accordions.

A general chatbot makes it worse: it answers with confident paper titles, ranks, deadlines and links that do not exist. For a decision this big, every claim needs a source the applicant can open.

03Architecture

The browser board is a thin client over REST and one Server-Sent Events stream. The Express server owns a SQLite board and runs Talvis through the Claude Agent SDK, with Claude's built-in tools turned off except web search and fetch, and an in-process MCP server exposing the board, research and web tools. Every external response is cached in SQLite.

Browser board

Modules view

Cards open as Talvis works

Network view

Knowledge graph, d3-force layout

Direction bar

Filters the whole board

Talvis chat

Streamed answers, tool steps

Local server

Express 5

REST + SSE, password in the cloud

Job runner

Background research, reports to chat

Claude login

The user's own login, no API key

Talvis agent

Claude Agent SDK

Claude Code, only web search and fetch built in

MCP server "phd"

Board, research and web tools

Board snapshot

Whole board as text, every turn

Integrity gates

IDs, evidence, seen URLs

Sources

Scholarly APIs

OpenAlex, Semantic Scholar, arXiv, Crossref

PhD portals

DAAD API, listing pages, site: search

Reddit

OAuth API or public RSS

Real browser

Edge or Chrome, PDFs page by page

Storage

SQLite

One JSON document per row, WAL

api_cache

6 hours to 30 days

seen_urls

Links allowed as evidence

Postgres mirror

Optional, for the container

04Components

Talvis runner

One agent, only the board's tools

  • Each query gets a fixed system prompt plus a dynamic part: a fresh text snapshot of the whole board with letter-prefixed IDs (T12, U3, R7, P40) and the direction group in focus.
  • Claude's file, terminal and other built-in tools are off; only web search, web fetch and the phd MCP server are allowed, and nothing waits for a permission prompt.
  • Every tool call is mapped to a module and a readable label and streamed to the board, so the matching card lights up and opens while Talvis works on it.

Claude Agent SDK · MCP

Evidence-gated tools

Rules the model cannot talk around

  • save_papers accepts only OpenAlex, DOI, arXiv or Semantic Scholar IDs; title, authors, abstract and citations are fetched on the server and merged with existing records by ID or normalized title.
  • add_gap rejects evidence that is not in the library, add_deadline rejects verified=true without a source URL, and add_university rejects a rank or a language-test status without its official page.
  • Every URL in a tool result or in the user's message is normalized and stored; positions, student-voice evidence and direction-analysis refs fail if their link was never seen.

zod · SQLite

Research layer

Real literature, polite requests

  • Paper search runs on one source or all of them and merges the preprint and proceedings versions of the same paper by title, keeping the published DOI and the higher citation count.
  • One request queue per host keeps each API's pace - one arXiv call every 3.1 s, about one per second for Semantic Scholar - and 429 or 5xx answers are retried with backoff. When arXiv throttles, its papers come from OpenAlex's arXiv index instead.
  • "Most cited" means most cited among the 50 most relevant matches, so a keyword search does not drift to famous but off-topic papers. DOIs are confirmed on Crossref.

OpenAlex · Semantic Scholar · arXiv · Crossref

Web reader

Official pages, PDFs, portals, Reddit

  • A page is fetched over plain HTTP first; if it looks like a JavaScript shell - little text or an empty root element - it is rendered in the Edge or Chrome already on the machine, with images and fonts blocked and at most three pages at once.
  • Text is taken by walking the DOM instead of innerText, so closed accordions and inactive tabs, where admission rules and deadlines often sit, are read too. JSON-LD job postings and programmes are kept.
  • PDFs are found through OpenAlex locations, arXiv or a landing page's citation_pdf_url and returned page by page, so a quote carries its page number.
  • Bot checks and login walls are reported as blocked, never worked around. Portals whose robots.txt disallows automated search are reached through a site-restricted web search; Reddit uses the official API with a key and public RSS without one.

playwright-core · unpdf

Direction groups

NLP or adaptive learning, with evidence

  • Every board item is placed into direction groups by its own text: the groups whose count of distinct keyword matches reaches 75% of the best one, so hybrids land in both. Short keywords like NLP must match as whole words.
  • Only an item whose text says nothing inherits from its topics; a university belongs to every group with a real presence among its researchers, groups and positions. Talvis can override a single item.
  • The strip under the HUD filters the whole board - cards, graph, panels and Talvis' focus - to one group; tasks and documents stay visible everywhere.

shared/directions.ts

05How it works

  1. 1

    Ask

    A chat message or a module button goes to Talvis together with a fresh snapshot of the board and the direction in focus.

  2. 2

    Search

    Talvis picks tools by the question: scholarly APIs for papers and people, web search and then the real browser for official facts, portals for positions, Reddit for student voice.

  3. 3

    Save through the gates

    Results reach the board only through its tools, which fetch metadata themselves and reject claims without an ID, evidence or a seen link.

  4. 4

    Light up

    Each tool call pulses its module card; writes are batched into one change event and the board refreshes over SSE.

  5. 5

    Run in the background

    Heavy work runs as a job with its own step-by-step procedure and up to 90 turns, and posts a report to the chat when it finishes.

06Technical deep dives

Proof is checked by the tools, not the prompt

The system prompt asks Talvis never to invent a paper, a deadline or a link. That alone is not enough, so every write tool checks the claim before it reaches the board. A failed check comes back as a tool error with the fix in it - save the paper first, read the page first - and the agent has to do that work.

The list of allowed links builds itself: the runner records every URL that appears in a successful tool result, on a page the reader opened, or in the user's own message. A link Talvis only remembers, or composes, is refused.

server/agent/tools.ts, runner.ts (condensed)typescript
// add_university: a rank or a language rule needs its official page
if (extra.rankLabel && !extra.rankSource) return fail('rankLabel needs rankSource (ranking page URL)')
if (extra.langCert && extra.langCert !== 'unknown' && !extra.langCertSource)
  return fail('langCert needs langCertSource (official requirements page URL)')

// add_gap: evidence must already be in the library
const missing = g.evidence.filter((e) => !get('papers', e.paperId)).map((e) => e.paperId)
if (missing.length) return fail(`papers not in library: ${missing.join(', ')}. Save them with save_papers first.`)

// save_position: the link must have appeared in a tool result
if (!wasSeen(url)) return fail('this url did not appear in any tool result; find it with portal_search, WebSearch or browse_page first')

// runner.ts: every successful tool result feeds the list of seen URLs
if (!b.is_error && b.content) noteUrls(typeof b.content === 'string' ? b.content : JSON.stringify(b.content))

Choosing a direction with one weighted score

The direction_fit job researches every group with the same steps and roughly the same number of searches - publication trend, key papers, supervisors at the target universities, open positions, open problems and personal fit - and saves a 0-10 score with a one-line reason for each of eight criteria, plus 5-12 evidence refs that must be board IDs or seen URLs.

The overall score is a weighted mean over the criteria that have a value, so a missing one does not count as zero. Weights: personal fit 0.2; interest, PhD opportunities and supervisors 0.15 each; field momentum, novelty and feasibility 0.1 each; career 0.05. Interest is the applicant's own 1-5 star rating mapped onto 0-10; the AI scores it only while the applicant has not rated it.

shared/directions.ts (simplified)typescript
export const CRITERIA = [
  { key: 'personal_fit', weight: 0.2 }, { key: 'interest', weight: 0.15 },
  { key: 'opportunities', weight: 0.15 }, { key: 'supervisors', weight: 0.15 },
  { key: 'momentum', weight: 0.1 }, { key: 'novelty', weight: 0.1 },
  { key: 'feasibility', weight: 0.1 }, { key: 'career', weight: 0.05 },
] as const

/** The applicant's 1-5 interest on the 0-10 scale of the other criteria. */
export const interestScore = (r?: number) => (r ? (r - 1) * 2.5 : undefined)

export function overallScore(scores, interest?: number) {
  let sum = 0, w = 0
  for (const c of CRITERIA) {
    const v = c.key === 'interest' ? interestScore(interest) ?? scores?.interest?.score : scores?.[c.key]?.score
    if (v === undefined) continue
    sum += v * c.weight
    w += c.weight
  }
  return w ? Math.round((sum / w) * 10) / 10 : undefined
}

Supervisors from publication data

Finding a supervisor usually means reading staff pages one by one. PhD Analyzer asks OpenAlex instead: all works at the institution and its sub-units whose title or abstract match the topic in the last six years, grouped by author in a single request. The top authors then come back in a second request with h-index, works count and last known institutions.

An author counts as current only when one of those institutions, or a parent of it, is the target, so someone who published there years ago and moved on drops to the bottom. The same group-by trick ranks venues by how many matching papers they publish and gives a topic's publication count per year.

server/research/openalex.ts (simplified)typescript
export async function topAuthorsAt(institutionId: string, query: string, fromYear = new Date().getFullYear() - 6, limit = 10) {
  const filter = [
    `title_and_abstract.search:${q(query)}`,
    `authorships.institutions.lineage:${short(institutionId)}`,
    `from_publication_date:${fromYear}-01-01`,
  ].join(',')
  // One request: matching works grouped by author
  const data = await fetchData(url('/works', { filter, group_by: 'authorships.author.id', per_page: 50 }))
  const groups = (data.group_by ?? []).slice(0, limit * 2)
  // Second request: h-index, works, last known institutions; isCurrent is set here
  const authors = await getAuthors(groups.map((g) => g.key), institutionId)
  const counts = new Map(groups.map((g) => [short(g.key), g.count]))
  return authors
    .map((a) => ({ ...a, topicWorks: counts.get(a.openalexId) ?? 0 }))
    .sort((a, b) => Number(b.isCurrent) - Number(a.isCurrent) || b.topicWorks - a.topicWorks)
    .slice(0, limit)
}

07Design decisions

Rules live in the tools

A prompt can be forgotten in the middle of a 90-turn job; a tool that returns an error cannot. The integrity checks sit in the write tools, so the agent cannot skip them.

A subscription, not an API key

Talvis runs on Claude Code through the Agent SDK with the user's own Claude login. Inherited Anthropic variables are stripped so a stray key never takes over; an API key is used only when explicitly switched on.

Primary sources first

Official pages beat portals and portals beat forums; ranks keep their edition and bands stay bands. Reddit is treated as anecdote: the analysis records how many posts were read, their dates and caveats, and never names individual users.

Polite to every site

Per-host pacing, robots.txt checks for automated listing searches, no stealth browser tricks, and a SQLite cache from 6 hours to 30 days so repeated questions do not spend rate limits.

SQLite at work, Postgres for keeps

Locally everything is one SQLite file served on 127.0.0.1. In a scale-to-zero container, the SQLite copy is filled from Postgres on start and every write is mirrored back within about a second - Claude login files included - so a restart loses nothing. One instance per database.

08Tech stack

AI
Claude Agent SDKClaude CodeMCPzod
Server
Node.js 20TypeScriptExpress 5Server-Sent Events
Data
SQLite (better-sqlite3)PostgreSQL
Sources & web
OpenAlexSemantic ScholararXivCrossrefReddit APIplaywright-coreunpdffast-xml-parser
Board
React 19Vite 6React Flowd3-forcereact-markdown
Deployment
DockerCloud Run

09What's next

  • OCR for scanned PDFs, which are now only reported as scans.
  • An English interface next to the Azerbaijani one.
  • Scheduled re-checks of saved deadlines and positions against their source pages.

Next case study

DevCode Academy LMS

A role-based learning management system for programming schools.