A curated collection of practical AI projects implementing OCR systems, RAG, AI agents, and other AI use cases.
Build Log
Progress notes for the Offline Troubleshooting Agent build, tracked against the
14-step implementation order in PROJECT_REFERENCE.md section 31. This file is
a working log, not user-facing documentation — see the README (step 14) for
that once it exists.
Status against section 31's 14 steps
Done:
- Machine simulator —
simulator/machine.py,simulator/scenarios.py,simulator/history.py - Local Gradio UI (machine status only) —
ui/gradio_app.py,app.py - Local Ollama connection —
agent/llm_client.py - Local embedding model —
memory/embeddings.py - Actian VectorAI DB connection —
memory/vectorai_client.py,docker-compose.yml - Manual ingestion and retrieval —
memory/manual.py,documents/*.md - Incident storage and retrieval —
memory/incident_store.py,models/schemas.py(Incident),data/seed_incidents.json - Agent tools —
agent/tools.py,agent/state.py - Agent loop —
agent/harness.py,agent/prompts.py, plus Gradio wiring for Investigation/Retrieved Memory/Recommendation panels
Remaining:
- Confirmation + save flow — human-in-the-loop UI that calls
memory.incident_store.save_incident()after a technician confirms the real cause and fix (per section 17). Not built yet;save_incidentis not reachable from the agent loop at all right now (see decision below). - Persistence test — save an incident, restart the app, confirm it's still retrievable (section 22).
- Offline test — full network-disabled run-through per section 19 Part 3 / section 20.
- Automated tests — the test suite already covers most of sections 26's checklist incrementally as each piece was built (simulator, memory, manual retrieval, tools, agent behavior with mocked LLM output), but hasn't had a final pass against the full section 26 list, and
tests/test_offline_assumptions.pydoesn't exist yet. - README polish — current
README.mdis still the step-1 placeholder.
Key deviations and fixes made along the way
- Docker service renamed to avoid a port collision. The original
docker-compose.ymlused service/container namevectoraion host ports 6573-6575, which collided with an unrelated project's already-running container of the same name on the same ports. Renamed tooffline-troubleshooting-vectorai, remapped to host ports 6673-6675 (container-internal ports unchanged), and updated.env'sACTIAN_VECTORAI_PORTto6674accordingly. This project's ownlocal_data/volume was verified to be freshly created and isolated from the other project's data. - Shared
_normalize_taghelper for untagged model names. Ollama'sclient.list()returns fully-tagged names (e.g.nomic-embed-text:latest), but.envoften configures a model without an explicit tag (e.g.EMBEDDING_MODEL=nomic-embed-text). A naive string-equality check between the two reportsmodel_available: Falseeven when the model is actually pulled. Fixed with a shared_normalize_tag(name)helper (name→name:latestwhen no tag is present) inagent/llm_client.py, reused bymemory/embeddings.py'sembedding_health_check()andagent/llm_client.py's ownhealth_check(). Covered by a regression test intests/test_llm_client.py. - Protobuf version conflict resolved with a project-local
.venv(discovered in step 5). Installingactian-vectorai-clientpulled in aprotobufversion that conflicted with other tooling already installed outside the project. Rather than fight the conflict, the project was pinned to its own isolated.venv/, created beforepip install -r requirements.txtand activated for every subsequent step. This keeps the project's dependency set fully isolated from whatever else is installed on the machine, and is now documented as its own setup step in the README. - UUID-only
PointStruct.idconstraint (discovered in step 5). The realactian-vectorai-clientSDK only accepts a non-negative int or a valid UUID string as a point id — an arbitrary string (e.g."inc-1") raises aValidationError. This directly shapesIncident.incident_id: it must always be generated asstr(uuid.uuid4())for new incidents, or a deterministicstr(uuid.uuid5(uuid.NAMESPACE_URL, ...))for reproducible seed data (used indata/seed_incidents.jsonand manual-chunk ids inmemory/manual.py). - JSON-based duplicate-call signature (step 9). The agent loop's duplicate-tool-call detection originally built a signature as
(name, tuple(sorted(args.items()))), which crashes withTypeError: unhashable type: 'list'the moment any tool argument is a list — whichfinish_investigationalways has (supporting_evidence,retrieved_incident_ids,manual_sourcesare all lists). Fixed by using a stable JSON string (json.dumps(args, sort_keys=True, default=str)) as the signature instead, inagent/harness.py.
Architectural decision: save_incident is never model-callable
Per section 17, nothing may be written to permanent memory until a human
confirms it. memory.incident_store.save_incident() is deliberately not
included in AgentTools.tool_list() and therefore never reaches
ollama.chat(tools=...) — the model has no way to invoke it, directly or
indirectly. This is locked in with an explicit test
(tests/test_tools.py::test_tool_list_does_not_include_save_incident) so it
can't regress silently in a later step. save_incident will only be called
by step 10's human-confirmation UI flow, after a technician reviews and
confirms (or corrects) the agent's finish_investigation output.
Current blocker
qwen3:4b-instruct (the project's configured default OLLAMA_MODEL) has not
been pulled yet on this machine — the pull was started but is slow over the
current connection. As a result:
scripts/check_agent.pycorrectly exits early with a clear "model not pulled" message when run against the real configured default, rather than failing partway through.- Step 9's agent loop (
agent/harness.py) and its Gradio wiring were validated for real end-to-end behavior using two substitute local models instead:llama3.2:3b(weaker — didn't reliably callfinish_investigation, correctly triggered the fallback path) andgemma4:e4b(stronger — completed a full clean investigation through tofinish_investigation, all three UI panels populated correctly). - This gives good confidence the harness logic itself is correct (also
covered by fully-mocked unit tests in
tests/test_agent.py), but step 9 should not be treated as fully closed until one real run against the actual configured default (qwen3:4b-instruct) has been done viapython scripts/check_agent.py.
Docker container note
Two Actian VectorAI containers currently exist on this machine, for two unrelated projects:
- This project:
offline-troubleshooting-vectorai, host ports6673-6675, backed by this project's ownlocal_data/directory. - A different project (
actian project/clinical-search): containervectorai, host ports6573-6575, backed by that project's ownlocal_data/directory.
Do not stop, restart, rename, or otherwise touch the vectorai container —
it belongs to the other project and is unrelated to this one.