@jcode.labs/ragmir 4.2.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.md +67 -160
  2. package/dist/chunking.d.ts +1 -1
  3. package/dist/chunking.d.ts.map +1 -1
  4. package/dist/chunking.js +17 -1
  5. package/dist/chunking.js.map +1 -1
  6. package/dist/cli-entry.js +1 -1
  7. package/dist/cli-entry.js.map +1 -1
  8. package/dist/cli-fast.d.ts +1 -3
  9. package/dist/cli-fast.d.ts.map +1 -1
  10. package/dist/cli-fast.js +2 -104
  11. package/dist/cli-fast.js.map +1 -1
  12. package/dist/cli-options.d.ts +0 -37
  13. package/dist/cli-options.d.ts.map +1 -1
  14. package/dist/cli-options.js +0 -53
  15. package/dist/cli-options.js.map +1 -1
  16. package/dist/cli.js +9 -701
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client.d.ts +1 -3
  19. package/dist/client.d.ts.map +1 -1
  20. package/dist/client.js +7 -36
  21. package/dist/client.js.map +1 -1
  22. package/dist/config-migration.d.ts +6 -0
  23. package/dist/config-migration.d.ts.map +1 -0
  24. package/dist/config-migration.js +31 -0
  25. package/dist/config-migration.js.map +1 -0
  26. package/dist/config.d.ts +2 -0
  27. package/dist/config.d.ts.map +1 -1
  28. package/dist/config.js +17 -65
  29. package/dist/config.js.map +1 -1
  30. package/dist/context-resources.d.ts.map +1 -1
  31. package/dist/context-resources.js +2 -14
  32. package/dist/context-resources.js.map +1 -1
  33. package/dist/defaults.d.ts +0 -3
  34. package/dist/defaults.d.ts.map +1 -1
  35. package/dist/defaults.js +0 -13
  36. package/dist/defaults.js.map +1 -1
  37. package/dist/destroy.d.ts.map +1 -1
  38. package/dist/destroy.js +0 -2
  39. package/dist/destroy.js.map +1 -1
  40. package/dist/doctor.d.ts.map +1 -1
  41. package/dist/doctor.js +1 -9
  42. package/dist/doctor.js.map +1 -1
  43. package/dist/document-structure.js.map +1 -1
  44. package/dist/embeddings.d.ts.map +1 -1
  45. package/dist/embeddings.js +9 -1
  46. package/dist/embeddings.js.map +1 -1
  47. package/dist/errors.d.ts +1 -1
  48. package/dist/errors.d.ts.map +1 -1
  49. package/dist/errors.js.map +1 -1
  50. package/dist/evaluate.d.ts.map +1 -1
  51. package/dist/evaluate.js +0 -7
  52. package/dist/evaluate.js.map +1 -1
  53. package/dist/files.js.map +1 -1
  54. package/dist/generation-retention.js.map +1 -1
  55. package/dist/gitignore.js.map +1 -1
  56. package/dist/index-diagnostics.js +1 -1
  57. package/dist/index-diagnostics.js.map +1 -1
  58. package/dist/index-policy.d.ts.map +1 -1
  59. package/dist/index-policy.js +3 -4
  60. package/dist/index-policy.js.map +1 -1
  61. package/dist/index-write-lock.js.map +1 -1
  62. package/dist/index.d.ts +4 -15
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +2 -8
  65. package/dist/index.js.map +1 -1
  66. package/dist/ingest.d.ts.map +1 -1
  67. package/dist/ingest.js +3 -18
  68. package/dist/ingest.js.map +1 -1
  69. package/dist/ingestion-metrics.d.ts +1 -1
  70. package/dist/ingestion-metrics.d.ts.map +1 -1
  71. package/dist/ingestion-metrics.js +0 -1
  72. package/dist/ingestion-metrics.js.map +1 -1
  73. package/dist/ingestion-state.d.ts +1 -2
  74. package/dist/ingestion-state.d.ts.map +1 -1
  75. package/dist/ingestion-state.js +0 -2
  76. package/dist/ingestion-state.js.map +1 -1
  77. package/dist/lexical-scoring.d.ts +13 -0
  78. package/dist/lexical-scoring.d.ts.map +1 -0
  79. package/dist/lexical-scoring.js +35 -0
  80. package/dist/lexical-scoring.js.map +1 -0
  81. package/dist/mcp-output.d.ts +4 -31
  82. package/dist/mcp-output.d.ts.map +1 -1
  83. package/dist/mcp-output.js +4 -123
  84. package/dist/mcp-output.js.map +1 -1
  85. package/dist/mcp-summaries.d.ts +1 -12
  86. package/dist/mcp-summaries.d.ts.map +1 -1
  87. package/dist/mcp-summaries.js +0 -112
  88. package/dist/mcp-summaries.js.map +1 -1
  89. package/dist/mcp.d.ts +1 -5
  90. package/dist/mcp.d.ts.map +1 -1
  91. package/dist/mcp.js +22 -329
  92. package/dist/mcp.js.map +1 -1
  93. package/dist/ocr.d.ts +0 -1
  94. package/dist/ocr.d.ts.map +1 -1
  95. package/dist/ocr.js +0 -4
  96. package/dist/ocr.js.map +1 -1
  97. package/dist/parsing.js +13 -0
  98. package/dist/parsing.js.map +1 -1
  99. package/dist/preview.d.ts.map +1 -1
  100. package/dist/preview.js +2 -5
  101. package/dist/preview.js.map +1 -1
  102. package/dist/query-sanitizer.d.ts +2 -1
  103. package/dist/query-sanitizer.d.ts.map +1 -1
  104. package/dist/query-sanitizer.js +9 -127
  105. package/dist/query-sanitizer.js.map +1 -1
  106. package/dist/query.d.ts +1 -3
  107. package/dist/query.d.ts.map +1 -1
  108. package/dist/query.js +95 -71
  109. package/dist/query.js.map +1 -1
  110. package/dist/ranking.d.ts +1 -1
  111. package/dist/ranking.d.ts.map +1 -1
  112. package/dist/ranking.js +52 -41
  113. package/dist/ranking.js.map +1 -1
  114. package/dist/runtime-info.js.map +1 -1
  115. package/dist/search-output.d.ts +3 -0
  116. package/dist/search-output.d.ts.map +1 -0
  117. package/dist/search-output.js +26 -0
  118. package/dist/search-output.js.map +1 -0
  119. package/dist/security.d.ts.map +1 -1
  120. package/dist/security.js +5 -37
  121. package/dist/security.js.map +1 -1
  122. package/dist/setup-prompt.d.ts +1 -1
  123. package/dist/setup-prompt.d.ts.map +1 -1
  124. package/dist/setup-prompt.js +22 -25
  125. package/dist/setup-prompt.js.map +1 -1
  126. package/dist/setup.js +1 -1
  127. package/dist/setup.js.map +1 -1
  128. package/dist/skill.d.ts +1 -4
  129. package/dist/skill.d.ts.map +1 -1
  130. package/dist/skill.js +3 -71
  131. package/dist/skill.js.map +1 -1
  132. package/dist/storage-maintenance.js.map +1 -1
  133. package/dist/store.js +9 -1
  134. package/dist/store.js.map +1 -1
  135. package/dist/types.d.ts +19 -156
  136. package/dist/types.d.ts.map +1 -1
  137. package/dist/upgrade.d.ts +3 -2
  138. package/dist/upgrade.d.ts.map +1 -1
  139. package/dist/upgrade.js +20 -2
  140. package/dist/upgrade.js.map +1 -1
  141. package/dist/vector-index.js.map +1 -1
  142. package/dist/version.d.ts +1 -1
  143. package/dist/version.js +1 -1
  144. package/dist/workload.js.map +1 -1
  145. package/examples/document-evidence-benchmark/.ragmir/config.json +0 -9
  146. package/examples/document-evidence-benchmark/README.md +5 -3
  147. package/examples/document-evidence-benchmark/raw/rfp/security-questionnaire.md +1 -1
  148. package/examples/library-api-demo/README.md +17 -8
  149. package/examples/library-api-demo/run.mjs +6 -6
  150. package/examples/sovereign-rag-demo/.ragmir/config.json +3 -10
  151. package/examples/sovereign-rag-demo/README.md +21 -12
  152. package/package.json +21 -30
  153. package/skills/ragmir/SKILL.md +67 -199
  154. package/dist/access-log.d.ts +0 -30
  155. package/dist/access-log.d.ts.map +0 -1
  156. package/dist/access-log.js +0 -415
  157. package/dist/access-log.js.map +0 -1
  158. package/dist/cli-stdin.d.ts +0 -3
  159. package/dist/cli-stdin.d.ts.map +0 -1
  160. package/dist/cli-stdin.js +0 -15
  161. package/dist/cli-stdin.js.map +0 -1
  162. package/dist/portable-entry.d.ts +0 -5
  163. package/dist/portable-entry.d.ts.map +0 -1
  164. package/dist/portable-entry.js +0 -337
  165. package/dist/portable-entry.js.map +0 -1
  166. package/dist/portable.d.ts +0 -89
  167. package/dist/portable.d.ts.map +0 -1
  168. package/dist/portable.js +0 -1290
  169. package/dist/portable.js.map +0 -1
  170. package/dist/prompt-routing.d.ts +0 -12
  171. package/dist/prompt-routing.d.ts.map +0 -1
  172. package/dist/prompt-routing.js +0 -150
  173. package/dist/prompt-routing.js.map +0 -1
  174. package/dist/redaction.d.ts +0 -12
  175. package/dist/redaction.d.ts.map +0 -1
  176. package/dist/redaction.js +0 -253
  177. package/dist/redaction.js.map +0 -1
  178. package/dist/research.d.ts +0 -21
  179. package/dist/research.d.ts.map +0 -1
  180. package/dist/research.js +0 -667
  181. package/dist/research.js.map +0 -1
  182. package/dist/team-diagnostics.d.ts +0 -119
  183. package/dist/team-diagnostics.d.ts.map +0 -1
  184. package/dist/team-diagnostics.js +0 -515
  185. package/dist/team-diagnostics.js.map +0 -1
  186. package/dist/team-sync.d.ts +0 -49
  187. package/dist/team-sync.d.ts.map +0 -1
  188. package/dist/team-sync.js +0 -436
  189. package/dist/team-sync.js.map +0 -1
  190. package/skills/ragmir-audio-summary/SKILL.md +0 -80
  191. package/skills/ragmir-audio-summary/forge-voice.sh +0 -150
  192. package/skills/ragmir-audio-summary/listening-style.md +0 -92
  193. package/skills/ragmir-audio-summary/narration-templates.md +0 -162
  194. package/skills/ragmir-audio-summary/split-lines.py +0 -14
  195. package/skills/ragmir-audio-summary/xtts-voice.py +0 -46
  196. package/skills/ragmir-legal-dossier/SKILL.md +0 -143
  197. package/skills/ragmir-markdown-report/SKILL.md +0 -110
