Skip to content

Agent extension points: LlmClient/ConversationMemory SPI, connector-backed agent tools, event triggers #5407

Description

@qqeasonchen

Motivation

The eventmesh-agent module (mode-1 streaming agent) is currently closed for extension:

  • StreamingAgent hard-depends on the concrete OpenAiLlmClient — plugging a non-OpenAI-protocol LLM requires forking
  • ConversationStore has no interface — no persistence story (restart loses sessions; docs mark it TODO)
  • No tool-calling capability at all — the agent cannot act on the mesh, only chat. This is the biggest gap vs. peer agent runtimes (Dify tool plugins, Solace Agent Mesh remote tools) and leaves the 23 shipped connector plugins unusable as agent capabilities
  • No event-driven trigger path — an agent cannot be driven by topic subscriptions (order-changed events, CDC, alerts) without a human in the loop
  • Port drift: agent/connector/examples still default to http://localhost:8080 while the runtime's default has been 10105 since the port migration

Proposal

Open the agent module for extension, connector-first:

  1. LlmClient SPI — token stream() + function-calling chat(); OpenAiLlmClient becomes the default implementation. Any chat backend can be injected via constructor.
  2. ConversationMemory SPI — interface out of ConversationStore (in-memory sliding window stays the default) so Redis/RocksDB/DB-backed history can be dropped in.
  3. AgentTool SPI + ToolRegistry — tools are name+schema+invoke; with tools registered, StreamingAgent runs a bounded function-calling loop (model may call tools, results are fed back, loop until final answer; ≤5 iterations).
  4. ConnectorToolAdapter — any SinkConnector becomes a write tool (args → CloudEvent → put()+commit()), any SourceConnector becomes a read tool (poll() one batch → JSON array). The 23 shipped connector plugins turn into the agent tool library with zero plugin changes.
  5. Event-driven triggers — agent.subscribe.topics + agent.trigger.output.topic: each consumed CloudEvent becomes a prompt, is answered (with tools), and the answer is published to the output topic where sink connectors deliver it. Trigger conversations are keyed trigger:<eventId> and never bleed into user sessions.
  6. Port drift fix — agent/connector-runtime/examples defaults 8080 → 10105.
  7. Docs — new docs/feature/agent-tools.md (extension surface, connector-as-tools wire-up, trigger config, embedder API) + index entry.

Not in scope (follow-ups): remote tool execution over topics (tool call as CloudEvent RPC, Solace sam_remote_tool style), per-token streaming of tool-loop answers, persisted ConversationMemory implementations, SPI-file-based tool discovery.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions