Skip to main content
Common issues and solutions when working with MuBit SDKs and APIs.

Authentication

Invalid API key

Symptom: 401 Unauthorized or UNAUTHENTICATED gRPC error. Causes and fixes:
CauseFix
Malformed keyAPI keys follow the format mbt_<instance>_<key_id>_<secret>. Verify all four segments are present.
Wrong instanceThe instance tag in the key must match the endpoint’s instance. Check your MUBIT_API_KEY.
Revoked keyKeys can be revoked via revokeUserApiKey. Generate a new key with rotateUserApiKey.
Missing env varEnsure MUBIT_API_KEY is set in your environment or passed to the SDK constructor.

Transport and connectivity

Connection refused

Symptom: ECONNREFUSED or Connection refused.
ContextFix
Local developmentEnsure MuBit is running (make run-mubit). Default ports: HTTP 3000, gRPC 50051.
Hosted endpointCheck network connectivity to api.mubit.ai. Verify no firewall blocking HTTPS/443.
gRPC transportVerify MUBIT_GRPC_ENDPOINT points to the correct host:port.

Transport selection issues

Symptom: Unexpected transport used, or auto-detection fails. Set MUBIT_TRANSPORT explicitly to "http" or "grpc" instead of relying on "auto". The auto probe can fail in restricted network environments.

gRPC field names wrong (JS SDK)

Symptom: Response fields use camelCase instead of snake_case proto names, or vice versa. Fix: Update @mubit-ai/sdk to v0.4.1+ which includes the keepCase fix.

Memory and retrieval

Recall returns empty results

CauseFix
Data not yet ingestedIngest is async. Wait for the ingest job to complete (poll getIngestJob).
Wrong run_idrecall scopes by run_id. Ensure you’re querying the same run.
Entry types filter too narrowBroaden entry_types or omit it to search all types.
Lane mismatchIf using lanes, ensure lane_filter matches the lane used at ingest time.

Context block is empty or too small

CauseFix
Token budget too lowIncrease max_token_budget (default may be 300).
No relevant evidenceIngest more data or broaden the query.
Wrong modeTry different mode values: "summary", "full", "compact".
Run has no dataVerify the run_id has ingested data with listActivity.

Lessons not appearing after reflect

CauseFix
No outcomes recordedPair reflect() with recordOutcome() for stronger lesson extraction.
Too few data pointsReflection needs sufficient evidence. Ingest more interactions before reflecting.
Step outcomes not includedPass include_step_outcomes=True to include step-level signals.

Runs and scoping

Run scope conflicts

Symptom: Data from one run appears in another, or data is missing.
  • Runs are the primary isolation boundary. Each run_id scopes its own data.
  • Linked runs (linkRun) share data intentionally. Check if runs are linked.
  • Use listRuns() to see active runs and their relationships.

Cannot delete a run

Symptom: deleteRun fails or data persists.
  • Run deletion is permanent and removes all associated data.
  • Ensure no active ingest jobs are running for the run.
  • Both control and core planes have deleteRun — the control version handles both.

Lesson promotion

How lesson promotion works

Lessons are promoted through scopes based on recurrence:
  1. Run-scoped — extracted from a single run’s evidence
  2. Session-scoped — promoted when the same lesson appears across multiple runs
  3. Global — promoted when recurring across sessions
Promotion happens automatically during reflect(). You can inspect lesson scope with listLessons().

Integration packages

Framework adapter not connecting

All integration packages (mubit-crewai, mubit-langgraph, etc.) use the core SDK internally. Verify:
  1. MUBIT_API_KEY is set
  2. MUBIT_ENDPOINT points to a reachable MuBit instance
  3. The adapter package version matches your SDK version

Getting help