Skip to content

feat(live): auto-instrument tools, MCP, memory/DB, graphs, mesh - #899

Merged
AmitoVrito merged 2 commits into
mainfrom
feat/live-instrument-subsystems-898
Aug 1, 2026
Merged

AmitoVrito merged 2 commits into
mainfrom
feat/live-instrument-subsystems-898

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Closes #898. The SynapseKit Live blind spots now stream to the dashboard automatically.

A small engine (synapsekit/live/instrument.py) wraps key async methods to publish bus events — mirroring the observe BaseLLM auto-instrumentation:

Subsystem Event Coverage
Tools + MCP tools tool.call BaseTool.run — base + every subclass + future ones (__init_subclass__)
Agent memory / DB memory.read / memory.write AgentMemory.store / recall
Knowledge graphs graph.query / graph.ingest WorldModelRAG + property-graph backends
Knowledge mesh mesh.query / mesh.ingest KnowledgeMesh
  • Async-preserving (iscoroutinefunction asserted), near-zero when off (early return), idempotent, no new deps.
  • Wired into live.enable(); dashboard renders new kinds (icons + Story summaries).
  • 6 new tests: tool/memory streaming, error status, future-subclass hook, no-op-when-off.

Closes the SynapseKit Live blind spots (#898): the paths observe spans
missed now stream to the dashboard automatically.

A small instrumentation engine (synapsekit/live/instrument.py) wraps key
async methods to publish bus events with timing + attributes, mirroring
the observe BaseLLM auto-instrumentation:
  - BaseTool.run → tool.call (covers all tools AND MCP tools, which
    subclass BaseTool) — patches base + every existing subclass + future
    ones via __init_subclass__
  - AgentMemory.store/recall → memory.write / memory.read (DB)
  - WorldModelRAG.query/retrieve/ingest + property-graph backends →
    graph.query / graph.ingest
  - KnowledgeMesh.query/ingest_okf → mesh.query / mesh.ingest

Async-preserving (iscoroutinefunction asserted), near-zero when the bus
is disabled (early return), idempotent, no new dependencies. Wired into
live.enable(); dashboard renders the new event kinds (icons + Story
summaries). Tests cover tool/memory streaming, error status, the
future-subclass hook, and the no-op-when-off path.
examples/live_real_run.py runs ordinary BaseTool + AgentMemory calls with
Live enabled so their tool.call / memory.read / memory.write events stream
into the dashboard automatically — no hand-published events.
@AmitoVrito
AmitoVrito merged commit 54569d5 into main Aug 1, 2026
12 checks passed
@AmitoVrito
AmitoVrito deleted the feat/live-instrument-subsystems-898 branch August 1, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SynapseKit Live: instrument the blind spots (DB, knowledge graphs, MCP, loaders, tools)

1 participant