🏆 For Judges / KB Audit (live data)
📚 Live audit · zero presupposition

The knowledge base, opened to the bone

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).

📂 3.36 GB 📋 58 tables 👁️ 3 views 📐 88 indexes 🔍 4 FTS5 📊 37.9M rows

🪪 File identity · verified live

The reference build of the database shipped with JemmaPass v1.0.14.

Pathknowledge_full.db
Size on disk3.36 GB (3,360,727,040 bytes · 820,490 × 4 KB pages) — Finder/decimal convention. Equivalent to 3.13 GiB binary.
SQLite encodingUTF-8
Page size4 096 bytes
Schema version152 (internal SQLite counter)
Build version2.0-omnis (from build_metadata)
Build timestamp2026-05-13 01:20:52 UTC
Schema design3NF normalized (ddi_facts/ddi_atc_pairs · terminology_codes/latin/cjk)
Audit tooljemma_kb_audit.py v3 · Python 3.12 · MIT

The real scale

37 million rows of curated clinical knowledge. Indexed eight ways from Sunday.

37.9M
Total rows across all tables
Grand total summed by jemma_kb_audit.py from SELECT COUNT(*) on each of the 58 tables.
876,277
DDI ATC pairs indexed
In ddi_atc_pairs · normalized join target between drug names (ATC) and the curated facts. 802,352 expand to Major+Moderate via v_ddi_emergency.
15.5M
Multilingual word index
In word_index · every clinical term across every language tied back to its UMLS CUI. Powers fuzzy search.

Top 15 tables · by row count

The biggest tables in the database. Bar width proportional to row count (log scale for readability).

word_index
15,500,225
terminology_latin_content
3,474,727
terminology_latin_docsize
3,474,727
ddi_alternatives
3,299,967
concept_relations
2,688,211
semantic_types
1,737,853
rxnorm_relations
1,587,828
terminology_codes
1,452,451
drug_attributes
879,957
ddi_atc_pairs
876,277
atc_alternatives
643,763
rxnorm_semantic_types
486,408
rxnorm_concepts
264,915
ddi_facts
260,100
terminology_cjk
160,078

The three clinical views

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_emergency

802,352 rows · Major + Moderate only

The 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.

📄 Extracted live from sqlite_master SQL
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_drug

876,277 rows · all severities

Full DDI surface — includes Minor interactions for advisory mode. Adds the ddinter_interaction_id source for traceability back to the upstream DDInter publication.

📄 Extracted live from sqlite_master SQL
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_alternatives

millions of rows · query-time JOIN

Returns 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.

📄 Extracted live from sqlite_master SQL
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

Severity distribution · how dangerous is the corpus?

Real distribution from SELECT severity, COUNT(*) GROUP BY severity on each interaction table.

ddi_facts · 260,100 curated DDI records

20.3%
74.9%
4.8%
Major: 52,813 Moderate: 194,766 Minor: 12,521

v_ddi_emergency · 802,352 actionable rules

15.2%
84.8%
Major: 122,111 Moderate: 680,241 (Minor excluded by the view)

drug_disease_interactions · 8,121 DDSI

44.5%
54.5%
1%
Major: 3,616 Moderate: 4,423 Minor: 82

interactions_food · 857 DFI

12.3%
83.3%
4.4%
Major: 105 Moderate: 714 Minor: 38

Multilingual coverage · the real langs

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 terms

es 8,020 cs 4,421 fr 4,413 pt 4,408 de 4,391 it 4,379 sv 4,333 nl 4,298 pl 4,294 ru 4,294 fi 4,274 ja 4,221 ar 3,943 et 3,943 hu 3,943 is 3,943 ko 3,943 lt 3,943 lv 3,943 no 2,389

terminology_cjk · dedicated CJK FTS5 table · 160,078 entries

ko 83,167 ja 76,911

Why 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.

Declared build languages · 25 ISO 639-2 codes

From build_metadata.build_languages:

ARA CHI CZE DUT ENG EST FIN FRE GER GRE HUN ISL ITA JPN KOR LAV LIT NOR POL POR RUS SCR SPA SWE TUR

Source provenance · where everything comes from

Auto-detected from the source column in every clinical table. Every interaction in the DB cites its source.

💊
DDInter 2.0
  • ddi_facts: 260,100 rows · 100% DDInter2
  • drug_disease_interactions: 8,121 rows · 100% DDInter2
  • interactions_food: 857 rows · 100% DDInter2
  • therapeutic_duplications: 741 rows · 100% DDInter2
🏛️
WHO references
  • who_aware_2024: 64 antibiotics · Access/Watch/Reserve classification
  • who_eml_2023: 151 essential medicines from the 23rd EML
  • allergy_cross_reactivity: 18 rules from WHO_2019
⚕️
Allergy cross-reactivity
  • 52 rules across 4 authoritative sources:
  • WHO_2019: 18 rules (34.6%)
  • UpToDate: 17 rules (32.7%)
  • ANSM_2020: 9 rules (17.3%)
  • BNF (British Nat. Formulary): 8 rules (15.4%)
🧬
HL7 IPS R4 terminology
  • ips_valuesets: 8,554 ValueSet entries
  • 98.7% SNOMED CT (8,447)
  • 0.5% HL7 RoleCode (39)
  • 0.3% LOINC (29)
  • + DICOM, RxNorm, NDC, IPS absent-unknown

SQLite latency · host-machine measurements

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).

QueryCold (ms)Warm median (ms)Table size
COUNT(*) FROM word_index1763.792025.2215,500,225
COUNT(*) FROM terminology_latin_content939.601188.973,474,727
COUNT(*) FROM terminology_codes857.72524.091,452,451
COUNT(*) FROM concept_relations541.79485.812,688,211
COUNT(*) FROM ddi_alternatives448.82546.083,299,967
COUNT(*) FROM rxnorm_relations261.34398.141,587,828
COUNT(*) FROM terminology_latin_docsize237.36205.473,474,727
COUNT(*) FROM semantic_types201.36155.151,737,853
COUNT(*) FROM ddi_atc_pairs183.21114.00876,277
COUNT(*) FROM drug_attributes94.39115.66879,957
COUNT(*) FROM v_ddi_emergency (view)1430.781228.99802,352
COUNT(*) FROM v_interactions_drug (view)3811.434765.68876,277
💡 What "COUNT(*)" tells us. A full 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.

Reproduce this report · 3 commands

📄 Step-by-step Bash
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.

📥 Download this report (53 KB) 🔧 Full reproducibility guide

What's next?

Now that you've seen the data, see how Gemma 4 queries it via 49 @Tool functions.

⚙️ Architecture 💊 DDInter compliance 📊 Benchmarks ← Hub