FasorX
PTENES

Dorguinha’s Blog

GraphKnolege: a research atlas for PPGEPS, from scrapers to semantic search

Executive summary

  • Why it exists: to have a single project that centralises all the information and the relationships between the works of the PPGEPS group. Today that is scattered: Lattes is one CV per person, and bibliographic databases answer one query at a time.
  • What it is: the PPGEPS Atlas, a navigable map of the 2,714 papers by the 20 faculty members of PUCPR's Graduate Programme in Industrial and Systems Engineering, in 18 themes, with search by meaning and full-text reading of the open-access papers.
  • How it was made: collection from OpenAlex checked against ORCID and Lattes, open PDFs resolved through a chain of sources, 82 thousand passages vectorised with multilingual-e5-large in a Postgres with pgvector, hybrid search by words and meaning, and three maps in the browser.
  • For assistants: an MCP server with six tools, so Claude and ChatGPT can query the collection with one key per person.
  • Where: graphknolege.fasorx.com.br, behind the FasorX login, published through GitHub Actions. The heavy processing runs on a local machine, and the server only reads.

Did the summary catch your interest? Then keep going, the rest is for you. If it didn't, feel free to stop here: the essentials are up there, and your time is worth more than my text.

The atlas in one figure

Two-column diagram: on the left the local machine with collection, cleaning, ingestion, embeddings and themes stored in a local Postgres; a 2 GB package goes to the right column, the FasorX server, with Caddy and login, API and Postgres with pgvector; below, the browser and the assistants
The architecture. Everything heavy, from scraper to embedding, runs on my machine. The server receives a ready-made database and only reads: nobody edits anything through the site, like a miniature arXiv.

That split was the decision that organised the project. It simplifies security, deployment and the hosting bill, and leaves the local machine free to run scripts for hours without taking anything down.

The ingestion pipeline

Vertical flow in ten stages, each with a number beside it: 20 faculty; OpenAlex with 2,796 records; checking and cleaning, 2,714 works; enrichment with 60,774 references; open PDFs through a chain and paywalled PDFs by assisted download, 1,142 open works; validation, 1,405 with full text; ingestion into 82,443 passages; embeddings in about 6 hours of CPU; derived data, 18 themes and 6 groups; a 2 GB package for the server
The whole pipeline. The only manual input is the list of names. Every stage is an idempotent, resumable script: it caches the raw response, backs up before writing and picks up where it left off. In dark blue, the two stages that turn a PDF into something searchable.

Two rules hold across the pipeline. No scraper gets around a paywall: what is paid enters as metadata, and the PDF only comes when the work is open or when the institution subscribes and a person downloads it. And nothing is lost silently: what leaves the catalogue goes into a list of exclusions with the reason.

What the checking removed and gave back

Waterfall chart of the catalogue size: 2,796 OpenAlex records; minus 200 in the first cleaning; plus 20 from one faculty member's correct profile; minus 60 that neither Lattes nor ORCID recognise; plus 204 declared DOIs; minus 48 namesakes by initial; plus 2 from the twentieth faculty member; 2,714 at the end
The catalogue as a waterfall. Gold left, blue entered. OpenAlex mixes up namesakes: one profile was a cluster of 115 theses by other people, and a common surname brought in Colombian decrees and a coin catalogue from 1907.

ORCID, through the public API, says what the researcher recognises. Lattes has a captcha, so a Firefox extension saves each CV opened and a script compares DOI and title. ORCID alone does not prove authorship, because its automatic imports bring in namesakes; in the end Lattes decides, and it gave back 204 works that OpenAlex had lost.

Where the PDFs came from

Horizontal bars with PDFs per source: institutional access with assisted download about 600, OpenAlex with a direct URL about 470, repositories of works without DOI 174, open pages 131, IOS Press 58, HAL 26, Semantic Scholar 12, arXiv 1
The sources. None solves it alone: OpenAlex's open-access URL pointed to an HTML page in 70% of cases, so the resolvers run in a chain, each only for what the previous one missed. The arXiv bar says something about the field: industrial engineering hardly uses preprints.

