tsukineko-grimoire: Tsukineko Grimoire: The RAG System That Turns arXiv Into a Bilingual Research Shelf

A smart archive for papers, figures, and cited answers, built to bridge Japanese researchers into an English-dominated literature stream.

9 min read • View on GitHub • More from nekoai-lab

A researcher sits at a desk between two stacked trays of papers. One tray is a crowded archive with loose sheets and diagrams, while the other is a curated shelf with annotated folders, translated slips, and bookmarked pages. The scene explains how the project turns a paper firehose into a working research space.
Tsukineko Grimoire treats retrieval as curation. The point is not just finding papers, but making them usable across languages and across sessions.
Key Takeaways

Why This Is More Than a Paper Chatbot

Most RAG apps promise the same thing: drop in documents, ask questions, get answers. Tsukineko Grimoire aims at a harder problem. It helps a Japanese reader work inside an English-heavy research stream without constantly switching tools or losing the trail of evidence.

That changes the product shape. The system does not just search arXiv. It translates, routes, cites, saves, and revisits. In other words, it behaves less like a chatbot and more like a research workspace.

Archive vs. Shelf

The repo’s sharpest idea is the split between Archive and Shelf. The Archive is the broad corpus of ingested papers. The Shelf is the user’s curated set of papers that matter enough to keep close.

DimensionArchiveShelf
PurposeGlobal corpus of papersPersonal working collection
User behaviorSearch and browseSave, return, and annotate
Product feelReference layerResearch memory
ValueCoverageContinuity

That distinction matters because it pushes the app past disposable retrieval. A researcher is not just asking, “What does the corpus know?” They are also asking, “What have I already decided is worth carrying forward?” Tsukineko Grimoire makes room for both.

A close-up mechanical conveyor processes an arXiv paper from clean HTML into translated, annotated research cards. Figure thumbnails are routed into a separate drawer, while the main page passes through a translation press and emerges with citation pins and highlighted evidence snippets. The image explains why HTML-first ingestion and figure-aware extraction matter.
The ingestion pipeline starts with cleaner HTML when it can, then falls back to PDF parsing. That keeps downstream retrieval closer to the original structure of the paper.

The Retrieval Loop That Actually Speaks Japanese

The most interesting flow in the project starts with a Japanese question and does not end there. The system classifies the query, translates it for retrieval when needed, pulls from English-centric research sources, and then shapes the answer to fit the question type.

The app is opinionated about questions. It does not treat every prompt like the same retrieval problem.

That routing matters because not every research question wants the same kind of evidence. A comparison question wants structure. A mechanism question wants a chain of causes. A practical question wants action-oriented guidance. Tsukineko Grimoire treats those as different jobs, not as one generic prompt.

How the query type changes the answer

Query modeWhat it optimizes forWhat it changes
OverviewFast orientationBroader retrieval and concise framing
DefinitionClean concept explanationTighter scope and direct wording
MechanismHow something worksMore evidence and denser context
ComparisonDifferences between ideasTable-friendly formatting
PracticalWhat to do nextActionable output
ResearchDeeper studyMore exhaustive retrieval
const queryType = detectQueryType(q);
const config = getQueryConfig(queryType);
const englishQuery = needsTranslation(q) ? await translateToEnglish(q) : q;
const evidence = await retrieve(englishQuery, config);
return formatAnswer(evidence, queryType);

Why Figures and Tables Matter in RAG

The repo is not satisfied with text chunks alone. It scans arXiv HTML for figures and tables, scores captions, and proxies images safely into the UI. That gives the model more than prose. It gives it visual evidence.

This is a meaningful step up from the usual document chatbot. In research, a figure often carries the claim. A table often carries the comparison. If the system can surface those objects alongside the text, the answer becomes easier to trust.

The Production Choices That Make It Feel Real

The codebase reads like something built by someone who knows where prototypes usually fail. Translation is cached in Firestore by hash. Session handling is pushed through middleware with an eye on Edge Runtime limits. The app is deployed for Cloud Run, not left as a local demo.

That is what gives the project credibility. It is not trying to impress with novelty alone. It is trying to be usable, repeatable, and cheap enough to run.

What It Looks Like Next to a Generic RAG App

DimensionGeneric RAG chatbotTsukineko Grimoire
Input handlingUser asks one question, system retrieves chunksClassifies intent, translates when needed, then retrieves
EvidenceMostly text snippetsText, figures, tables, cited snippets
PersistenceOften session-boundArchive plus personal Shelf
Language supportUsually English-firstBuilt to reduce Japanese-English friction
Operational maturityPrototype-likeCaching, Cloud Run, Firebase, middleware

That is the real distinction. Tsukineko Grimoire is not trying to be a smarter prompt wrapper. It is trying to become a durable research workflow for a specific kind of user, with enough structure to keep the evidence alive after the answer is generated.