Engineering/AI documentation
Autoresearch Configuration
Autoresearch configuration sets parameters for automated research strategies and runs.
Concepts: rag
Implementation Summary
Autoresearch configuration sets parameters for automated research strategies and runs.
Frontend Surface
frontend/src/components/autoresearch/AutoresearchView.tsxbackend/app/core/autoresearch_runners/rag_params.py
State, API, And Backend Contracts
Stores
frontend/src/stores/autoresearchStore.ts- Configuration reads are global runtime settings, but status refreshes shown in this tab still use the active project id.
API And Backend
backend/app/api/routes/autoresearch.py- Autoresearch configuration mutations and global enable/disable toggles require global admin access because they affect every project. Project-facing status, experiments, and leaderboard routes remain project-scoped.
Agentic Dispatcher Migration (Pi Replacement W6)
- Pi Replacement wave W6 (master plan
docs/build-stream/plans/2026-07-20-pi-full-replacement-master-plan.md§8 W6, spec CF-SPEC-8) routes the autoresearch RAG-parameter runner's LLM call through the sharedAgenticDispatcher(backend/app/core/agentic/dispatcher.py, module singletonagentic). W9 retired the preserved legacyllm_router.chatbranch: the dispatcher path is the only path, and a legacy-resolved engine is served by the dispatcher's permanent legacy executor. Engine selection is bound once per experiment: an explicitpiorlegacyvalue wins, while an unset value defaults from the globalsettings.agentic_coreflag (piwhen enabled, otherwiselegacy). The full six-runner routing table and model/temperature sweep semantics are documented on the autoresearch.experiments architecture page; this page covers the RAG-parameter runner specifically. RAGParamsRunner._llm_hypothesis(backend/app/core/autoresearch_runners/rag_params.py) issues its next-parameter suggestion asagentic.completion(purpose="autoresearch.rag_params.hypothesize", spine_phase="plan", engine=self.engine). The bound per-experiment engine is the dispatcher call-level selection, so it does not re-read the global flag or use the generic header/project/default precedence; the dispatcher still fails closed on a selected engine that cannot execute rather than silently falling back.- RAG parameter tuning optimises relevance, not its own weights (F3, 2026-09-25).
RAGParamsRunnerscores each candidate by mean nDCG@10 on the span-graded retrieval benchmark (app.evals.retrieval_eval,tests/evals/retrieval/harbor-ledger-qrels.json) over a sandbox index rebuilt whenever chunking changes. Candidates are staged on the runner and never written to the process-wide settings;rag_rrf_kis tunable; without a benchmark the loop fails closed (BenchmarkUnavailableError); the engine closes the runner's sandboxes when the loop ends. The old objective (0.6 × fused score + 0.4 × coverage) rose with the fusion weights whatever was retrieved. The sandbox embeds throughembed_text/embed_chunks, so it inherits the W8 embeddings dispatch like every other consumer. - Project scope is preserved: the RAG-parameter runner carries the authorized project id bound by the autoresearch engine into its dispatcher call for engine resolution, telemetry, and execution scope, so a Pi run cannot resolve an engine, record telemetry, or execute against a project other than the one that authorized the experiment. Global configuration mutations still require global admin access and contain no project content; runtime experiment execution still requires project authorization.
- Rollback: select the
legacyengine for the project (or keep the legacy global default) and the runner is served by the dispatcher's permanent legacy executor with no schema or behavior change. W9 retired the per-site legacy branch, so the count-to-zero ratchet is 0: the dispatcher path is the only path in product code.
Architecture Notes
- The feature is mounted through
frontend/src/components/autoresearch/AutoresearchView.tsxand the UI navigation path recorded in the inventory. - The frontmatter and manifest entries are the durable contract for agents updating this page after code changes.
- When the referenced component, store, route, agent, skill, or test behavior changes, regenerate and validate the feature documentation.
Agents, Skills, LLM, MCP, And Permissions
- RAG-related behavior depends on project context, documents, memory, or retrieval material referenced by the cited stores and routes. Global config changes must not expose or process project content; runtime experiment execution still requires project authorization.
Tests And Verification
tests/test_autoresearch.pyverifies non-admin researchers cannot mutate global autoresearch config and admins can.tests/test_project_scope_contracts.pyverifies project-facing autoresearch calls carry project ids.tests/pi_production/test_w6_autoresearch_runners.pyverifies the RAG-parameter runner routes_llm_hypothesisthroughagentic.completion(autoresearch.rag_params.hypothesize) unconditionally (W9 retired the legacy branch), and that the retrieval-eval sandbox search (app.evals.retrieval_eval) embeds throughembed_text, so it inherits the W8 dispatch; every measurement runs under the authorised project binding.- Regenerate and validate the machine manifests and static site with
python scripts/feature_docs.py --seed-missing --generate-site --check.
Related Features
Related Concepts
Compass Evidence
- Spec/task: CF-SPEC-60 / CF-754; CF-SPEC-8 (Pi replacement W6 autoresearch-runner dispatcher migration)
- Inventory source:
docs/features/inventory.json
When To Update
- Update this page whenever the listed UI components, stores, routes, model behavior, permissions, or tests change.
- Regenerate the site and machine manifests with
python scripts/feature_docs.py --seed-missing --generate-site --check.