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.
- Tsukineko Grimoire is built around a multilingual research loop, not a generic question box.
- Its Archive vs. Shelf model turns paper retrieval into a persistent workflow instead of disposable chat.
- The app’s strongest technical choice is HTML-first ingestion, which makes figures, tables, and text easier to reuse as evidence.
- Query routing and translation caching make the system feel opinionated, not merely connected to a vector index.
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.
| Dimension | Archive | Shelf |
|---|---|---|
| Purpose | Global corpus of papers | Personal working collection |
| User behavior | Search and browse | Save, return, and annotate |
| Product feel | Reference layer | Research memory |
| Value | Coverage | Continuity |
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.
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.
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 mode | What it optimizes for | What it changes |
|---|---|---|
| Overview | Fast orientation | Broader retrieval and concise framing |
| Definition | Clean concept explanation | Tighter scope and direct wording |
| Mechanism | How something works | More evidence and denser context |
| Comparison | Differences between ideas | Table-friendly formatting |
| Practical | What to do next | Actionable output |
| Research | Deeper study | More 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
| Dimension | Generic RAG chatbot | Tsukineko Grimoire |
|---|---|---|
| Input handling | User asks one question, system retrieves chunks | Classifies intent, translates when needed, then retrieves |
| Evidence | Mostly text snippets | Text, figures, tables, cited snippets |
| Persistence | Often session-bound | Archive plus personal Shelf |
| Language support | Usually English-first | Built to reduce Japanese-English friction |
| Operational maturity | Prototype-like | Caching, 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.





