engram

Error Codes

engram error codes reference

Error Codes

Every error in engram has a numeric code. The first digit identifies the subsystem.

1xxx: Storage / Database

CodeNameDescription
1000StorageGeneral storage error
1001DatabaseUnavailableDatabase connection failed or unavailable
1002NotFoundRecord not found by the specified ID
1003DuplicateKeyAttempt to create a record with an existing ID
1004MigrationRequiredDatabase schema migration required

2xxx: API / LLM

CodeNameDescription
2000ApiGeneral API error
2001EmbeddingApiUnavailableEmbedding API unavailable (network, server)
2002LlmApiUnavailableLLM API unavailable
2003RateLimitExceededAPI rate limit exceeded
2004InvalidApiKeyInvalid API key
2005HyDeGenerationFailedFailed to generate HyDE hypothesis
2006LocalModelLoadFailedFailed to load local ONNX model
2007LocalInferenceFailedLocal inference error (NaN/Inf in logits)

Errors 2001, 2002, 2003 are retryable.

3xxx: HNSW

CodeNameDescription
3000HnswGeneral HNSW error
3001IndexCorruptedIndex data is corrupted
3002DimensionMismatchVector dimension does not match index dimension
3003RebuildRequiredIndex needs to be rebuilt

4xxx: Protocol / Router

CodeNameDescription
4000InvalidJsonInvalid JSON in request

5xxx: Consolidation

CodeNameDescription
5000ConsolidationGeneral consolidation error
5001NoCandidatesNo consolidation candidates found
5002IndexStaleIndex is stale, rebuild required
5003InvalidMergeParamsInvalid merge parameters
5004AnalysisFailedLLM analysis failed
5005ApplyFailedFailed to apply recommendations

6xxx: Core

CodeNameDescription
6001ConfigNotFoundConfiguration file not found
6002ConfigParseErrorConfig parse error (invalid TOML)
6003InvalidProviderUnsupported or misconfigured provider
6004IndexCorruptedHNSW index corrupted at core level
6005RebuildFailedIndex rebuild failed
6006SocketErrorUnix socket error (bind, read, write)
6007DispatchErrorRequest routing error (unknown method, invalid params)
6008ConfigReadOnlyAttempt to write config via API (forbidden)
6009ExportFailedDatabase export error
6010ImportVersionMismatchImport format version mismatch (expected 1)
6011ImportFailedMemory import error
6012InitFailedInitialization error
6013TrainerFailedTrainer not found or exited with error
6014TrainerTimeoutTrainer exceeded timeout (default 300 sec)
6015TrainerMalformedOutputInvalid JSON in trainer output

Degraded mode

On API errors (2001-2003), the system enters degraded mode. Responses in this mode contain a degraded: true flag. Search switches to FTS5-only, scoring uses heuristics instead of LLM.