Luria Voice includes optional integration with Ollama, a tool for running large language models locally. When Ollama is running on your machine, theDocumentation Index
Fetch the complete documentation index at: https://docs.brainworkup.org/llms.txt
Use this file to discover all available pages before exploring further.
cingulate R package can use it to generate first-draft narrative text for each cognitive domain based on the score data you have already loaded. This can reduce the time spent on initial write-ups, but all AI-generated text must be reviewed and edited by a licensed clinician before inclusion in any report.
How the integration works
Whencingulate is loaded in an R session, it checks whether Ollama is reachable at localhost:11434. If it is, narrative generation functions become available. If Ollama is not running, all other cingulate functions (data loading, tables, plots) continue to work normally — the AI features are entirely opt-in.
There is no API key or cloud service involved. All model inference happens on your local machine, which means patient data never leaves your environment.
Step 1: Install Ollama
Download and install Ollama from ollama.com. Follow the installer for your operating system. After installation, start the Ollama service:- macOS / Linux
- Windows
localhost:11434 by default.Step 2: Pull a language model
Pull a model suited for clinical text generation.llama3 is a good general-purpose starting point; larger models produce higher-quality output at the cost of more RAM and slower generation.
- Lightweight (8 GB RAM)
- Higher quality (16+ GB RAM)
- List available models
bash ollama pull llama3 You only need to pull a model once. It is stored locally and reused on
subsequent runs.
Step 3: Enable narrative generation in your report
In the setup chunk at the top oftemplate.qmd, load cingulate. No additional configuration is needed — the package detects Ollama automatically.
Step 4: Generate a domain narrative
Inside a domain partial (for example,_attention.qmd), call generate_narrative() after loading score data. The function returns a character string of draft narrative text.
Customizing the prompt
You can pass a custom system prompt togenerate_narrative() to adjust the model’s tone, length, or clinical framing:
Checking Ollama connection status
If you are unsure whether Ollama is running, you can check the connection from R before attempting narrative generation:Workflow recommendation
Using AI narratives most effectively in practice:- Run
quarto renderonce with Ollama active to generate all domain narrative drafts. - Read each draft carefully and mark areas requiring correction or expansion.
- Edit the narratives directly in the
.qmdpartial files, replacing or supplementing the AI output with your clinical judgment. - Re-render the final report with your edited prose in place.
You do not need to call
generate_narrative() on every render. Once you have
edited the draft text and placed it directly in the .qmd file as plain
prose, you can remove or disable the narrative generation code chunk entirely.