THE MISSION / CLINICAL INTELLIGENCE WITH HUMAN AUTHORITY
Sentrapedia is an Indonesia-first clinical reasoning and documentation workspace for clinical consultations entered without patient identity. It connects a question or clinical presentation to structured differential considerations, diagnostic workup, inspectable reference evidence and an editable document—without moving the final decision away from the clinician.
The application speaks primarily in Bahasa Indonesia, retaining familiar English medical terminology where clinically useful. It brings encounter context, disease references, source-grounded reasoning, document templates and draft revision into a single operator workflow. It is a development-stage clinical intelligence product, not a general-purpose chatbot, autonomous diagnostic system or deployed EHR.
The problem is not a shortage of generated medical text. It is the difficulty of connecting a clinical question to its original context, the evidence consulted, the reasoning presented, and the person accountable for the decision.
The purpose is to make that chain visible—without presenting an experimental model as a clinician, an unreviewed reference as a verified guideline, or a development workspace as a production EHR.
Designed for: clinicians consulting on cases entered without patient identity, and developers of the documentation workflows. Final authority: the reviewing clinician for clinical interpretation; the authorized owner for high-impact system decisions.
Current scope: patients and encounters recorded without identity, drafts and templates, clinical work tasks, optional dictation, local exports, Oracle reference search, TheOracle source grounding, managed AADI analysis and human review.
Outside scope: identifiable patient records, prescribing automation, autonomous medical decisions, production EHR integration, clinical certification and clinical validation.
Sentrapedia is one sovereign product capsule and one future repository. The clinical workspace currently remains at the capsule root. The public marketing website lives in apps/site, with its own static source, assets, site-specific SPDS documentation, and local verification scripts. A future demo belongs under apps/demo/ as configuration plus synthetic data around shared product code.
01 / WORKSPACE — Organize cases, notes, templates, tasks, drafts and revisions.
02 / ORACLE + THEORACLE — Search the bundled disease catalog and trace supporting source evidence with explicit review limits.
03 / AADI — Produce structured case-analysis drafts through a managed engine; retain validation and clinician review as separate steps.
ONE WORKSPACE · THREE DISTINCT RESPONSIBILITIES · HUMAN-GOVERNED
A clinician's question rarely ends with a single answer. It usually progresses through case synthesis → differential diagnosis → uncertainty and red flags → diagnostic next steps → evidence inspection → a reviewable note. When those steps sit in disconnected tools, the operator must repeatedly restate the case, reconstruct why a possibility was considered and manually reconnect a recommendation to its source.
Sentrapedia's product direction is to make that reasoning path a first-class part of the workspace: the case, questions, candidate interpretations, source provenance and editable output should stay meaningfully connected. The current build implements selected parts of this journey for cases without patient identity; it does not claim medically validated end-to-end automation.
| Clinical task | Operator's question | Available product surface | Human checkpoint |
|---|---|---|---|
| Clinical consultation | What does this presentation raise, and what information is missing? | AADI clinical Q&A; inspectable context and available source grounding | Check assumptions, source quality and applicability |
| Differential diagnosis | What alternative explanations should be considered? | Structured DDx drafting from the case context | Re-rank or reject candidates; assess safety-critical omissions |
| Diagnostic workup | What questions or investigations might distinguish the candidates? | AADI workup draft and reference inspection | Judge necessity, feasibility, urgency and local standards |
| Referral assessment | Does the case warrant referral consideration, and what should the handoff contain? | AADI referral/disposition analysis draft | Verify necessity, disposition and handoff information |
| Classification | Which diagnostic coding candidates could describe the documented condition? | AADI ICD-10 candidate drafting | Confirm coding rules, specificity and documentation |
| Clinical documentation | How can the encounter become a usable note? | Built-in document modes, local templates, editable drafts and revisions | Approve wording, facts, interpretation and final use |
These are separate capabilities, not a claim that all modes invoke the same model or that every answer has an authoritative citation. The repository contains 18 built-in document modes; five explicit modes route through AADI. Some document operations are local and deterministic.
The following is an illustrative operator journey, not a recorded clinical validation, benchmark or autonomous care pathway.
- Capture context. Open an encounter and enter a non-identifying chief complaint, chronology, examination findings and relevant history.
- Ask a focused clinical question. Use the clinical Q&A or differential mode to turn that context into a structured inquiry, not a final diagnosis.
- Explore the possibilities. Examine provisional alternatives, missing discriminating information and any warnings or uncertainty presented in the draft.
- Inspect the evidence. Review Oracle disease catalog context and TheOracle provenance-linked passages where valid sources are available; source presence does not establish source correctness.
- Draft the next artifact. Use a workup or referral-assessment inquiry, then shape the results into an appropriate editable documentation format.
- Review and revise. Inspect source snapshots, trace metadata and the clinical content itself. The model's schema checks are not a clinical sign-off.
- Keep accountability visible. The case remains subject to clinician review; every output is a draft, and the clinical decision stays with the reviewing clinician.
- Language and workflow: the interface is primarily Bahasa Indonesia and is framed around clinician-readable medical documentation rather than generic AI chat responses.
- Clinical reasoning as the center: question answering, differential analysis, source inspection and drafting are adjacent activities rather than unrelated text-generation demos.
- Evidence transparency: TheOracle retains index, embedding-model and chunk-hash metadata so operators can examine provenance and recognize when retrieval is missing or uncertain.
- Professional accountability: the product keeps the reviewing clinician in the decision loop; the agent proposes, the operator evaluates.
- Important distinction: Indonesia-first does not mean the available corpus has been exhaustively validated against Indonesian national guidelines, that terminology/coding is certified, or that the software integrates with SATUSEHAT, BPJS or a production RME.
PRODUCT HORIZON // VISION VS. CURRENT BUILD
Implemented or configured in this repository: local encounter workspace; document templates; Oracle disease catalog; TheOracle read-only local vector retrieval; bundled AADI case modes; schema/identity gates; edit-and-review workflows; local exports and limited runtime trace information.
Still requires independent engineering and validation before any real-world clinical application: secure patient identity and access controls; compliant personal-data processing and retention; formally curated Indonesian clinical evidence; evaluation of medical correctness, bias, red flags and failure modes; oversight and regulatory assessment; robust multiuser infrastructure; institution-approved RME interoperability; real-case pilots and explicit clinician/owner authorization.
No timeline, certification, institution, clinical outcome or interoperability claim is implied by this direction.
Important
The system may draft a clinical interpretation. It cannot authorize a clinical decision. Sentrapedia accepts cases without patient identity and is not a clinically validated diagnosis or treatment service.
SOURCE BEFORE CERTAINTYPreserve source IDs, page positions, hashes and uncertainty. A text match is not clinical proof. |
MANAGED, NOT HIDDENOne supervisor owns AADI startup, profile/readiness checks, and coordinated shutdown. |
NO PATIENT IDENTITYSame-origin checks and layered identity-pattern screening; since 2026-10-26 no case is declared fictional. |
REVIEW BEFORE ACTIONResult metadata and draft revisions remain inspectable. Missing clinical information is not silently invented. |
ONE PROBLEM, THEN DEPTHProve the encounter-review workflow before any clinical expansion. |
NO MAGIC WITHOUT AUDITSeparate configured controls, executed software tests, source quality and clinical accuracy. |
PRODUCT TOPOLOGY // SOURCE-AWARE CLINICAL WORKSPACE
%%{init: {"flowchart": {"htmlLabels": false, "padding": 20}, "themeVariables": {"fontFamily": "monospace", "fontSize": "11px"}}}%%
flowchart TB
HUMAN["CLINICIAN / OPERATOR"]
UI["SENTRAPEDIA WEB WORKSPACE"]
LOCAL["LOCAL TEMPLATES + WORK QUEUE"]
STORE[("BROWSER LOCAL STORAGE")]
CATALOG[("ORACLE DISEASE JSON")]
GATE["NEXT.JS /api/aadi + INPUT GATES"]
SOURCE[("THEORACLE VECTOR INDEX / SOURCE EVIDENCE")]
AADI["BUNDLED AADI / PYTHON"]
PROVIDER["GEMINI API / GEMINI 3.1 FLASH-LITE"]
DRAFT["VALIDATED DRAFT + SOURCE SNAPSHOT"]
REVIEW["HUMAN CLINICAL REVIEW"]
FAIL["REJECT / EXPOSE UNCERTAINTY"]
HUMAN --> UI --> LOCAL --> STORE
CATALOG --> UI
UI --> GATE
SOURCE --> GATE
GATE --> AADI
AADI <--> PROVIDER
AADI --> DRAFT --> UI
UI --> REVIEW
GATE -. invalid / missing source .-> FAIL
AADI -. provider error .-> FAIL
classDef authority fill:#0D1117,stroke:#F59E0B,color:#FFFFFF,stroke-width:2px;
classDef core fill:#0D1117,stroke:#5B8CFF,color:#FFFFFF,stroke-width:2px;
classDef surface fill:#0D1117,stroke:#22D3EE,color:#FFFFFF,stroke-width:1.5px;
classDef agent fill:#0D1117,stroke:#8B5CF6,color:#FFFFFF,stroke-width:2px;
classDef control fill:#0D1117,stroke:#14B8A6,color:#FFFFFF,stroke-width:2px;
classDef data fill:#0D1117,stroke:#0EA5E9,color:#FFFFFF,stroke-width:1.5px;
classDef shared fill:#0D1117,stroke:#64748B,color:#FFFFFF,stroke-width:1.5px;
classDef danger fill:#0D1117,stroke:#EF4444,color:#FFFFFF,stroke-width:2px;
class HUMAN,REVIEW authority;
class UI,LOCAL,DRAFT surface;
class GATE control;
class AADI agent;
class CATALOG,STORE,SOURCE data;
class PROVIDER shared;
class FAIL danger;
01 · WORKSPACEPatients, lists, encounters, tasks, templates, draft review and backups. IMPLEMENTED · src/components · src/lib/workspace.ts |
02 · ORACLE CATALOG329 disease records across 21 categories (ICD-10 chapters), derived from the knowledge SSOT, searchable by name, code and category. IMPLEMENTED · oracle/sentrapedia.json · src/lib/theoracle.ts |
03 · THEORACLELocal vector retrieval (EmbeddingGemma-300m on this machine) with index, model and per-passage hashes and bounded passages. IMPLEMENTED · theoracle · src/lib/theoracle-grounding.ts |
04 · AADIBundled FastAPI engine, schema validation, privacy checks, model calls and budget ledger. IMPLEMENTED · aadi/service · scripts/run-system.mjs |
05 · DRAFT PRESENTATIONResponse sections, case/trace/source snapshot, editable content, revisions and review checklist. IMPLEMENTED · src/lib/aadi/presentation.ts · src/lib/workflow.ts |
06 · SUPERVISORCapsule-owned Python environment, private loopback channel, readiness verification and paired shutdown. IMPLEMENTED · scripts/install-aadi.mjs · scripts/build-system.mjs |
| Capability | Status | Evidence | Boundary |
|---|---|---|---|
| Patient / encounter / list workflows | IMPLEMENTED | src/lib/workspace.ts |
No patient identity, browser-local, unencrypted |
| 18 built-in document modes | IMPLEMENTED | src/lib/drafts.ts |
Not every mode uses AI |
| Five AADI-routed modes: question, DDx, workup, referral review, ICD-10 | IMPLEMENTED | src/lib/aadi/composer.ts |
Cases without patient identity |
| Templates, revisions, checklist, export | IMPLEMENTED | src/lib/workflow.ts · src/components/workspace.tsx |
Review status is not clinical authorization |
| Oracle local disease search | IMPLEMENTED | src/lib/theoracle.ts |
Narratives not certified PNPK citations |
| TheOracle grounding / provenance | IMPLEMENTED | src/lib/theoracle-grounding.ts |
SSOT clinically reviewed by Gaffer (2026-10-23); passages are references, not prescriptions |
| Managed AADI standalone lifecycle | HISTORICALLY VERIFIED | docs/verification/2026-10-10-integrated-aadi.md |
Local/extracted runtime proof only |
| Optional browser dictation | IMPLEMENTED | src/components/use-dictation.ts |
Vendor-dependent speech privacy |
| EHR integration, clinical validation | NOT ESTABLISHED | docs/data.md · docs/aadi-integration.md |
Not clinically validated |
APPLICATIONNext.js 16.4.0 · React 19.3.0 · TypeScript · Lucide · local Sentra CSS tokens. |
REASONINGPython 3.11+ · FastAPI · Uvicorn · OpenAI Python SDK on the Gemini API · JSON schema · openai-standard-retention data policy. |
EVIDENCEOracle JSON · TheOracle vector index · source hashes · browser localStorage · AADI audit ledger. |
RUNTIME TOPOLOGY // ONE MANAGED LIFECYCLE
%%{init: {"flowchart": {"htmlLabels": false, "padding": 20}, "themeVariables": {"fontFamily": "monospace", "fontSize": "11px"}}}%%
flowchart TB
OP["OPERATOR"]
INSTALL["npm ci / CAPSULE-LOCAL PYTHON"]
SUP["NODE SUPERVISOR"]
PREFLIGHT["PUBLIC MODEL METADATA + PRICE CHECK"]
ENGINE["AADI / EPHEMERAL LOOPBACK"]
WEB["NEXT.JS WORKSPACE / 3101"]
API["SAME-ORIGIN GATEWAY"]
SQL[("THEORACLE VECTOR INDEX")]
BROWSER[("BROWSER localStorage")]
CLOUD["GEMINI API PROVIDER"]
STOP["PAIRED SHUTDOWN"]
OP --> INSTALL --> SUP --> PREFLIGHT --> ENGINE
ENGINE --> WEB --> API
SQL --> API
WEB --> BROWSER
API --> ENGINE
ENGINE <--> CLOUD
SUP -. owns children .-> STOP
STOP -. stops .-> ENGINE
STOP -. stops .-> WEB
classDef authority fill:#0D1117,stroke:#F59E0B,color:#FFFFFF,stroke-width:2px;
classDef core fill:#0D1117,stroke:#5B8CFF,color:#FFFFFF,stroke-width:2px;
classDef surface fill:#0D1117,stroke:#22D3EE,color:#FFFFFF,stroke-width:1.5px;
classDef agent fill:#0D1117,stroke:#8B5CF6,color:#FFFFFF,stroke-width:2px;
classDef control fill:#0D1117,stroke:#14B8A6,color:#FFFFFF,stroke-width:2px;
classDef data fill:#0D1117,stroke:#0EA5E9,color:#FFFFFF,stroke-width:1.5px;
classDef shared fill:#0D1117,stroke:#64748B,color:#FFFFFF,stroke-width:1.5px;
class OP authority;
class INSTALL,SUP core;
class PREFLIGHT,STOP control;
class ENGINE agent;
class WEB,API surface;
class SQL,BROWSER data;
class CLOUD shared;
npm ci --workspaces=false installs Node dependencies and the locked Python environment in .runtime/aadi/venv. scripts/run-system.mjs then checks public model metadata, generates a private loopback token and port, starts AADI, verifies its profile/grounding capability, and launches the web interface. Historical connection settings are overridden in memory; a sibling AADI repository is not required. See the current integration contract.
Model selection: gemini-3.1-flash-lite is configured for planning and assessment, called directly on the Gemini API with GEMINI_API_KEY (no OpenRouter), alongside provisional differentials and fast assessment/therapy (fastCopies in scripts/aadi-profile.json sets how many copies of each raced part are sent; the engine default is 3). Configured guards include US$0.10 per step, US$5 daily ledger, 20-second engine deadline, and 45-second gateway deadline (65 seconds on the default targeted path, which runs two steps). These are limits and targets, not guaranteed speed or charges. Zero-data-retention protection must not be assumed. Source.
Five explicit inquiry modes are connected to the managed AADI pathway. The input is an encounter or question without patient identity, screened by the same-origin gateway and the Python service before external model inference. Returned text is a draft to inspect.
| Mode | Intended operator task | Interpretation boundary |
|---|---|---|
| Clinical question | Frame a specific inquiry using available case details and evidence context | Do not confuse a fluent answer with a validated clinical conclusion |
| Differential diagnosis (DDx) | Explore plausible alternatives and reasoning against the presentation | Missing red flags and overlooked diagnoses remain clinical risks |
| Diagnostic workup | Draft information-gathering or investigation considerations | Not an order set; no automatic tests, medications or procedures |
Referral assessment (refer) |
Draft referral considerations and disposition for the case | Does not send, authorize or validate a real referral |
| ICD-10 | Draft diagnostic classification candidates | No billing, regulatory or coding-accuracy certification |
The separate document workspace contains 18 built-in document modes and local formatting functions. Do not interpret the combined count as 23 independently validated AI products: AADI inquiry modes and note/template modes solve related but different jobs.
Oracle / reference discovery. A bundled JSON disease catalog supports quick search by name, code and category. Its 329 records across 21 categories (the ICD-10 chapter of each entry's first code) are catalog data, not an assertion that the reference is exhaustive or nationally endorsed.
TheOracle / evidence provenance. Local vector retrieval over a manifest-verified index provides bounded passages with index, embedding-model and chunk-hash context; the case text is embedded on this machine and never leaves it for retrieval. Evidence is available only where source ingestion and quality gates support it. A match can be absent, outdated, partial or misleading, and machine-selected excerpts are not automatically clinician-approved.
AADI / provisional synthesis. The Python reasoning service synthesizes available case context and bounded references through configured model access and structured response contracts. A coherent draft, schema-valid output, and successful provider call are three different facts—none alone proves medical validity.
Sentrapedia/
├── AGENTS.md # Project-specific operator instructions
├── README.md # Sentra product documentation
├── project.contract.json # Independent execution and smoke contracts
├── capsule.json # Capsule risk and dependency boundaries
├── package.json / package-lock.json
├── .env.example / Dockerfile / next.config.ts
├── scripts/ # Install, launch, build, test, dry-run
├── src/
│ ├── app/api/aadi/route.ts # Gateway endpoints
│ ├── app/icon.png # Product icon, Git LFS
│ ├── components/ # Clinical UI
│ ├── lib/aadi/ # Client, contract, gateway, presentation
│ ├── lib/theoracle-grounding.ts # Read-only retrieval
│ └── app/sentra-tokens.css # Local token snapshot
├── oracle/ # Disease reference JSON
├── theoracle/ # TheOracle: knowledge SSOT, derived index (chunks, vectors, manifest), model (installed)
├── aadi/ # Bundled Python service and locks
├── tests/ # App, gateway and supervisor tests
└── docs/ # Architecture and dated evidence reports
capsule.json declares rootDependencies: []. Dependency lockfiles, source copies, tokens, runtime scripts, and packaging belong to the capsule. Standalone independence was tested in a dated extracted environment, not inferred from file layout alone.
%%{init: {"flowchart": {"htmlLabels": false, "padding": 20}, "themeVariables": {"fontFamily": "monospace", "fontSize": "11px"}}}%%
flowchart TB
HUMAN["CASE / CLINICIAN"]
INPUT["PROMPT + ENCOUNTER CONTEXT"]
GATE["PATIENT-IDENTITY CHECKS"]
API["LOCAL /api/aadi"]
SOURCE["THEORACLE LOCAL VECTOR SEARCH + HASH VERIFICATION"]
ENGINE["AADI CONTRACT + POLICY"]
MODEL["GEMINI API / GEMINI 3.1 FLASH-LITE"]
VERIFY["SCHEMA + MODEL + COST VALIDATION"]
DRAFT["EDITABLE DRAFT + TRACE SNAPSHOT"]
REVIEW["CLINICIAN REVIEW"]
STOP["REJECT / KEEP PROMPT / EXPOSE FAILURE"]
HUMAN --> INPUT --> GATE --> API --> SOURCE --> ENGINE --> MODEL --> VERIFY --> DRAFT --> REVIEW
GATE -. invalid input .-> STOP
SOURCE -. no match / invalid source .-> STOP
ENGINE -. quota / provider error .-> STOP
VERIFY -. invalid output .-> STOP
classDef authority fill:#0D1117,stroke:#F59E0B,color:#FFFFFF,stroke-width:2px;
classDef surface fill:#0D1117,stroke:#22D3EE,color:#FFFFFF,stroke-width:1.5px;
classDef core fill:#0D1117,stroke:#5B8CFF,color:#FFFFFF,stroke-width:2px;
classDef agent fill:#0D1117,stroke:#8B5CF6,color:#FFFFFF,stroke-width:2px;
classDef control fill:#0D1117,stroke:#14B8A6,color:#FFFFFF,stroke-width:2px;
classDef data fill:#0D1117,stroke:#0EA5E9,color:#FFFFFF,stroke-width:1.5px;
classDef danger fill:#0D1117,stroke:#EF4444,color:#FFFFFF,stroke-width:2px;
class HUMAN,REVIEW authority;
class INPUT,DRAFT surface;
class GATE,VERIFY control;
class API core;
class SOURCE data;
class ENGINE,MODEL agent;
class STOP danger;
The client constructs a case from the complaint, any recorded numeric age/sex, encounter context and notes—not patient name/ID. The client, same-origin gateway and Python service enforce layered input checks. TheOracle retrieves no more than six bounded source passages (two per document) and verifies index and model hashes before the call. The returned structure and model/cost metadata are checked before saving a reviewable draft with trace, timestamp and source snapshot.
Missing source matches, budget exhaustion, bad output, provider failure, identity-pattern rejection and cancellation do not create fabricated draft responses; the prompt is preserved for review. Identity regexes are not certified anonymization. Other document modes and personal templates can use deterministic formatting without paid inference.
A useful result is more than generated prose. Review the case context supplied to the model, source passages and provenance attached to the request, drafted reasoning or classification, missing information or uncertainty, and trace/revision metadata retained by the application.
| Signal | What it supports | What it does not establish |
|---|---|---|
| Schema-valid response | Expected machine-readable response structure was accepted | Correct medical reasoning or diagnosis |
| Source hash and page | Traceability to an indexed passage | Current guideline status, peer review or clinical relevance |
| Model/cost trace | Inspectability of a particular run and budget behavior | Accuracy, fairness, privacy guarantees or determinism |
| Edited draft and checklist | Document revision and a place for human inspection | A signed patient record or formal electronic signature |
Review rule: when the case lacks critical information, a retrieval is absent, or the answer conflicts with professional judgment, keep the uncertainty visible and do not turn the draft into a clinical instruction. A rejected or failed request must never be silently represented as successful reasoning.
- Node.js 24+, Python 3.11+ with venv support, and npm (contract specifies version 11.19.0).
- npm, PyPI and Hugging Face access during install:
npm ciruns a postinstall that builds the AADI Python environment under.runtime/aadi/venvand downloads the pinned TheOracle embedding model once (about 1.2 GB) intotheoracle/model/. - The Gemini API must be reachable on startup: the engine reads the model's metadata with the key before it accepts a case.
- Server-side
GEMINI_API_KEY(paid tier) with Gemini API billing enabled for AI analysis. - A local machine; the default HTTP listener is
127.0.0.1:3101.
git clone <this repository's URL> Sentrapedia
cd Sentrapedia
npm ci --workspaces=falseRecommended once per clone: git config core.hooksPath .githooks, so a commit that stages a secret or a local data file is refused (scripts/secret-scan.mjs).
Create .env.local using the keys shown in .env.example, or inject GEMINI_API_KEY into the process environment. Never commit real keys. The supervisor generates the internal AADI URL/token automatically; do not configure an external AADI checkout.
This repository holds the code only. The TheOracle knowledge base (its knowledge source, search index and guideline library), the disease catalogue and the ICD-10 code list are private and are not covered by the LICENSE; for access, contact info@sentrapedia.com. In their place the repository carries two clearly marked samples, oracle/sentrapedia.sample.json (two fictional diseases) and aadi/service/data/icd10.sample.json (ten common codes), so npm ci, npm run build and the tests work on a fresh clone.
A build from this repository therefore runs on sample data and refuses real analyses: the case form answers "Database Oracle belum terpasang di server ini. Analisis tidak dijalankan." and the disease library shows "Katalog contoh". A licensed installation reads the private files at run time from the folder named by SENTRAPEDIA_DATA_DIR (same relative paths: theoracle/index/, oracle/sentrapedia.json, aadi/service/data/icd10.json); they are never copied into a build or a Docker image. npm run deploy:dry-run includes a leak guard (scripts/leak-guard.mjs) that fails if a private file or catalogue text appears in the tree or the build.
| Variable / file | Required | Purpose | Boundary |
|---|---|---|---|
GEMINI_API_KEY |
Yes for integrated runtime | Provider credential | Server only, secret |
.env.local |
Optional file | Capsule-local process settings | Keep out of version control |
PORT |
No | Web port, default 3101 | Local listener |
SENTRAPEDIA_HOST |
No | Web host, default 127.0.0.1 | Wider exposure adds risk, not authentication |
AADI_SERVICE_URL / AADI_SERVICE_TOKEN |
Generated internally | Private child channel | Overridden in memory |
aadi/requirements.lock |
Bundled | Pinned Python packages | Installed under .runtime/aadi/venv |
npm run dev
# http://127.0.0.1:3101
# Optional optimized local production-mode build:
npm run build
npm startUse npm run dev, not npx next dev: the script starts the AADI engine beside Next.js and wires their private channel, and Next.js alone has no engine. The desktop preview configuration under .claude/ is gitignored, so each machine sets up its own.
Running a production-mode build locally does not establish readiness to serve real patients.
npm run system:check
npm run typecheck
npm run lint
npm run test:all
npm run build
npm run deploy:dry-run
npm run benchmark:oracleThe system check performs configuration/readiness preflight without paid inference. benchmark:oracle measures local retrieval, not model latency or medical accuracy. deploy:dry-run requires build outputs and checks traced dependencies; it does not deploy.
The Docker image is local only and carries no user authentication. Run it bound strictly to the loopback interface:
docker run -p 127.0.0.1:3000:3000 -e GEMINI_API_KEY="your-api-key" sentrapediaFRONTENDNext.js App Router; React; TypeScript; local CSS; bundled .next/static and standalone assets. |
BACKENDNext.js gateway and managed FastAPI service. No production user authentication. |
AI / AUTOMATIONPython AADI, Gemini API model calls, capability/profile checks, guarded budgets. |
DATABrowser localStorage, Oracle JSON, read-only TheOracle vector index and local audit files. |
SECURITYLocal-origin checks, ephemeral AADI token, schema/identity guards; development-only posture. |
DEPLOYMENTStandalone Next.js output; Dockerfile bundles Node/Python and listens on port 3000 as non-root. Local only; run bound to 127.0.0.1:3000:3000. |
PROMOTION STATE // DEVELOPMENT IS NOT CLINICAL PRODUCTION
%%{init: {"flowchart": {"htmlLabels": false, "padding": 20}, "themeVariables": {"fontFamily": "monospace", "fontSize": "11px"}}}%%
flowchart LR
DEV["DEVELOPMENT"]
TEST["TEST / BUILD"]
EXTRACT["ISOLATED EXTRACTION"]
SEC["SECURITY / PRIVACY REVIEW"]
CLIN["CLINICAL VALIDATION + HUMAN APPROVAL"]
PROD["REAL CLINICAL DEPLOYMENT"]
STOP["NOT PROMOTION READY"]
DEV --> TEST --> EXTRACT --> SEC --> CLIN
CLIN -. requires separate authorization .-> PROD
SEC -. missing control .-> STOP
CLIN -. insufficient evidence .-> STOP
classDef core fill:#0D1117,stroke:#5B8CFF,color:#FFFFFF,stroke-width:2px;
classDef control fill:#0D1117,stroke:#14B8A6,color:#FFFFFF,stroke-width:2px;
classDef authority fill:#0D1117,stroke:#F59E0B,color:#FFFFFF,stroke-width:2px;
classDef danger fill:#0D1117,stroke:#EF4444,color:#FFFFFF,stroke-width:2px;
class DEV,TEST core;
class EXTRACT,SEC control;
class CLIN,PROD authority;
class STOP danger;
The diagram states required future controls, not completed certifications or deployment approval.
| Gate | Command | Responsibility |
|---|---|---|
| Installed profile | npm run system:check |
Local runtime/provider preflight |
| Typecheck | npm run typecheck |
tsc --noEmit |
| Lint | npm run lint |
eslint src tests scripts plus the site's syntax lint |
| App tests | npm test |
Vitest; excludes .runtime backups |
| System tests | npm run test:system |
Node lifecycle and policy checks |
| AADI tests | npm run test:aadi |
Mocked Python service tests |
| All tests | npm run test:all |
Application, supervisor, Python |
| Build / dry run | npm run build · npm run deploy:dry-run |
Standalone assets, trace and boundary checks |
| Extraction | Dated standalone evidence (private, not in the public repository) | Historic isolated install, build, local smoke |
No magic without audit.
No automation without verification.
No production promotion without rollback.
No sensitive data without explicit security boundaries.
No expansion without one solved problem first.
Caution
A model hypothesis, local review status, Oracle match, source hash or passing software test is not permission for patient care. Only an accountable clinician may make a clinical decision.
| Interrogation | Required answer |
|---|---|
| What is solved? | Encounter context and source-aware drafts can be reviewed together. |
| Who decides? | Human clinician for medical choices; authorized owner for high-impact system operations. |
| What is excluded? | Patient identity, automated prescribing, production EHR, unvalidated clinical recommendations. |
| What can fail? | Provider, quota, source grounding, local storage, network metadata, output contract and interpretation. |
| How is it verified? | Tests, source checks, dated extraction reports; separate clinical trials/approval not established. |
Sentrapedia is developed within Sentra Artificial Intelligence. Its project.contract.json declares a standalone healthcare/sentrapedia capsule with R2 risk and explicit program/argument contracts for install, lint, typecheck, test, build, run and dry-run.
Human-Governed · Agent-Executed · Machine-Enforced.
The project declares rootDependencies: [], carries its own npm/Python locks and local design-token snapshot, and documents an independently extracted start/build/smoke verification from October 10, 2026. That historical result is not a claim that the README update itself reran extraction or earned an external certification.
SENTRA / HEALTHCAREIndependent healthcare-domain engineering capsule in the Sentra ecosystem. |
SENTRAPEDIAClinical documentation and case-reasoning workspace with Oracle/AADI components. |
No patient identity is the enforced operating rule. Sign-in and beta admission go through Clerk (docs/auth-beta-access.md). The browser's local data store is unencrypted. Do not submit names, identity numbers, contact details or any other identifying information, and do not expose the workspace as a public clinical service.
AUTHENTICATION / AUTHORIZATIONSame-origin/local-host gateway checks and ephemeral AADI bearer token protect local interactions; neither replaces production identity and roles. |
SENSITIVE DATAInputs without patient identity, browser/server/service identity-pattern checks, browser-local unencrypted storage. Pattern detection cannot guarantee de-identification. |
SECRETS / PROVIDERProvider key is server-side. Google's Gemini API receives cases that passed the identity screens under the Gemini API terms for a paid-tier key; zero retention must not be assumed. |
PRIVILEGED ACTIONSNo clinical-action automation. Any future real-world deployment needs clinical, privacy, security and authorized owner review. |
| Method | Route / channel | Purpose | Trust / failure |
|---|---|---|---|
| GET | /api/aadi |
Service/profile/grounding readiness | No paid inference; health is not clinical validity |
| POST | /api/aadi |
Validate case, retrieve TheOracle, forward and verify result | Same origin, body bound, identity and response checks |
| GET | /healthz (private AADI loopback) |
Contract/version/capability probe | Not a public API |
| POST | /v1/diagnosis/step (private AADI) |
Contract-v1 assessment | Ephemeral token, data policy and budget |
| External | Google Gemini API | Model metadata and paid AI inference | Provider availability, price, quota and retention caveats |
Primary code: route · gateway · service · contract provenance. The therapy and Oracle grounding contract extensions are local to Sentrapedia; their adoption by Med Assist is not established.
DATAPatient/encounter context without identity, drafts, tasks, source snippets and model trace metadata. |
PERSISTENCE`sentrapedia-workspace-v2:` and `sentrapedia-feedback` browser localStorage; Oracle JSON, TheOracle index and local AADI budget ledger. |
OBSERVABILITYTrace IDs, source IDs/hashes, local error codes, AADI audit files and dated verification reports. |
Oracle is not TheOracle. Structured clinical facts live only in the knowledge SSOT (theoracle/ssot/); guideline PDF texts are the citation library. npm run knowledge:build derives both the UI disease catalog (oracle/sentrapedia.json) and TheOracle, the index that grounds AADI: 17,871 chunks with local EmbeddingGemma-300m vectors in theoracle/index/. The SSOT was clinically reviewed by Gaffer on 2026-10-23 (recorded in its catatan); review status is kept per entry, and a reviewed entry is still a reference, not a prescription.
The account dialog supports JSON export and clearing browser-local records, and sign-in is a Clerk closed beta (access notes); workspace records stay in the browser, with an optional Neon Postgres sync that is off unless SENTRAPEDIA_DATABASE_URL is set, and no retention is guaranteed. The AADI audit ledger under .runtime/aadi-deepseek/audit records metadata and SHA-256 hashes (requestSha256 / responseSha256, never raw case text) and deletes day files older than 14 days at engine start; preserve it when relocating an existing installation to retain daily-budget context.
"Local workspace" refers to the web process and browser-side records; it does not mean every inference stays on the device. AI-assisted case inquiries call the managed AADI service, which communicates with an external model endpoint, Google's Gemini API. The project deliberately disallows patient identity in what is sent.
- Browser: patient/encounter and draft state is kept in localStorage. This is not an encrypted clinical database, shared patient chart or backup strategy.
- Application gateway: same-origin and no-identity input rules reduce unintended use; pattern-based identity screening cannot guarantee anonymization.
- Grounding corpus: bundled TheOracle material is indexed locally and should be reviewed for extraction quality, licensing and clinical relevance before being relied upon.
- External inference: prompts sent beyond the local process cross a trust boundary. The configured runtime does not assert zero data retention.
- Human outputs: editable notes are drafts, without authenticated signatures, chart finalization, prescribing authority, or automatic EHR submission.
| Symptom | Boundary | Recovery |
|---|---|---|
| Startup refuses model profile | Metadata, pricing or supported parameters changed | Inspect approved provider model/catalog; preserve preflight checks |
| AADI environment missing | Local Python install or lock hash | Run npm ci --workspaces=false from the capsule root |
| Identity / schema rejection | Identity detected, invalid or overlong case | Submit identity-free context |
| Oracle grounding unavailable | No match, evidence integrity or source boundary | Inspect source evidence; do not fabricate a clinical conclusion |
| Timeout, provider or budget error | Network, paid quota, policy or deadline | Preserve prompt, inspect status/audit and retry deliberately |
| Local drafts missing | Browser storage/profile cleared or blocked | Use exported backup if one exists |
| Dry-run missing artifacts | Incomplete build or package trace escape | Build and repair the trace; keep isolation checks enabled |
Explicit limitations: software test passes do not verify diagnostic accuracy, treatment quality, guideline currency or patient outcomes. Real use requires clinical validation, secure persistence, consent/transcription governance, regulated privacy/security controls, role authorization, EHR integrations and appropriate approvals. Browser speech recognition may invoke a vendor service. Provider billing can occur even for aborted requests. The five-second response target is an aspiration, not established end-to-end performance.
See current integration, data contract and testing.
No external sponsor is declared for this product. Sentrapedia is developed under Sentra Artificial Intelligence. Use of Indonesian clinical source material indicates provenance, not sponsorship, regulatory approval, endorsement or certification of Sentrapedia.
NEXT.JS / REACTNext.js 16.4.0, React/React DOM 19.3.0, TypeScript, Lucide React, local Sentra CSS tokens. |
FASTAPI / GEMINI APIPython, FastAPI, Uvicorn, Pydantic, httpx, OpenAI Python SDK pointed at the Gemini API's OpenAI-compatible endpoint. |
ORACLE / THEORACLEBundled disease JSON, `@huggingface/transformers` + ONNX Runtime for local embeddings, provenance and evidence records. |
VERIFICATION / PACKAGINGVitest, ESLint 9, TypeScript 5.9, Node tests, mocked Python tests, standalone Next.js packaging. |
ACTUAL TECHNOLOGY SURFACE · SENTRAPEDIA
Contributors should use scoped branches and PRs, preserve the clinical and no-patient-identity safety requirements, include tests and source provenance when behavior changes, and obtain R2/owner review for boundary-affecting work.
Sentrapedia is source-available, not open source: see LICENSE (Sentrapedia Source-Available License 1.0, draft of 2026-10-19). Reading, studying and running the code locally for evaluation, research or education with fictional data is free. Use with real patients by any organisation, hosting it as a service, distribution and other commercial use require a paid commercial licence from SENTRA ARTIFICIAL INTELLIGENCE (info@sentrapedia.com). The licence text still speaks of fictional data, while the rest of this document follows the owner's decision of 2026-10-26 (cases without patient identity); the licence wording has not been revised yet.
The licence covers the code only. The clinical database (the knowledge SSOT, the TheOracle index and clinical catalogue derived from it) and the ICD-10 code list are not included in the public repository and not licensed; marked samples take their place, and analyses answer "Database Oracle belum terpasang" (see Database not included). The file aadi/LICENSE grants MIT terms to its bundled upstream AADI component only, with its own author/copyright attribution. Source attribution is available in AADI SOURCE and contract provenance.
Use this repository's GitHub Issues where enabled, or established Sentra channels. Avoid posting real patient information, credentials or exploit details in issue threads. A dedicated security reporting address is not documented in the inspected repository.
The following is historical repository evidence from October 10, 2026. The README-only revision does not imply fresh application tests, live paid model calls, container execution or deployment. Current gates (lint, typecheck, all test suites, site checks, build and deploy dry run) run on every push to main and every pull request in .github/workflows/ci.yml; the latest local results are recorded in .agents/HANDOFF.md.
| Surface | Historical status | Evidence | Limit |
|---|---|---|---|
| Fresh extracted install | PASS | Integrated runtime report (private, not in the public repository) | Node/Python isolated installation |
| Typecheck and lint | PASS | Integrated runtime report (private, not in the public repository) | No new run for this README |
| Application tests | 154 passed | Integrated runtime report (private, not in the public repository) | Synthetic test suite |
| Runtime/system tests | 7 passed | Integrated runtime report (private, not in the public repository) | Windows evidence, not cross-platform proof |
| AADI service tests | 157 passed, 1 skipped | Integrated runtime report (private, not in the public repository) | Mocked provider, not clinical accuracy |
| Build / deploy dry run | PASS | Machine-readable evidence (private, not in the public repository) | Six traces, no actual deployment |
| Standalone HTTP smoke | PASS | Integrated runtime report (private, not in the public repository) | Local page, static asset, synthetic rejection |
| Oracle II grounding | SUPERSEDED | Oracle II verification (private, not in the public repository) | Replaced by TheOracle vector retrieval on 2026-10-11 |
| TheOracle vector grounding | PASS | TheOracle verification (private, not in the public repository) · model eval (private, not in the public repository) | Retrieval recall is not diagnostic validation; eval gold labels are draft |
| Docker image build/run | NOT VERIFIED | Integrated runtime report (private, not in the public repository) | Docker daemon unavailable in reported test |
| Clinical validity / production | NOT ESTABLISHED | Current integration contract | Requires separate safety/security approval |
Engineering references: Architecture · Testing · AADI integration · Data · UI · Documentation manifest. The product scope, decisions, development, verification, security, clinical safety, integration, operations and governance documents are internal and are not in the public repository.
Architected and built by dr. Ferdi Iskandar (the Gaffer) · Sentra Artificial Intelligence.
One clinical workspace. Traceable sources. Reviewable reasoning. Human authority.
// the surface is documentation. the depth is running.

