-
Notifications
You must be signed in to change notification settings - Fork 0
Learn Ollama
This document defines the mq-agent boundary for optional Ollama-backed learn workflows in the mq ecosystem.
Ollama may be used by mq-mcp as a local extraction model for learn workflows:
review output -> pattern extraction -> structured learning record
Ollama is not an autonomous agent. It should not execute commands, mutate repositories, write memory silently, override mq-mcp safety classes, or perform final risk scoring.
mq-mcp
owns learn contracts, safety classes, review logic, validation and storage
Ollama
optionally extracts patterns from mq-mcp review findings into structured JSON
mq-agent
surfaces learn status/search/explain through the mq-mcp bridge
mq-agent must not implement local learn extraction, schema validation, memory storage, prompt handling, or model-specific learn policy. Those behaviors belong in mq-mcp so the safety and storage rules stay centralized.
When mq-mcp adds or configures an Ollama learn provider, the provider should be
treated as optional and local-first. The recommended model profile is a
deterministic pattern extractor, for example mq-learn, with low temperature,
fixed seed, bounded context and JSON-only output.
The learn record contract should be validated by mq-mcp before storage. At a minimum, mq-mcp should reject:
- non-JSON output
- missing evidence
- unknown fields unless the contract explicitly allows them
- records with
should_store=truewithout caller approval - low-confidence records from automatic storage
- prompt-injection text inside reviewed content being treated as instructions
Storage must require explicit approval from the caller or operator. A dry-run or read-only extraction mode should be the default.
mq-agent only exposes read-only learn commands:
mq-agent learn status
mq-agent learn search <query>
mq-agent learn explain <pattern-id>If mq-mcp does not expose the required learn tools, mq-agent should report a clear optional-provider or missing-tool message and keep the rest of the command surface usable.
The Ollama-specific implementation should land in mq-mcp first:
- Add the
mq-learnModelfile or equivalent provider configuration. - Add the JSON learn record contract and validation.
- Add a read-only or dry-run extraction path.
- Require explicit approval for storage.
- Add tests for invalid JSON, prompt-injection-as-data, missing Ollama and no-storage-without-approval.
After that exists in mq-mcp, mq-agent may update docs or rendering for any new read-only status fields returned by the bridge.