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2.0
|
| 5 |
+
tags:
|
| 6 |
+
- singapore
|
| 7 |
+
- sovereign-ai
|
| 8 |
+
- edge-ai
|
| 9 |
+
- meralion
|
| 10 |
+
- singlish
|
| 11 |
+
- knowledge-base
|
| 12 |
+
- agentic-innovation
|
| 13 |
+
pretty_name: MINA Knowledge Base
|
| 14 |
+
size_categories:
|
| 15 |
+
- n<1K
|
| 16 |
+
task_categories:
|
| 17 |
+
- conversational
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# MINA Knowledge Base — mina_knowledge.json
|
| 21 |
+
|
| 22 |
+
Runtime knowledge file for the [MINA Bridge](https://huggingface.co/munyew/mina-bridge). Defines crisis hotline resources and MINA's current capability flags. Read at runtime by `append_resources()` and the unknown-capability detector — update this file to change MINA's behaviour without touching bridge code.
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## Schema
|
| 27 |
+
|
| 28 |
+
```json
|
| 29 |
+
{
|
| 30 |
+
"crisis_resources": { ... },
|
| 31 |
+
"capabilities": { ... }
|
| 32 |
+
}
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
### `crisis_resources`
|
| 36 |
+
|
| 37 |
+
Hotline entries appended to VITA (crisis) agent replies. Each entry supports `phone`, `whatsapp`, `hours`, and `description` fields.
|
| 38 |
+
|
| 39 |
+
```json
|
| 40 |
+
"crisis_resources": {
|
| 41 |
+
"SOS_Lifeline": {
|
| 42 |
+
"phone": "1767",
|
| 43 |
+
"whatsapp": "https://wa.me/6591511767",
|
| 44 |
+
"hours": "24/7",
|
| 45 |
+
"description": "Singapore suicide prevention helpline"
|
| 46 |
+
},
|
| 47 |
+
"IMH_Crisis": {
|
| 48 |
+
"phone": "6389 2222",
|
| 49 |
+
"hours": "24/7",
|
| 50 |
+
"description": "Institute of Mental Health crisis line"
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
The bridge reads these values at request time (`load_knowledge()`), so updating phone numbers or adding new services takes effect immediately on the next request — no bridge restart required.
|
| 56 |
+
|
| 57 |
+
### `capabilities`
|
| 58 |
+
|
| 59 |
+
Boolean flags representing what MINA can currently do. The unknown-capability detector in `completion()` checks these flags; any `false` entry for a keyword the user mentions triggers a `log_gap()` call.
|
| 60 |
+
|
| 61 |
+
```json
|
| 62 |
+
"capabilities": {
|
| 63 |
+
"make_phone_call": false,
|
| 64 |
+
"send_whatsapp": false,
|
| 65 |
+
"check_calendar": true,
|
| 66 |
+
"detect_scam": true,
|
| 67 |
+
"emotional_support": true,
|
| 68 |
+
"detect_crisis": true
|
| 69 |
+
}
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
When a capability is implemented, flip the flag to `true`. The gap detector will stop logging it and `append_resources()` will stop showing the "I can't do this yet" message.
|
| 73 |
+
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
## Gap Logging Integration
|
| 77 |
+
|
| 78 |
+
The capability flags drive MINA's autonomous gap detection loop:
|
| 79 |
+
|
| 80 |
+
```
|
| 81 |
+
User says "can you call SOS for me"
|
| 82 |
+
↓
|
| 83 |
+
unknown-capability detector finds "call" in transcript
|
| 84 |
+
↓
|
| 85 |
+
caps.get("make_phone_call") == false
|
| 86 |
+
↓
|
| 87 |
+
log_gap("make_phone_call", transcript, context)
|
| 88 |
+
├── written to ~/meralion/gaps/gap_log.jsonl
|
| 89 |
+
└── POSTed to ntfy.sh/roar-imda-demo
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
Each gap entry in `gap_log.jsonl`:
|
| 93 |
+
```json
|
| 94 |
+
{
|
| 95 |
+
"timestamp": "2026-05-02T14:23:01",
|
| 96 |
+
"gap_type": "make_phone_call",
|
| 97 |
+
"user_request": "can you call SOS for me",
|
| 98 |
+
"context": "User requested phone call to SOS",
|
| 99 |
+
"status": "pending"
|
| 100 |
+
}
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## Adding New Resources
|
| 106 |
+
|
| 107 |
+
To add a new crisis line, append to `crisis_resources`:
|
| 108 |
+
```json
|
| 109 |
+
"SilverRibbon": {
|
| 110 |
+
"phone": "1800 774 5433",
|
| 111 |
+
"hours": "Mon–Fri 9am–6pm",
|
| 112 |
+
"description": "Singapore mental health awareness"
|
| 113 |
+
}
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
To register a new capability:
|
| 117 |
+
```json
|
| 118 |
+
"make_phone_call": true
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
To track a new capability gap before it is built:
|
| 122 |
+
```json
|
| 123 |
+
"play_music": false,
|
| 124 |
+
"set_reminder": false,
|
| 125 |
+
"read_news": false
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
---
|
| 129 |
+
|
| 130 |
+
## File Location on Device
|
| 131 |
+
|
| 132 |
+
```
|
| 133 |
+
/data/data/com.termux/files/home/meralion/mina_knowledge.json
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
The bridge resolves this via `KNOWLEDGE_FILE = Path("~/meralion/mina_knowledge.json")` expanded at startup. To use a different path, update the `KNOWLEDGE_FILE` constant in `bridge.py` or symlink the file.
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
## Versioning
|
| 141 |
+
|
| 142 |
+
| Version | Date | Changes |
|
| 143 |
+
|---|---|---|
|
| 144 |
+
| 1.0 | 2026-05-02 | Initial — SOS Lifeline, IMH Crisis, 6 capability flags |
|
| 145 |
+
|
| 146 |
+
---
|
| 147 |
+
|
| 148 |
+
## Acknowledgements
|
| 149 |
+
|
| 150 |
+
Crisis resources sourced from:
|
| 151 |
+
- [Samaritans of Singapore (SOS)](https://www.sos.org.sg) — 1767
|
| 152 |
+
- [Institute of Mental Health (IMH)](https://www.imh.com.sg) — 6389 2222
|
| 153 |
+
- [ScamShield](https://www.scamshield.org.sg) — 1799
|