Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat: expose UltraWiki answers to agents and CLI

Ruben Lütke2f9eb41fa841
diff --git a/docs/commands-reference.md b/docs/commands-reference.md
index 5f75bc2b76..2d317e328a 100644
--- a/docs/commands-reference.md
+++ b/docs/commands-reference.md
@@ -161,6 +161,16 @@ Store one self-contained fact or summary through the guarded Wiki curator. The c
- **Desktop UI section:** `memory`
- **Voice example (EN):** "store that in my wiki"
+## `ultrawiki-ask` — Ask the knowledge base
+
+Answer one question from UltraWiki evidence and return the numbered source citations used for the answer.
+
+- **Endpoint:** `POST /api/ultrawiki/ask`
+- **Arguments:** `question` (string; required); `k` (integer; optional); `area` (string; optional)
+- **Requires confirmation:** no
+- **Desktop UI section:** `memory`
+- **Voice example (EN):** "ask my ultrawiki"
+
## `people-list` — List the people I know
List the people the knowledge base has identified, newest evidence merged, optionally filtered by a name or an identifier (an e-mail address, a phone number). Use this to answer 'who do you know about' and to look up which stored person a spoken name refers to.
diff --git a/docs/jarvis-cli-reference.md b/docs/jarvis-cli-reference.md
index 743185802e..01e17eb250 100644
--- a/docs/jarvis-cli-reference.md
+++ b/docs/jarvis-cli-reference.md
@@ -202,6 +202,7 @@ _Generated from the curated command tree by `scripts/ci/gen_cli_reference.py`
## ultrawiki
+- `jarvis ultrawiki ask <question> --evidence --area` — Answer from retrieved evidence and include source citations.
- `jarvis ultrawiki export --yes --dry-run` — Write the knowledge base to the Obsidian vault as Markdown.
- `jarvis ultrawiki graph --min-mentions` — The entity graph: which topics come up together, and how often.
- `jarvis ultrawiki moments --topic --month --limit` — Browse the distilled moments, newest first.
diff --git a/jarvis/cli_ctl/commands/ultrawiki.py b/jarvis/cli_ctl/commands/ultrawiki.py
index 4b79af187b..9553270967 100644
--- a/jarvis/cli_ctl/commands/ultrawiki.py
+++ b/jarvis/cli_ctl/commands/ultrawiki.py
@@ -18,6 +18,25 @@ app = typer.Typer(
)
+def ask(
+ question: str = typer.Argument(..., help="Question to answer from the knowledge base."),
+ k: int = typer.Option(10, "--evidence", "-k", min=1, max=20),
+ area: str = typer.Option("", "--area", help="Optional UltraWiki area id."),
+) -> None:
+ """Answer from retrieved evidence and include source citations."""
+ body: dict[str, object] = {"question": question, "k": k}
+ if area:
+ body["area"] = area
+ invoke.run(
+ "POST",
+ "/api/ultrawiki/ask",
+ body=body,
+ dangerous=False,
+ request_timeout_s=90.0,
+ )
+
+
@app.command()
def topics(
search: str = typer.Option("", "--search", "-s", help="Filter topic labels."),
diff --git a/jarvis/commands/registry.py b/jarvis/commands/registry.py
index 3147e1a8de..642b25bd34 100644
--- a/jarvis/commands/registry.py
+++ b/jarvis/commands/registry.py
@@ -459,6 +459,44 @@ def _build_registry() -> tuple[AppCommand, ...]:
"es": ("guarda eso en mi wiki",), # i18n-allow: input vocab
},
),
+ AppCommand(
+ id="ultrawiki-ask",
+ title="Ask the knowledge base",
+ description=(
+ "Answer one question from UltraWiki evidence and return the "
+ "numbered source citations used for the answer."
+ ),
+ method="POST",
+ path="/api/ultrawiki/ask",
+ worker_allowed=True,
+ params={
+ "type": "object",
+ "properties": {
+ "question": _str_param(
+ "Question to answer from the knowledge base.",
+ min_length=1,
+ max_length=4_000,
+ ),
+ "k": {
+ "type": "integer",
+ "description": "Maximum evidence items to retrieve (1-20).",
+ "minimum": 1,
+ "maximum": 20,
+ },
+ "area": _str_param(
+ "Optional UltraWiki area id.",
+ max_length=200,
+ ),
+ },
+ "required": ["question"],
+ },
+ ui_section="memory",
+ voice_aliases={
+ "de": ("frag mein ultrawiki",), # i18n-allow: input vocab
+ "en": ("ask my ultrawiki",),
+ "es": ("pregunta a mi ultrawiki",), # i18n-allow: input vocab
+ },
+ ),
AppCommand(
id="people-list",
title="List the people I know",
diff --git a/tests/unit/cli_ctl/test_commands_ultrawiki.py b/tests/unit/cli_ctl/test_commands_ultrawiki.py
index f75d847f0b..3a2e46654b 100644
--- a/tests/unit/cli_ctl/test_commands_ultrawiki.py
+++ b/tests/unit/cli_ctl/test_commands_ultrawiki.py
@@ -15,6 +15,18 @@ from jarvis.cli_ctl.__main__ import app
runner = CliRunner()
+def test_ask_sends_question_and_evidence_limit(capture_api):
+ result = runner.invoke(
+ app,
+ ["ultrawiki", "ask", "What changed?", "--evidence", "4", "--area", "work"],
+ )
+ assert result.exit_code == 0
+ call = capture_api["calls"][-1]
+ assert call["method"] == "POST"
+ assert call["path"] == "/api/ultrawiki/ask"
+ assert call["body"] == {"question": "What changed?", "k": 4, "area": "work"}
+
+
def test_topics_lists_the_entity_pages(capture_api):
runner.invoke(app, ["ultrawiki", "topics"])
call = capture_api["calls"][-1]