@@ -1,150 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Render a Ragmir audio-summary text file to MP3. The text is a throwaway intermediate written
3
- # outside the repository by the skill. The final audio should normally be written under .ragmir/audio.
4
- #
5
- # Engine via TTS_ENGINE (auto|edge|xtts|say|piper); default "auto" matches the global Voice Forge
6
- # quality path:
7
- # edge - edge-tts neural voices, single request (online). Default; clean on normal text.
8
- # Set TTS_SEGMENT=1 to render sentence-by-sentence for long-text truncation.
9
- # xtts - local Coqui XTTS-v2 when installed.
10
- # say - macOS built-in, offline, clean but robotic.
11
- # piper - local neural TTS.
12
- #
13
- # Usage: forge-voice.sh <text-file> [voice]
14
- # Env: OUT_MP3 explicit mp3 output path
15
- # TTS_ENGINE force an engine (default: auto)
16
- # TTS_VOICE voice/speaker (engine-specific); the [voice] arg overrides it
17
- # TTS_RATE edge-tts speed delta, default +0%
18
- # TTS_SEGMENT=1 edge: render sentence-by-sentence
19
- # XTTS_SPEAKER xtts preset speaker (default Ana Florence)
20
- # PIPER_MODEL piper onnx model path
21
- # KEEP_TEXT=1 keep the source text file after a successful render
22
- set -euo pipefail
23
-
24
- TXT="${1:?usage: forge-voice.sh <text-file> [voice]}"
25
- [ -f "$TXT" ] || { echo "error: file not found: $TXT" >&2; exit 1; }
26
- VOICE="${2:-${TTS_VOICE:-}}"
27
- ENGINE="${TTS_ENGINE:-auto}"
28
- OUT_FINAL="${OUT_MP3:-${TXT%.txt}.mp3}"
29
- OUTBASE="${OUT_FINAL%.mp3}"
30
-
31
- cleanup() {
32
- [ "${KEEP_TEXT:-0}" = "1" ] || rm -f "$TXT"
33
- rm -f "${OUTBASE}.wav" "${OUTBASE}.aiff"
34
- }
35
- trap cleanup EXIT
36
-
37
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
38
- XTTS_PY="${XTTS_PY:-$HOME/.local/share/voice-forge/xtts/bin/python}"
39
- XTTS_HELPER="$SCRIPT_DIR/xtts-voice.py"
40
-
41
- xtts_ready() { [ -x "$XTTS_PY" ] && [ -f "$XTTS_HELPER" ]; }
42
-
43
- finish() {
44
- echo "$1"
45
- exit 0
46
- }
47
-
48
- to_mp3() {
49
- local src="$1" out="${OUTBASE}.mp3"
50
- if ! command -v ffmpeg >/dev/null 2>&1; then
51
- rm -f "$src"
52
- echo "error: ffmpeg is required to convert local TTS output to mp3" >&2
53
- exit 1
54
- fi
55
- if ffmpeg -y -loglevel error -i "$src" -ac 1 -c:a libmp3lame -q:a 4 "$out"; then
56
- rm -f "$src"
57
- finish "$out"
58
- fi
59
- rm -f "$src" "$out"
60
- echo "error: failed to convert local TTS output to mp3" >&2
61
- exit 1
62
- }
63
-
64
- if [ "$ENGINE" = "edge" ] || [ "$ENGINE" = "auto" ]; then
65
- if command -v edge-tts >/dev/null 2>&1; then
66
- OUT="${OUTBASE}.mp3"
67
- SPLIT="$SCRIPT_DIR/split-lines.py"
68
- voice="${VOICE:-fr-FR-DeniseNeural}"
69
- rate="${TTS_RATE:-+0%}"
70
- if [ "${TTS_SEGMENT:-0}" = "1" ] && [ -f "$SPLIT" ] \
71
- && command -v ffmpeg >/dev/null 2>&1 && command -v python3 >/dev/null 2>&1; then
72
- TMP="$(mktemp -d)"
73
- ffmpeg -y -loglevel error -f lavfi -i anullsrc=r=24000:cl=mono -t 0.28 \
74
- -c:a libmp3lame -q:a 4 "$TMP/sil.mp3"
75
- i=0
76
- : > "$TMP/list.txt"
77
- while IFS= read -r line; do
78
- [ -z "$line" ] && continue
79
- i=$((i + 1))
80
- if edge-tts --text "$line" --voice "$voice" --rate="$rate" \
81
- --write-media "$TMP/seg_$i.mp3" >/dev/null 2>&1; then
82
- printf "file '%s'\n" "$TMP/seg_$i.mp3" >> "$TMP/list.txt"
83
- printf "file '%s'\n" "$TMP/sil.mp3" >> "$TMP/list.txt"
84
- else
85
- echo "warn: edge-tts failed on a sentence, skipping it" >&2
86
- fi
87
- done < <(python3 "$SPLIT" "$TXT")
88
- ffmpeg -y -loglevel error -f concat -safe 0 -i "$TMP/list.txt" \
89
- -ac 1 -c:a libmp3lame -q:a 4 "$OUT"
90
- rm -rf "$TMP"
91
- finish "$OUT"
92
- fi
93
- edge-tts --file "$TXT" --voice "$voice" --rate="$rate" --write-media "$OUT" >/dev/null
94
- finish "$OUT"
95
- fi
96
- if [ "$ENGINE" = "edge" ]; then
97
- echo "error: TTS_ENGINE=edge but edge-tts not installed (pipx install edge-tts)" >&2
98
- exit 1
99
- fi
100
- fi
101
-
102
- if [ "$ENGINE" = "xtts" ] || { [ "$ENGINE" = "auto" ] && xtts_ready; }; then
103
- if ! xtts_ready; then
104
- echo "error: TTS_ENGINE=xtts but venv/helper missing ($XTTS_PY)" >&2
105
- exit 1
106
- fi
107
- WAV="${OUTBASE}.wav"
108
- if [ -n "$VOICE" ]; then
109
- COQUI_TOS_AGREED=1 "$XTTS_PY" "$XTTS_HELPER" "$TXT" "$WAV" "$VOICE" >&2
110
- else
111
- COQUI_TOS_AGREED=1 "$XTTS_PY" "$XTTS_HELPER" "$TXT" "$WAV" >&2
112
- fi
113
- to_mp3 "$WAV"
114
- fi
115
-
116
- if [ "$ENGINE" = "say" ] || [ "$ENGINE" = "auto" ]; then
117
- if command -v say >/dev/null 2>&1; then
118
- AIFF="${OUTBASE}.aiff"
119
- say -v "${VOICE:-Jacques}" -f "$TXT" -o "$AIFF" 2>/dev/null || say -f "$TXT" -o "$AIFF"
120
- to_mp3 "$AIFF"
121
- fi
122
- if [ "$ENGINE" = "say" ]; then
123
- echo "error: TTS_ENGINE=say but 'say' not available" >&2
124
- exit 1
125
- fi
126
- fi
127
-
128
- if [ "$ENGINE" = "piper" ] || [ "$ENGINE" = "auto" ]; then
129
- if command -v piper >/dev/null 2>&1; then
130
- WAV="${OUTBASE}.wav"
131
- piper -m "${PIPER_MODEL:-fr_FR-siwis-medium.onnx}" -f "$WAV" < "$TXT"
132
- to_mp3 "$WAV"
133
- fi
134
- if [ "$ENGINE" = "piper" ]; then
135
- echo "error: TTS_ENGINE=piper but piper not installed (pip install piper-tts)" >&2
136
- exit 1
137
- fi
138
- fi
139
-
140
- cat >&2 <<'EOF'
141
- error: no TTS engine available. Install one:
142
- edge-tts (cleanest, online): pipx install edge-tts
143
- XTTS-v2 (local):
144
- uv venv --python 3.11 ~/.local/share/voice-forge/xtts
145
- uv pip install --python ~/.local/share/voice-forge/xtts/bin/python \
146
- coqui-tts 'transformers>=4.57,<5' 'torch==2.8.*' 'torchaudio==2.8.*'
147
- piper (local): pip install piper-tts
148
- ffmpeg: required for local engine MP3 conversion
149
- EOF
150
- exit 127
@@ -1,92 +0,0 @@
1
- # Listening Style Guide
2
-
3
- Reference for the narration-writing step of `ragmir-audio-summary`. This file defines how to turn
4
- retrieved evidence into spoken text that a TTS engine can pronounce and a listener can follow and
5
- remember in one pass. There is no second chance to re-read audio.
6
-
7
- ## Pacing And Duration
8
-
9
- - Conversational narration lands around **130-150 words per minute**. Plan on **140 words/minute**
10
- as the working estimate.
11
- - Estimated duration = `word count / 140`. Keep a short narration under the target; never pad to
12
- reach a target.
13
- - Per-format word budgets (use them as ceilings, not goals):
14
-
15
- | Format | Target duration | Word budget |
16
- | --- | --- | --- |
17
- | Micro-brief | ~60-90 s | 150-220 words |
18
- | Brief standard | ~3-5 min | 450-750 words |
19
- | Dossier long | ~10-20 min | 1500-3000 words |
20
-
21
- If the relevant material does not fill the budget, stop earlier. Padding makes audio undrinkable.
22
-
23
- ## Sentence Shape
24
-
25
- - One idea per sentence. If you need "and" twice, split the sentence.
26
- - Aim for **20 words or fewer** per sentence. A few longer sentences are fine for rhythm; never chain
27
- three long ones in a row.
28
- - Prefer subject-verb-object order. TTS engines and the human ear both handle it best.
29
- - Avoid stacked subordinate clauses and parentheticals. They trip the reader and the listener.
30
-
31
- Before: "Le contrat, qui avait été signé, malgré des réserves émises tardivement, par les deux
32
- parties, prévoit une rupture."
33
-
34
- After: "Les deux parties ont signé le contrat, avec des réserves de dernière minute. Il prévoit
35
- une rupture."
36
-
37
- ## Punctuation For TTS
38
-
39
- Punctuation is the only cue a TTS engine has for pausing. Use it deliberately.
40
-
41
- - **Comma** `,`: short micro-pause. Use it to separate clauses and ease breathing points.
42
- - **Period** `.`: full pause. End sentences here. Favour periods over commas when in doubt.
43
- - **Ellipsis** `…`: deliberate longer pause. Use it before the answer in an active-recall question,
44
- so the listener gets a beat to think (about three seconds).
45
- - **Colon** `:`: read as a mild pause; acceptable when introducing a short enumeration spoken as
46
- prose, but prefer rephrasing into a plain sentence.
47
- - **Semicolon** `;`: avoid. Engines hesitate inconsistently. Split into two sentences.
48
- - **Exclamation** `!`: avoid for TTS. It can trigger an unnatural spike in pitch.
49
- - **Question mark** `?`: use it for the active-recall questions; the engine raises intonation
50
- naturally.
51
-
52
- ## Pronounceability
53
-
54
- Anything the engine might misread must be rewritten for the ear.
55
-
56
- - **Acronyms**: expand on first use, then use the short form if it is pronounceable. "Le RGPD, le
57
- Règlement Général sur la Protection des Données, ..."
58
- - **Numbers**: write them the way they should be read. "1500" can read as "mille cinq cents" or
59
- "quinze cents". Write the intended form. For money, spell the currency: "douze mille euros".
60
- - **Symbols**: rewrite in words. `&` becomes "et", `%` becomes "pour cent", `->` becomes "mène à".
61
- - **Dates and times**: write them fully. "Le quinze mars deux mille vingt-cinq", not "2025-03-15".
62
- - **URLs, paths, code**: never read them aloud. Paraphrase: "le fichier de configuration du
63
- projet" instead of `ragmir/config.json`.
64
- - **Foreign terms**: if the term has no clean translation, introduce it once and keep it.
65
-
66
- ## Anti-Patterns
67
-
68
- Avoid these. They are the main causes of "imbuvable" audio.
69
-
70
- - **Jargon without setup.** If a technical term is needed, define it in one short clause first.
71
- - **Spoken bullet lists.** Enumerations read aloud are exhausting. Convert lists into flowing
72
- sentences with signposting ("D'abord…, Ensuite…, Pour finir…"). See `narration-templates.md`.
73
- - **Meta-commentary.** Drop "Dans ce résumé, nous allons parler de…". Open on the substance.
74
- - **Padding to reach a duration.** Restating the same idea in more words lowers density and respect
75
- for the listener. Shorter is better than watered down.
76
- - **Reading raw source passages.** The audio is a synthesis, not a quote dump. Reformulate in plain
77
- speech and keep the citation in your working notes, not in the narration.
78
- - **Overload.** More than ~4 new ideas in a brief is too many to retain. Group, merge, or defer.
79
-
80
- ## Language
81
-
82
- - Write the narration in the same language passed to `--lang` (`fr` by default; `en`, `es`, `ja`,
83
- `th`, and `zh` are also supported).
84
- - Match the working language the user used when asking for the summary when it is one of the
85
- supported languages.
86
- - Keep numerals, units, and proper nouns pronounceable in the target language.
87
-
88
- ## Self-Check Before Rendering
89
-
90
- Read the draft aloud once at a normal pace. If you stumble or run out of breath on a sentence, it is
91
- too long or too dense. Fix it, then estimate the duration with `word count / 140` and confirm it
92
- matches the chosen format's budget.
@@ -1,162 +0,0 @@
1
- # Narration Templates
2
-
3
- Reference for the drafting step of `ragmir-audio-summary`. These are **thinking skeletons**, not
4
- output formatting. The final narration is plain flowing prose with no markdown, headings, bullets,
5
- tables, SSML, or XML tags. The skeletons below only shape how you order and connect ideas before you
6
- write the spoken text.
7
-
8
- Pick the format chosen in the skill, then fill the skeleton with the evidence that serves the user's
9
- intent. Drop anything that does not serve the intent. That is how you avoid superfluous data.
10
-
11
- ## Format Selection Recap
12
-
13
- | Format | When to use | Word budget |
14
- | --- | --- | --- |
15
- | Micro-brief | Little relevant material, or one clear question | 150-220 words |
16
- | Brief standard | Moderate material, a few angles worth keeping | 450-750 words |
17
- | Dossier long | Dense, multi-faceted material needing chapters | 1500-3000 words |
18
-
19
- Length follows relevant material. Never pad.
20
-
21
- ---
22
-
23
- ## Micro-Brief Skeleton
24
-
25
- Spoken-prose shape (write it as one flowing passage, not as headings):
26
-
27
- 1. **Hook + intent**: one sentence naming the subject and why the listener asked.
28
- 2. **Key idea**: the single thing to remember, stated up front (primacy).
29
- 3. **Evidence**: one short, plain-language reason or fact that supports it.
30
- 4. **Uncertainty / caveat**: one sentence if the evidence is partial or stale; omit only if solid.
31
- 5. **Recap + recall**: restate the key idea in other words, then ask one active-recall question,
32
- pause with `…`, and give the answer.
33
-
34
- Abstract example (do not copy the words, follow the shape):
35
-
36
- > "Vous vouliez savoir si la clause de rupture est applicable. Oui, elle l'est, mais seulement après
37
- > un préavis de trente jours. Le contrat le prévoit explicitement à la section terminaison. En
38
- > revanche, la date de départ du préavis reste ambiguë, aucun courrier ne la fixe clairement.
39
- > Retenez donc une chose: rupture possible, préavis de trente jours, point de départ à confirmer.
40
- > Question: quelle est la durée du préavis prévu? … Trente jours."
41
-
42
- ---
43
-
44
- ## Brief Standard Skeleton (Pyramid + SCQA)
45
-
46
- The standard brief follows Barbara Minto's pyramid: answer first, then supporting points, then
47
- recap. Wrap it in a short Situation-Complication-Question-Answer opening.
48
-
49
- 1. **Situation**: one or two sentences framing the context the listener already shares.
50
- 2. **Complication**: the tension, change, or question that prompted the summary.
51
- 3. **Question**: the explicit question the summary answers.
52
- 4. **Answer (the key message)**: the one-to-three points to retain, stated first (primacy).
53
- 5. **Developed points**: each of the two-to-four points expanded in plain speech, grouped with
54
- signposting ("D'abord…, Ensuite…, Enfin…"). Proven facts only; separate from inference.
55
- 6. **Uncertainty, risks, decisions, missing documents**: a short passage on what is not yet
56
- settled or needs action.
57
- 7. **Recap**: restate the two-to-four key points in compressed form (recency).
58
- 8. **Active recall**: two or three recall questions, each followed by a `…` pause and the answer.
59
-
60
- Abstract example (shape only):
61
-
62
- > "Le projet a atteint sa phase de test. Le souci, c'est que deux blocages apparaissent en
63
- > parallèle. Faut-il continuer ou mettre en pause? La réponse tient en deux points: continuez sur
64
- > le module A, mais mettez en pause le module B. D'abord, le module A passe ses tests sans
65
- > régression. Ensuite, le module B dépend d'un composant externe encore instable. Ce qu'on ne sait
66
- > pas encore, c'est la date de livraison du composant externe. Donc retenez: module A en avant,
67
- > module B en attente, dépendance externe à confirmer. Première question: quel module peut
68
- > continuer sans risque? … Le module A. Deuxième question: pourquoi mettre en pause le module B? … À cause d'un
69
- > composant externe instable."
70
-
71
- ---
72
-
73
- ## Dossier Long Skeleton (Chaptered)
74
-
75
- Use only when the material genuinely has several distinct facets. Each chapter is a self-contained
76
- mini-brief with its own mini-recap, so a listener can step away and come back.
77
-
78
- 1. **Promise**: what the whole audio covers and the three-to-five landmarks to listen for. State
79
- the key message of the whole dossier up front.
80
- 2. **Chapter 1**: signpost the chapter ("Premier point: …"). Give its mini pyramid
81
- (answer → evidence → caveat), then a one-sentence mini-recap.
82
- 3. **Chapter 2**: same shape, explicit transition ("Deuxième point: …").
83
- 4. **Continue** for each facet. Keep chapters balanced in length; merge thin ones.
84
- 5. **Global recap**: compress the key message of every chapter into one flowing passage (recency).
85
- 6. **Active recall**: three to five recall questions across the chapters, each with a `…` pause
86
- and the answer. Spread the questions across chapters, not only the last one.
87
-
88
- Transitions between chapters are essential in long audio. See the signposting catalogue below.
89
-
90
- Abstract shape:
91
-
92
- > "Ce dossier couvre les trois enjeux du contrat: la durée, la rupture, et les pénalités. En une
93
- > ligne: la durée est ferme, la rupture est conditionnée, les pénalités sont plafonnées. Premier
94
- > point: la durée. Le contrat court sur trois ans, fermes. … [chapitre] … Donc, durée ferme de
95
- > trois ans. Deuxième point: la rupture. … [chapitre] … Donc, rupture possible sous préavis.
96
- > Troisième point: les pénalités. … [chapitre] … Donc, pénalités plafonnées à dix pour cent. Pour
97
- > récapituler l'ensemble: trois ans fermes, rupture sous préavis, pénalités plafonnées. Première
98
- > question: quelle est la durée ferme du contrat? … Trois ans. …"
99
-
100
- ---
101
-
102
- ## Signposting Catalogue
103
-
104
- Signposting is the connective tissue that makes audio followable without visuals. Use these spoken
105
- transitions instead of lists or headings.
106
-
107
- | Move | Spoken cue (FR examples) |
108
- | --- | --- |
109
- | Open | "Voici l'essentiel sur…" / "Vous vouliez savoir si… La réponse courte est…" |
110
- | Enumerate | "D'abord…, Ensuite…, Enfin…" / "Il y a trois points…" (then speak each) |
111
- | Contrast | "En revanche…" / "Mais attention…" / "À l'inverse…" |
112
- | Cause / effect | "Parce que…" / "C'est pourquoi…" / "La conséquence est…" |
113
- | Emphasize | "Retenez ceci…" / "Le point clé, c'est…" |
114
- | Transition chapter | "Deuxième point…" / "Passons à…" / "Cela nous amène à…" |
115
- | Mini-recap | "En un mot…" / "Donc, pour ce point…" |
116
- | Close | "Pour récapituler…" / "En résumé…" |
117
- | Recall question | "Question: …? … [answer]" |
118
-
119
- When enumerating, say the count first ("trois points") then speak each one with "D'abord / Ensuite /
120
- Enfin". Never read a literal list.
121
-
122
- ---
123
-
124
- ## Active-Recall Question Catalogue
125
-
126
- Active recall forces the listener to retrieve from memory, which anchors retention far better than
127
- passive re-exposure. Phrase questions so they require **recall**, not recognition (no multiple
128
- choice, no "est-ce que c'est X?" with the answer embedded).
129
-
130
- ### By intent
131
-
132
- | Intent | What to drill | Question shape (FR examples) |
133
- | --- | --- | --- |
134
- | Decide | The decision and its one main driver | "Quelle option recommande-t-on, et pourquoi?" |
135
- | Learn | The definitions and the one mechanism to remember | "Comment définit-on X, et qu'est-ce qui le déclenche?" |
136
- | Monitor | The thresholds and the alert condition | "À partir de quel seuil déclenche-t-on l'alerte?" |
137
- | Compare | The decisive differentiator | "Quelle est la principale différence entre A et B?" |
138
- | Plan | The next concrete action and its owner | "Quelle est la première action à mener, et par qui?" |
139
-
140
- ### Rules
141
-
142
- - Two to three questions for a brief, three to five for a dossier. One is enough for a micro-brief.
143
- - Each question targets a key point from the recap, not a peripheral detail.
144
- - After the question mark, insert `…` so the TTS pause gives the listener a beat to answer silently,
145
- then state the answer in the fewest words possible.
146
- - Do not reveal the answer inside the question. "Le préavis est-il de trente jours?" leaks the
147
- answer. Prefer "Quelle est la durée du préavis?".
148
-
149
- ---
150
-
151
- ## Evidence Separation In Spoken Form
152
-
153
- Spoken audio can still respect the Ragmir separation of evidence and inference. Use language cues,
154
- not formatting:
155
-
156
- - Proven fact: state plainly. "Le contrat fixe le préavis à trente jours."
157
- - Inference: mark it. "Cela suggère que…" / "On peut en déduire que…"
158
- - Uncertainty: mark it. "Ce qu'on ne sait pas encore, c'est…" / "Reste à confirmer…"
159
- - Missing document: name it. "Il manque le courrier de notification, donc…"
160
- - Decision / action: mark it. "La décision à prendre est…"
161
-
162
- This keeps the narration honest without leaning on tables or footnotes that audio cannot carry.
@@ -1,14 +0,0 @@
1
- """Print one sentence per line from a text file.
2
-
3
- Used to render long narrations sentence-by-sentence when an engine benefits from segmentation.
4
- """
5
- import re
6
- import sys
7
-
8
- with open(sys.argv[1], encoding="utf-8") as source:
9
- raw = source.read()
10
- text = re.sub(r"\s+", " ", raw).strip()
11
- for part in re.split(r"(?<=[.!?…])\s+", text):
12
- part = part.strip()
13
- if part:
14
- print(part)
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Render a text file to WAV with Coqui XTTS-v2.
3
-
4
- Run with the dedicated venv interpreter:
5
- ~/.local/share/voice-forge/xtts/bin/python xtts-voice.py <text.txt> <out.wav> [speaker]
6
-
7
- Env: XTTS_SPEAKER (preset name), XTTS_LANG (default "fr").
8
- """
9
- import os
10
- import sys
11
-
12
- os.environ.setdefault("COQUI_TOS_AGREED", "1")
13
-
14
-
15
- def main() -> None:
16
- if len(sys.argv) < 3:
17
- sys.exit("usage: xtts-voice.py <text.txt> <out.wav> [speaker]")
18
- text_file, out_wav = sys.argv[1], sys.argv[2]
19
- speaker = sys.argv[3] if len(sys.argv) > 3 else os.environ.get("XTTS_SPEAKER", "Ana Florence")
20
- language = os.environ.get("XTTS_LANG", "fr")
21
-
22
- with open(text_file, encoding="utf-8") as handle:
23
- text = handle.read().strip()
24
- if not text:
25
- sys.exit("error: empty text file")
26
-
27
- from TTS.api import TTS
28
-
29
- tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
30
- speakers = list(getattr(tts, "speakers", None) or [])
31
- if speakers and speaker not in speakers:
32
- sys.stderr.write(f"speaker '{speaker}' not found; falling back to '{speakers[0]}'\n")
33
- speaker = speakers[0]
34
-
35
- tts.tts_to_file(
36
- text=text,
37
- speaker=speaker,
38
- language=language,
39
- file_path=out_wav,
40
- split_sentences=True,
41
- )
42
- print(out_wav)
43
-
44
-
45
- if __name__ == "__main__":
46
- main()
@@ -1,143 +0,0 @@
1
- ---
2
- name: ragmir-legal-dossier
3
- description: >-
4
- Prepare cited legal-dossier work products from a local Ragmir knowledge base. Use when the user asks
5
- for a legal chronology, clause search, dossier summary, evidence table, redaction review, or
6
- professional-review handoff grounded in confidential local documents.
7
- ---
8
-
9
- # Ragmir Legal Dossier
10
-
11
- Use this skill for legal or quasi-legal dossiers where confidentiality, evidence separation, and
12
- professional review matter. This skill does not provide final legal advice. It prepares structured,
13
- cited work products for review by the user or a qualified professional.
14
-
15
- ## Safety Rules
16
-
17
- - Treat source documents, retrieved passages, party names, dates, amounts, identifiers, and draft
18
- outputs as confidential.
19
- - Keep generated work under `.ragmir/reports/` unless the user explicitly asks for a sanitized
20
- tracked artifact.
21
- - Do not upload documents, snippets, queries, vector stores, or generated drafts to hosted services.
22
- - Do not present conclusions as legal advice. Separate evidence, inference, uncertainty, and review
23
- items.
24
- - Prefer short cited summaries over long raw extracts.
25
- - Flag missing documents, unsupported files, stale indexes, and ambiguous source passages.
26
-
27
- ## Recommended Redaction Patterns
28
-
29
- If a legal dossier includes professional secrecy, case identifiers, or French personal identifiers,
30
- add project-local redaction patterns in `.ragmir/config.json` before indexing. Keep patterns scoped to the
31
- dossier and test them on non-sensitive samples first.
32
-
33
- ```json
34
- {
35
- "redaction": {
36
- "enabled": true,
37
- "builtIn": true,
38
- "patterns": [
39
- {
40
- "name": "case_reference",
41
- "pattern": "\\b(?:RG|N°\\s*RG|No\\s*RG)\\s*[:\\-]?\\s*[0-9A-Z/\\-]{4,}\\b",
42
- "replacement": "[CASE_REFERENCE]"
43
- },
44
- {
45
- "name": "french_nir",
46
- "pattern": "\\b[12]\\s?\\d{2}\\s?\\d{2}\\s?\\d{2}\\s?\\d{3}\\s?\\d{3}\\s?\\d{2}\\b",
47
- "replacement": "[FRENCH_NIR]"
48
- },
49
- {
50
- "name": "iban",
51
- "pattern": "\\b[A-Z]{2}\\d{2}(?:\\s?[A-Z0-9]){11,30}\\b",
52
- "replacement": "[IBAN]"
53
- }
54
- ]
55
- }
56
- }
57
- ```
58
-
59
- After changing redaction rules, rebuild the index:
60
-
61
- ```bash
62
- pnpm exec rgr ingest --rebuild
63
- pnpm exec rgr security-audit --strict
64
- ```
65
-
66
- ## Retrieval Workflow
67
-
68
- Start from readiness checks:
69
-
70
- ```bash
71
- pnpm exec rgr doctor
72
- pnpm exec rgr audit
73
- pnpm exec rgr audit --unsupported
74
- pnpm exec rgr security-audit --strict
75
- ```
76
-
77
- Then run targeted retrieval passes:
78
-
79
- ```bash
80
- pnpm exec rgr search "parties obligations dates amounts" --top-k 8
81
- pnpm exec rgr search "termination clause liability indemnity notice" --top-k 8
82
- pnpm exec rgr search "timeline meeting decision approval refusal" --top-k 8
83
- pnpm exec rgr ask "Which documents support the chronology of events?" --top-k 8
84
- ```
85
-
86
- When MCP is available, prefer `ragmir_status`, `ragmir_search`, `ragmir_ask`, `ragmir_audit`, and
87
- `ragmir_security_audit` so the agent can keep retrieval bounded and cited.
88
-
89
- ## Output Formats
90
-
91
- ### Dossier Summary
92
-
93
- ```markdown
94
- # Legal Dossier Summary
95
-
96
- ## Scope
97
-
98
- ## Evidence Inventory
99
-
100
- ## Key Facts
101
-
102
- ## Main Legal Or Contractual Questions
103
-
104
- ## Risks And Unknowns
105
-
106
- ## Professional Review Items
107
-
108
- ## Sources
109
- ```
110
-
111
- ### Chronology
112
-
113
- ```markdown
114
- | Date | Event | Evidence | Confidence | Review item |
115
- | --- | --- | --- | --- | --- |
116
- | YYYY-MM-DD | | source.md chunk=0 | High/Medium/Low | |
117
- ```
118
-
119
- ### Clause Review
120
-
121
- ```markdown
122
- | Clause topic | Source | Extract summary | Risk | Follow-up |
123
- | --- | --- | --- | --- | --- |
124
- | Termination | contract.docx chunk=3 | | | |
125
- ```
126
-
127
- ### Evidence Gap List
128
-
129
- ```markdown
130
- | Missing or weak evidence | Why it matters | Suggested next document |
131
- | --- | --- | --- |
132
- | | | |
133
- ```
134
-
135
- ## Final Response Checklist
136
-
137
- Before handing back the work:
138
-
139
- - state where the report was saved;
140
- - list source paths used, not private full passages;
141
- - mention unsupported, stale, or missing files;
142
- - include a professional-review section;
143
- - state whether the artifact is safe to commit or must remain local.