跪拜 Guibai
← All articles
Vue.js · GitHub · Front-end

Open-Source JitArchives Runs AI Archive Search on SQLite, Not a Vector Database

By 徐小夕 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Compliance-sensitive teams can get AI-assisted archive search without standing up vector or graph databases: JitArchives shows that a single SQLite file plus a read-only, evidence-citing Agent is a workable trade-off, even though semantic depth and fine-grained ACL control are sacrificed.

Summary

JitArchives, built on the JitWord collaborative document SDK, targets organizations that have to manage credentials and audit trails: contracts, project files, administrative and financial records. It covers the full archival lifecycle, including cataloging, classification, filing review, borrowing approval, permission control and audit logging, then adds two AI features on top. An archive Agent answers natural-language questions by searching metadata and attachment text inside the user's permission scope, checks whether evidence is sufficient before responding, and attaches a source location to every conclusion. It has read-only access and no path to modify or delete records. A knowledge graph models categories, archives, attachments and text chunks as nodes, keeping structural relations trusted and text-similarity relations computed from CJK Bigram + TF-IDF cosine similarity, explicitly flagged as clues that need human verification.

Search and similarity run on SQLite's built-in FTS5 with BM25 ranking and application-layer TF-IDF, so there is no separate vector or graph database. Deployment shrinks to a single-file database, which drops the ops burden for small units without dedicated middleware staff. The trade-off is acknowledged: lexical retrieval lacks the semantic generalization of embedding-based vectors, and scanned image PDFs cannot be text-extracted, so they never enter Agent search. The stack is Vue3 + TypeScript, NestJS, SQLite by default, plus an OpenAI-compatible model API that receives only permission-filtered snippets, never direct database or file access. Indexes are derived data and can be rebuilt without touching original files; business changes and audit logs write in the same transaction.

Limitations are spelled out: no fine-grained ACL beyond role and access level, production HTTPS and security headers left to ops, and text-similarity edges are only clues. JitArchives is positioned as an open-source base for small and mid-size organizations, not as a substitute for commercial archive systems.

Takeaways
— JitArchives uses SQLite FTS5 with BM25 ranking for full-text search and CJK Bigram + TF-IDF cosine similarity for text relations, with no dedicated vector or graph database.
— The archive Agent is read-only: it queries only within the user's permissions, evaluates evidence sufficiency, cites source locations, and states when evidence is insufficient rather than inventing answers.
— Filing locks a document snapshot as the official archive version; archived records are read-only and cannot be casually modified.
— All attachment previews and downloads pass backend permission checks, and download can be blocked at both the UI and API levels.
— Audit logs write in the same transaction as business changes, covering login, modification, filing, borrowing and download, with filtering and export.
— Architecture is Vue3 + TypeScript frontend, NestJS backend, SQLite default, and an OpenAI-compatible model API that only receives permission-filtered snippets, never direct database or file access.
— Index data is derived and can be fully rebuilt; original archive files stay decoupled from indexes.
— Recognized limitations: lexical retrieval lacks semantic generalization, scanned image PDFs cannot be text-extracted, text-similarity graph edges are only clues, no fine-grained ACL, and production hardening is left to ops.
Conclusions

The design inverts the usual RAG priorities: it treats the LLM as a tool that must justify every sentence with a citation, not as a knowledge source, which is a direct answer to hallucination risk in archival settings.

Separating structural relations from text-similarity relations keeps the knowledge graph honest, but it shifts verification work onto users, so the graph accelerates discovery more than it automates judgement.

The SQLite-only stack makes AI archive search practical where dedicated middleware is not an option, but the admitted trade-offs mean the tool pays off mainly for born-digital records and queries that lexically match the source text.

Concepts & terms
SQLite FTS5
SQLite's built-in full-text search engine, used here with BM25 ranking to search archive metadata and extracted text without a separate search or vector database.
CJK Bigram + TF-IDF cosine similarity
A lexical similarity technique that splits Chinese/Japanese/Korean text into overlapping two-character token pairs and measures cosine distance between TF-IDF vectors; JitArchives uses it to generate text-similarity edges in the knowledge graph.
Archive knowledge graph
A graph in which categories, archives, attachments and text blocks are nodes; structural edges are trusted, while text-similarity edges are labeled as clues for human verification.
Evidence-driven Agent
A read-only AI assistant that searches only within the user's permission scope, assesses evidence sufficiency, answers with citations, and explicitly refuses to speculate when evidence is insufficient.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