Downloads follow good-neighbour rules: one request every 1.5 seconds, an identified User-Agent, no retries, and the file is only saved if it starts with %PDF and is larger than 10 KB. At paywalled publishers the download is assisted: the person logs in once and the script only opens the list, one article at a time, with a pause. Those files stay on my machine; the server only receives the PDFs of open works.

From PDF to passages

A PDF page with paragraphs and a section heading on the left; on the right, three consecutive passages of about 1,800 characters, with the 200 characters of overlap marked in gold, each with the page number and the section name
Chunking. PyMuPDF reads page by page, the text becomes paragraphs and the paragraphs are packed into passages of about 500 tokens. A sentence cut at the end of one passage appears whole at the start of the next.

The section comes from a heuristic, a short line that looks like a numbered heading or a keyword, and it is what lets the search say in which part of the article an idea appears. Today there are 82,443 passages in 1,405 works with full text. Passages from the references section stay out of the search, because a bibliography matches any query.

Embeddings and what comes out of them

The model is multilingual-e5-large, with 1,024-dimensional vectors, running on the CPU through fastembed, which uses ONNX and needs no PyTorch. The vectors go into Postgres as halfvec, half precision, in a 240 MB HNSW index the server keeps in memory. A run of 34 thousand passages took close to six hours on my machine.

From the same vectors come the 18 themes, by KMeans with labels proposed by TF-IDF and revised by hand; the 11,945 affinity links between works, by nearest neighbour with a similarity of at least 0.82; and the coordinates of the maps, by UMAP in two and three dimensions. The 6 research groups were not declared: they came out of the Louvain algorithm over co-authorship among faculty.

Search flow: the query is split at AND and OR; each part takes two paths, text and vector, which meet in the RRF fusion; then the combination of the parts, the AND bonus and the result
Words and meaning. The text path requires every term; the vector path takes each work's best passage. Fusion by rank ignores the scales, which are incomparable, and rewards whoever ranks well in both lists.

The AND bonus was born from a criticism. I asked ChatGPT to use the atlas and review it, and its first remark was right: the query Digital Twin AND Multi-Objective Optimization ignored the AND. The page's search already split the query at the operators, but the MCP's search sent the whole phrase. I fixed both layers, left a base of ten evaluation queries so as not to regress, and the MCP's strict mode now tells the truth: the collection has no work with both expressions in its title or abstract.

The three maps and the reader

2D map of the atlas: thousands of dots coloured by theme forming a continuous territory
2D Map. Each dot is a publication, the colours are the 18 themes and the position comes from UMAP. The force simulation only tidies up overlaps, so the map is the same on every load.
Knowledge graph: 18 coloured clusters, one per theme, connected by thousands of thin lines
Graph. A plain-JavaScript port of the GitNexus explorer, on sigma.js and graphology. 2,752 nodes and 18,582 links by theme and authorship; weights theme 8, authorship 1 and affinity 0.3, measured outside the browser. Without them the graph turns into a ball.
3D galaxy: clouds of bright dots in spirals, one per theme, connected by thin lines
3D Galaxy. One galaxy per theme, group or faculty member, in three.js with a custom shader. The core holds the most central works, the periphery is the long tail, and the bridges are the strongest collaborations. Galaxies that are neighbours in space are themes that are neighbours in meaning.
Reading page of an article: record with authors, year, access and theme, and the text with a table of sections on the left
Reader. Record and full text in arXiv HTML style, with the structure coming from the PDF Extractor, a sister project. Open works only; the e-mails on the first page have been covered.

The MCP

Three clients, Claude, ChatGPT and Claude Code, go through one key per person and reach the /mcp endpoint, from which six tools come out: search works, who researches, work, cite, gaps and references
Six tools, one key per person. The key goes in the header or at the end of the URL, because claude.ai's panel only accepts a URL. Whoever opens the URL in a browser gets a page explaining what it is, instead of a tab loading forever.

