Skip to content

Diagnostic Assistant

Technicians match symptoms and trouble codes to past repairs.

Industry Level Difficulty Recommended mode
Robotics & automotive 2 of 5 Intermediate flat
  • Trouble codes have many causes.
  • Repair history is unsearchable.
  • Diagnostics take hours.
  1. Repair records are embedded with codes and fixes.
  2. Symptoms query similar past repairs.
  3. Ranked fixes shown.
  4. New repairs added with upsert.
Today With Diagnostic Assistant on SrvDB
Trial-and-error Ranked likely fixes
Lost history Searchable repairs
Long diagnostics Faster fixes
  1. Embed repair records.
  2. Query by symptom.
  3. Rank fixes.
  4. Repair.
  5. Record outcome.
  • Exact search (flat): every query compares against every stored vector, so results are exact and explainable.
  • upsert: inserts new items and replaces changed ones, so the knowledge base stays current.
  • Crash-safe persist(): after it returns, data survives a crash or power loss and reopens exactly as committed.
  • True cosine scores: scores in [-1, 1] mean the same in every mode, so thresholds are stable.
  • Engine faults
  • Electrical issues
  • EV battery faults
  • Robot actuator errors
  • Fleet trucks
  • Warranty analysis

embed() is your embedding model (for example sentence-transformers, or a function that turns your records into feature vectors).

import json
import srvdb
db = srvdb.Database("./diagnostic-assistant-db", dimension=384)
def ingest(items):
"""items: list of (id, text, metadata dict)"""
db.upsert(
ids=[i for i, _, _ in items],
embeddings=[embed(t) for _, t, _ in items],
metadatas=[json.dumps(m) for _, _, m in items],
)
db.persist() # crash-safe checkpoint
def similar_repairs(symptom, k=5):
hits = db.search(embed(symptom), k)
return [(json.loads(db.get(i)), round(score, 3)) for i, score in hits]
  • Technicians verify every fix.
  1. Prototype: load a sample of real data with flat mode and check that searches return what an expert expects.
  2. Measure: if you move to an approximate mode, compare its results with flat on the same queries (recall).
  3. Pipeline: add continuous upsert and decide when to call persist().
  4. Harden: test restarts and crashes, add logging, review every output path with domain experts.
  5. Deploy: ship the database directory with the application or service.
Level Project What it does
1 · Beginner In-car Manual Assistant Answers drivers’ questions from the owner’s manual, offline.
2 · Intermediate Diagnostic Assistant (this page) Technicians match symptoms and trouble codes to past repairs.
3 · Advanced Scenario Miner Finds driving or robot episodes similar to a scenario of interest.
4 · Expert Robot Episodic Memory Robots remember places, objects and outcomes.
5 · Frontier Autonomous Fleet Memory Share learned experience across a fleet with database snapshots.

See also: Use cases · Live examples (coming soon)