Gå til innholdet

Architecture

Dette innholdet er ikke tilgjengelig på ditt språk.

Khadim separates the user surface from the agent engine. The CLI, desktop app, web app, SDK, and plugins all connect to the same core pattern: a model plans, calls tools, observes results, and continues until the task is complete.

Desktop app (Tauri) Web app (React Router + Express) CLI / SDK
| | |
+------------------------------+--------------------------------+
|
Agent engine
LLM -> plan -> tools -> loop
|
Tool domains
coding, RPA, connectors, plugins, memory, runners

Khadim has multiple entry points:

SurfacePurpose
CLIInteractive terminal agent and headless automation
DesktopLocal RPA, screen automation, credentials, and runners
WebTeam control plane, monitoring, and managed agents
SDKEmbedded agent runs inside Node.js applications
PluginsUser-extensible tools and optional desktop UI tabs

The engine owns the run loop:

  1. Compose context from the user prompt, mode, tools, memory, and workspace instructions.
  2. Send the prompt to the configured provider and model.
  3. Stream text and tool requests.
  4. Execute tools through the active domain registry.
  5. Return observations to the model.
  6. Persist messages, events, sessions, and run metadata.

Every live backend is expected to produce the same normalized event shapes:

EventMeaning
text_deltaIncremental assistant text
step_startTool or step execution started
step_updateTool or step progress changed
step_completeTool or step execution completed
questionThe agent needs user input
doneThe run completed
errorThe run failed

This lets the CLI, desktop app, web app, and SDK share UI and replay behavior.

Runners define where the automation executes:

  • Local runs directly on the host.
  • Docker runs in a constrained container with explicit env, secrets, mounts, and resource controls.
  • Cloud is planned for managed deployments.

The runner changes execution boundaries, not the event protocol.

The platform model centers on reusable automation:

ConceptDescription
AutomationA saved, runnable task
AgentA persistent automation persona
SessionOne execution of a task or agent
ConnectorA configured external service
DomainA pluggable tool set
EnvironmentRuntime variables and credential bindings
CredentialA stored secret or OAuth token
MemoryDurable knowledge across sessions
SkillReusable procedural knowledge
RunnerLocal, Docker, or cloud execution target