doubleo7/src/models.rs
Austin Schaefer ec15893c9c
All checks were successful
CI / test (pull_request) Successful in 1m52s
Add document embedding and retrieval via a dedicated embedding model
Adds --doc (repeatable, file or directory) so the researcher can draw on
user-supplied documents alongside the web: documents.rs resolves paths
into embeddable text, retrieval.rs embeds them with a dedicated
embedding model (nomic-embed-text, separate from the chat models used
elsewhere) into an in-memory vector index and retrieves the excerpts
most relevant to the topic once up front, and researcher.rs folds those
excerpts into the researcher's task under the same footnote-citation
scheme already used for web sources. The embedding and retrieval phases
show progress the same way every other phase does — a spinner while
embedding, a summary line once excerpts are retrieved, tracing spans
for -l mode.

Verified against a live Ollama nomic-embed-text pull and a real
research round: a planted fact sheet was correctly ranked as the most
relevant of several embedded documents and appeared in the researcher's
task before its first turn.
2026-08-18 14:27:54 +02:00

14 lines
831 B
Rust

/// The tool-calling research loop needs to reliably decide what to search
/// for, when a page is worth fetching, and when it has enough evidence —
/// that's a reasoning-heavy job best given to the largest local Gemma
/// variant. Turning gathered notes into prose (writing, summarizing) is
/// comparatively mechanical, so the smaller/faster variant handles those
/// passes instead.
pub(crate) const RESEARCHER_MODEL: &str = "gemma4:26b";
pub(crate) const WRITER_MODEL: &str = "gemma4-e4b:latest";
/// Deliberately a dedicated embedding model rather than reusing a chat model
/// for embeddings — it's trained for semantic similarity, not chat, and
/// Ollama's `nomic-embed-text` is a well-known identifier Rig already knows
/// the output dimensionality for.
pub(crate) const EMBEDDING_MODEL: &str = "nomic-embed-text";