Control gRPC API
Current public MuBit ControlService RPC surface for memory, diagnostics, learning loop, coordination, and explicit planning state.
This page summarizes the current public mubit.v1.ControlService RPC surface. Use it for generated-client debugging and transport-parity checks.
Service identity
- Package:
mubit.v1 - Service:
ControlService
Core memory RPCs
| Group | RPCs |
|---|---|
| Ingestion | Ingest, BatchInsert, GetIngestJob, GetRunIngestStats, ArchiveBlock, Dereference |
| Retrieval and context | Query, GetContext, ListActivity, ExportActivity, GetRunSnapshot |
| Diagnostics and reflection | Diagnose, Reflect, ListLessons, DeleteLesson, GetMemoryHealth |
MAS and learning-loop RPCs
| Group | RPCs |
|---|---|
| Agent identity | RegisterAgent, ListAgents, AgentHeartbeat, AppendActivity |
| Compaction and reinforcement | Checkpoint, RecordOutcome, RecordStepOutcome, SurfaceStrategies |
| Coordination | CreateHandoff, SubmitFeedback |
| Run management | DeleteRun, LinkRun, UnlinkRun |
Managed resources: Projects, Agents, Skills, Prompts
Managed MuBit deployments version agent configuration server-side so prompt + skill changes can be reviewed, rolled out, and rolled back without touching deployed SDK code.
| Group | RPCs |
|---|---|
| Projects | CreateProject, GetProject, ListProjects, UpdateProject, DeleteProject |
| Agent Definitions | CreateAgentDefinition, GetAgentDefinition, ListAgentDefinitions, UpdateAgentDefinition, DeleteAgentDefinition |
| Prompt Lifecycle | SetPrompt, GetPrompt, ListPromptVersions, ActivatePromptVersion, OptimizePrompt, GetPromptDiff |
| Skill Lifecycle | CreateSkill, GetSkill, ListSkills, UpdateSkill, DeleteSkill, ListSkillVersions, ActivateSkillVersion, OptimizeSkill, GetSkillDiff |
| Run history | ListRunHistory, GetRunHistory |
| Control sessions | CreateControlSession, GetControlSession, CloseControlSession |
PromptVersion / SkillVersion lifecycle
Both prompt and skill versions share the same state machine:
statustransitions:candidate→active(viaActivatePromptVersion/ActivateSkillVersion) →retired(when a newer version becomes active) →archived.sourcevalues:manual(written viaSetPrompt/CreateSkill),optimization(minted byOptimizePrompt/OptimizeSkill),rollback(restored from a retired version).- Each version carries outcome aggregates:
avg_outcome_score,outcome_count, andoptimization_summary.
OptimizePrompt and OptimizeSkill accept an optional LlmOverride (provider, model, temperature, max_tokens, timeout_ms) so you can steer which model synthesises the candidate.
GetPromptDiff / GetSkillDiff return a unified diff_text comparing any two versions — the same text the console surfaces in its review UI.
Deprecated planning state RPCs
The following RPCs remain wired for backward compatibility but are no longer the recommended path. Use external task/orchestration systems (Linear, Jira, LangGraph, CrewAI) for goals, actions, and decision cycles. See State management endpoints for guidance.
| Group | RPCs | Recommendation |
|---|---|---|
| Goals | AddGoal, UpdateGoal, ListGoals, GetGoalTree | Deprecated — track goals in your task system |
| Actions | SubmitAction, GetActionLog | Deprecated — use LangGraph / CrewAI |
| Decision cycles | RunCycle, GetCycleHistory | Deprecated — use your agent orchestration framework |
| Variables | SetVariable, GetVariable, ListVariables, DeleteVariable | Still supported for run-scoped working memory |
| Concepts | DefineConcept, ListConcepts | Still supported for typed concept definitions |
Practical parity checks
- Helper-first SDKs should map cleanly onto these RPC groups even when they expose more ergonomic names.
GetContextis the primary gRPC compaction-safe context assembly surface.ListActivityandExportActivityare the chronological audit/browse surfaces; use them when you need exact ordering and pagination rather than ranked retrieval.Diagnose,GetMemoryHealth,Reflect,RecordOutcome,RecordStepOutcome, andSurfaceStrategiesare the key loop-inspection and reinforcement RPCs.RecordStepOutcomerecords per-step process rewards with signal, rationale, and directive hint for dense RL within a run.Reflectacceptsstep_id,last_n_items, andinclude_step_outcomesfor step-wise scoped reflection.Ingest,Query, andGetContextaccept lane fields (lane,lane_filter) for multi-agent memory isolation within a shared run.ArchiveBlockandDereferenceare the exact-reference pair: archive an exact artifact once, then recover it later by stablereference_id.
Evidence provenance and telemetry
Query and GetContext now expose exact-reference provenance on surfaced evidence:
retrieval_modereference_idreferenceableorigin_entry_type
AgentQueryResponse also returns a citations field (repeated uint32, field 9) — 0-based indices into evidence marking which items grounded final_answer (empty when the answer cites no specific evidence). The indices are validated server-side against the evidence length, so every value is a valid index into evidence.
GetContext also returns context-pressure telemetry:
- source counts by entry type and retrieval mode
- evidence candidates considered
- evidence dropped by token budget
- exact references surfaced
Step-level outcomes
RecordStepOutcome records a per-step process reward signal within a run, complementing the run-level RecordOutcome. Use it after each agentic step where you want dense feedback for reflection.
| Field | Type | Description |
|---|---|---|
run_id | string | Session/run identifier |
step_id | string | Unique step identifier within the run |
step_name | string | Human-readable step label (e.g. "initial_planning") |
outcome | string | One of success, failure, partial, neutral |
signal | float | Reward signal from -1.0 to 1.0 |
rationale | string | Why this outcome was assigned |
directive_hint | string | Hindsight guidance for future runs (Hindsight-Guided OPD) |
agent_id | string | Agent that performed the step |
user_id | string | Optional logical user scope |
metadata_json | string | Arbitrary JSON metadata |
Response returns step_outcome_id and accepted. Emits context.step_outcome_recorded event.
Run-level outcome attribution
RecordOutcomeRequest carries two fields for accurate, idempotent reinforcement:
| Field | Type | Description |
|---|---|---|
entry_ids | repeated string (field 9) | Additional memory entry IDs that contributed to this outcome (multi-entry attribution). Attribute the outcome to every contributing recalled entry so each one's reinforcement counters update, not just the primary reference_id — which is never double-counted if it also appears here. Unknown or out-of-scope IDs are skipped. |
idempotency_key | string (field 10) | Optional client-supplied dedup token. When set, the server applies the outcome at most once for the token — a retry with the same token (e.g. after a transport timeout) returns success without re-applying the signal, so reinforcement counts and champion/challenger stats aren't double-counted. Leave empty to opt out. |
Lane-scoped memory
Lanes partition memory within a shared run so each agent sees only relevant entries.
| RPC / Field | Description |
|---|---|
IngestItem.lane | Tags ingested items with a named lane |
AgentQueryRequest.lane_filter | Retrieves only entries tagged with the specified lane |
ContextRequest.lane_filter | Filters context assembly by lane |
AgentRegisterRequest.shared_memory_lanes | Declares which lanes an agent participates in |
Items without a lane are visible to all queries. Items with a lane are visible only when lane_filter matches or is empty.
lane (MAS memory isolation) is distinct from the core data-plane retrieval lane concept used in direct search routing.
Failure modes and troubleshooting
| Symptom | Root cause | Fix |
|---|---|---|
| gRPC behavior differs from helper behavior | You are comparing a helper to the wrong raw RPC | Check whether the helper wraps Query, GetContext, or another control RPC |
| Reflection succeeds but learning feels weak | Outcomes are not being recorded | Pair Reflect with RecordOutcome |
| Context feels incomplete | Wrong mode or budget settings | Validate ContextRequest mode, sections, and token budget fields |
| Step outcomes recorded but reflection ignores them | include_step_outcomes defaults to false | Pass include_step_outcomes=True in ReflectRequest |
| Lane-filtered query returns nothing | Lane name mismatch or items ingested without lane | Verify the lane value at ingest time matches lane_filter at query time |
Next steps
- Review HTTP route names at Control HTTP reference.
- Review the helper-first SDK surfaces at SDK methods.