Every number on this page was extracted by running jemma_kb_audit.py against the real production knowledge_full.db shipped inside the APK. The script knows nothing about JemmaPass — it discovers every table, view, column, and row count via sqlite_master and PRAGMA introspection. A judge can re-run it and get byte-identical output (modulo the timestamp).
The reference build of the database shipped with JemmaPass v1.0.14.
| Path | knowledge_full.db |
| Size on disk | 3.36 GB (3,360,727,040 bytes · 820,490 × 4 KB pages) — Finder/decimal convention. Equivalent to 3.13 GiB binary. |
| SQLite encoding | UTF-8 |
| Page size | 4 096 bytes |
| Schema version | 152 (internal SQLite counter) |
| Build version | 2.0-omnis (from build_metadata) |
| Build timestamp | 2026-05-13 01:20:52 UTC |
| Schema design | 3NF normalized (ddi_facts/ddi_atc_pairs · terminology_codes/latin/cjk) |
| Audit tool | jemma_kb_audit.py v3 · Python 3.12 · MIT |
37 million rows of curated clinical knowledge. Indexed eight ways from Sunday.
jemma_kb_audit.py from SELECT COUNT(*) on each of the 58 tables.ddi_atc_pairs · normalized join target between drug names (ATC) and the curated facts. 802,352 expand to Major+Moderate via v_ddi_emergency.word_index · every clinical term across every language tied back to its UMLS CUI. Powers fuzzy search.The biggest tables in the database. Bar width proportional to row count (log scale for readability).
Views are query-ready surfaces — they don't store rows, they expose pre-joined data via stable interfaces. JemmaPass queries these from Kotlin via @Tool functions.
v_ddi_emergencyThe hot path for emergency safety checks. Inner JOIN of ddi_atc_pairs and ddi_facts, filtered to Major+Moderate severity. This is what gets queried when a rescuer scans a drug box.
CREATE VIEW v_ddi_emergency AS
SELECT p.drug_a_atc, p.drug_b_atc, f.severity, f.mechanism_category,
f.description_en, f.management_en, f.alternative_atc
FROM ddi_atc_pairs p
JOIN ddi_facts f USING (fact_id)
WHERE f.severity IN ('Major', 'Moderate')
v_interactions_drugFull DDI surface — includes Minor interactions for advisory mode. Adds the ddinter_interaction_id source for traceability back to the upstream DDInter publication.
CREATE VIEW v_interactions_drug AS
SELECT
p.drug_a_atc, p.drug_b_atc,
f.fact_id, f.severity, f.mechanism_category,
f.description_en, f.management_en, f.alternative_atc,
f.drug_a_ddinter_id, f.drug_b_ddinter_id, f.source
FROM ddi_atc_pairs p
JOIN ddi_facts f USING (fact_id)
v_safe_alternativesReturns safe substitutions for any drug flagged in a DDI. Three-way JOIN across ddi_alternatives (3.3M rows), ddi_facts, and ddinter_drugs. Powers the "what should I give instead?" answer.
CREATE VIEW v_safe_alternatives AS
SELECT
da.for_ddinter_id AS unsafe_drug,
da.alternative_ddinter_id AS safe_drug,
da.alternative_atc_class AS atc_class,
alt.name AS alt_name,
alt.primary_atc AS alt_primary_atc,
f.severity AS source_severity,
f.description_en AS source_interaction
FROM ddi_alternatives da
JOIN ddi_facts f ON f.fact_id = da.fact_id
JOIN ddinter_drugs alt ON alt.ddinter_id = da.alternative_ddinter_id
Real distribution from SELECT severity, COUNT(*) GROUP BY severity on each interaction table.
ddi_facts · 260,100 curated DDI recordsv_ddi_emergency · 802,352 actionable rulesdrug_disease_interactions · 8,121 DDSIinteractions_food · 857 DFI
Auto-detected from SELECT lang, COUNT(*) GROUP BY lang on every table with a language-like column.
ips_valuesets_translations · 20 distinct ISO codes · 85,736 translated termsterminology_cjk · dedicated CJK FTS5 table · 160,078 entriesWhy a separate CJK table? Because tokenization for Chinese/Japanese/Korean is fundamentally different from Latin scripts — they don't use whitespace word boundaries. JemmaPass ships a dedicated FTS5 index optimized for CJK substring search.
From build_metadata.build_languages:
Auto-detected from the source column in every clinical table. Every interaction in the DB cites its source.
ddi_facts: 260,100 rows · 100% DDInter2drug_disease_interactions: 8,121 rows · 100% DDInter2interactions_food: 857 rows · 100% DDInter2therapeutic_duplications: 741 rows · 100% DDInter2who_aware_2024: 64 antibiotics · Access/Watch/Reserve classificationwho_eml_2023: 151 essential medicines from the 23rd EMLallergy_cross_reactivity: 18 rules from WHO_2019ips_valuesets: 8,554 ValueSet entries
Raw SELECT COUNT(*) timings measured directly by jemma_kb_audit.py v3 on a MacBook Pro M-series SSD. Pixel 9 numbers will differ (typically 2-4× slower than M-series for unindexed scans, faster for indexed point lookups due to OS page cache locality).
| Query | Cold (ms) | Warm median (ms) | Table size |
|---|---|---|---|
COUNT(*) FROM word_index | 1763.79 | 2025.22 | 15,500,225 |
COUNT(*) FROM terminology_latin_content | 939.60 | 1188.97 | 3,474,727 |
COUNT(*) FROM terminology_codes | 857.72 | 524.09 | 1,452,451 |
COUNT(*) FROM concept_relations | 541.79 | 485.81 | 2,688,211 |
COUNT(*) FROM ddi_alternatives | 448.82 | 546.08 | 3,299,967 |
COUNT(*) FROM rxnorm_relations | 261.34 | 398.14 | 1,587,828 |
COUNT(*) FROM terminology_latin_docsize | 237.36 | 205.47 | 3,474,727 |
COUNT(*) FROM semantic_types | 201.36 | 155.15 | 1,737,853 |
COUNT(*) FROM ddi_atc_pairs | 183.21 | 114.00 | 876,277 |
COUNT(*) FROM drug_attributes | 94.39 | 115.66 | 879,957 |
COUNT(*) FROM v_ddi_emergency (view) | 1430.78 | 1228.99 | 802,352 |
COUNT(*) FROM v_interactions_drug (view) | 3811.43 | 4765.68 | 876,277 |
COUNT(*) requires a full table or full index scan — it's the worst case. The clinical queries JemmaPass actually issues at runtime (a point lookup on ddi_atc_pairs(drug_a_atc, drug_b_atc)) hit an indexed B-tree in <1ms, not the 183ms shown above. The COUNT figures bound the upper end of the latency envelope.
git clone https://github.com/kurodohenroonsen/JemmaPass.git
cd jemmapass/scripts
python3 jemma_kb_audit.py --db /path/to/knowledge_full.db --skip-sha256
Output: kb_audit.md next to the DB. Should take 1-3 minutes including all per-table scans. The tool ships as a single 600-line Python file with stdlib-only dependencies — no pip install required. Opens the DB in mode=ro&immutable=1, so zero write risk.
Now that you've seen the data, see how Gemma 4 queries it via 49 @Tool functions.