The server's instructions tell the assistant that everything comes from this catalogue, that it is not a general literature search, and that a gap here is a gap in the programme's output, not in the literature. The best defence against an invented paper is to say where each thing came from.

Publishing on FasorX

The atlas lives on the same server as FasorX, in a compose of two hardened services, Postgres with pgvector and the API, with no Linux capabilities, a read-only filesystem and a memory cap. The code goes through GitHub Actions on every push, with the test suite first and an automatic rollback if the health check fails. The data, close to 2 GB, travels another way and is swapped in one go, by renaming. The login is FasorX's: a 5-minute token signed with RS256, checked against its public keys.

Where it still falls short

Full text covers 1,405 of the 2,714 works, and the rest depends on institutional access and a human hand. Section detection is a heuristic, and GROBID would do better. Semantic search runs the model on the CPU, and the first query after a restart takes a few seconds. And the MCP has no rate limit of its own yet.

What it cost, in hours and in tokens

Like FITradeoff, the atlas was built with Claude Code, which records the time of every message and the tokens of every response. The dollar figure in this section is not what I paid: I used a subscription plan, which is far cheaper. The number shows what the same work would cost paying Anthropic's API by usage.

It took about 45 hours of work over 16 days, between 14 October and 7 November, in 8 sessions and 234 requests, not counting pauses longer than 10 minutes. About 8 of those hours were mine, reading answers and writing requests; for the rest, the agent worked on its own. Since some sessions ran in parallel, on the wall clock it was 34 hours.

What I was asking forRequestsTimeCost (API)
Atlas interface (map, graph, galaxy, reader)61~11 hUS$ 223
Collection and PDFs (scrapers, resolvers, publishers)78~10.5 hUS$ 152
Catalogue and cleaning16~4 hUS$ 96
Reviews and fixes, including code reviews17~4.5 hUS$ 72
Search and embeddings13~2 hUS$ 63
MCP and assistants15~3.5 hUS$ 44
Publishing and security15~2.5 hUS$ 43
Documentation, questions and requests with no clear topic19~7 hUS$ 99
Total234~45 h≈ US$ 790
Two donut charts side by side, with the total in the centre of each. Time: Atlas interface 24.5%, Collection and PDFs 23.6%, Catalogue and search 12.6%, MCP, publishing and security 14.2%, Reviews and other 25.2%. Cost: Atlas interface 28.2%, Collection and PDFs 19.2%, Catalogue and search 20.1%, MCP, publishing and security 11.0%, Reviews and other 21.6%
The same breakdown in percentages, in five groups. The interface cost more than its time suggests, because every visual tweak goes through screenshots and several rounds; collection was the opposite, hours of scripts running with short requests between rounds.

It came to about 1 billion tokens, 97% of them cache reads, because on every response the model rereads the whole conversation; the text the model wrote added up to 4.1 million. Four models went through the project as they were released: Opus 4.8, Opus 5.5, Fable 5 and Fable 5.1, and the two Fables, the most expensive per token, took 63% of the cost. The whole bill came to half of FITradeoff's, which took 60 hours and US$ 1,600, largely because cache reads became much cheaper on the current models.

The prices are those of the public API price list: Fable 5.1 at US$ 10 per million input tokens and US$ 50 per million output tokens, with cache reads at US$ 0.25; Opus 5.5 at US$ 4 and US$ 20; Opus 4.8 at US$ 5 and US$ 25. I checked the formula against the total Claude Code records itself and, for the same tokens, the figures match; but its record covers only a stretch of each session, and in that stretch I counted a third more tokens than it did, so if the figures err, they err on the high side. Requests were classified automatically by their words, with short requests inheriting the topic of the previous one; I spot-checked the result.

To close

What I wanted was a single place with the group's works and the relationships between them, and it exists. You can ask in Portuguese about predictive maintenance and land on the right paragraph of an article in English, with the page; you can see that two themes that seemed distant are neighbours; and you can open Claude or ChatGPT and ask who in the programme would advise a thesis on interoperability. If you work with the scientific output of a group and want to talk about your own atlas, reach me through the contact page.

← All posts