┌─────────────────────────────────────────────────────┐
│ Channels │
│ ┌──────────┐ ┌─────────┐ ┌───────┐ ┌────────┐ │
│ │ Telegram │ │ Discord │ │ Slack │ │ CLI │ │
│ └────┬─────┘ └────┬────┘ └───┬───┘ └───┬────┘ │
│ └──────────────┴──────────┴───────────┘ │
│ │ IChannel / IMessageBus │
├──────────────────────┼──────────────────────────────┤
│ Agent Loop │
│ ┌───────────────────┴───────────────────────┐ │
│ │ Receive → Think → Act → Respond → Store │ │
│ └───┬──────────┬────────────────┬───────────┘ │
│ │ │ │ │
│ ┌───┴───┐ ┌──┴──────┐ ┌─────┴────┐ │
│ │ Tools │ │ Provider│ │ Memory │ │
│ │(ITool)│ │(ILlm- │ │(ISession │ │
│ │ │ │Provider) │ │ Manager) │ │
│ └───────┘ └─────────┘ └──────────┘ │
├─────────────────────────────────────────────────────┤
│ Gateway (HTTP API + UI) │
└─────────────────────────────────────────────────────┘
| Interface | Location | Purpose |
|---|---|---|
ILlmProvider |
Core/Providers/ |
Abstraction over LLM APIs (OpenAI, Anthropic, etc.) |
ITool |
Core/Tools/ |
A capability the agent can invoke |
IToolRegistry |
Core/Tools/ |
Registry for discovering and invoking tools |
IChannel |
Core/Channels/ |
Inbound/outbound messaging for a platform |
IMessageBus |
Core/Channels/ |
Routes messages between channels and the agent |
ISessionManager |
Core/Sessions/ |
Manages conversation sessions and context |
- ClawSharp.Core — Interfaces, models, configuration. Zero external dependencies. Everything depends on Core.
- ClawSharp.Agent — The agent loop: receives messages, calls the LLM, executes tools, returns responses.
- ClawSharp.Providers — Concrete LLM provider implementations (OpenAI, Anthropic, Ollama, OpenRouter).
- ClawSharp.Tools — Built-in tools (file I/O, shell exec, web search, etc.).
- ClawSharp.Memory — Persistent storage, embeddings, and semantic search.
- ClawSharp.Infrastructure — Dependency injection, logging, service registration.
- ClawSharp.Gateway — ASP.NET Core HTTP API for external access and the web UI.
- ClawSharp.Cli — Command-line interface and entry point.
- ClawSharp.UI — Blazor-based web frontend.
- Message arrives via a channel (Telegram, CLI, etc.)
- IMessageBus routes it to the agent
- Agent loop builds an
LlmRequestwith conversation history + available tools - ILlmProvider sends the request to the LLM and returns an
LlmResponse - If the response contains tool calls, the agent executes them via
IToolRegistryand loops back to step 3 - Final response is sent back through the channel
- Conversation is persisted via ISessionManager
All configuration flows through ClawSharpConfig (loaded from TOML). Sub-configs:
ProvidersConfig— API keys, endpoints, default modelsGatewayConfig— HTTP bind address, port, API keyChannelsConfig— Per-channel settings (tokens, allowed users)MemoryConfig— Database path, embedding settingsSecurityConfig— Sandbox rules, allowed commandsHeartbeatConfig— Periodic polling settingsTunnelConfig— External tunnel (cloudflared, etc.)