A .NET 10 AI agent with long-term memory and system operation tools. Supports Anthropic Claude, OpenAI, and Gemini multi-provider switching, with Alibaba Cloud DashScope for vector embedding and reranking.
- Multi-provider support — Anthropic / OpenAI / Gemini, switch via config without code changes
- Per-agent configuration — Each agent (main, memory recall, memory save, summarizer) can use different API endpoints, keys, and models
- Long-term memory — Automatically saves, retrieves, and injects important information from conversations, persisted across sessions
- Memory pipeline — Four independent sub-agents collaborate: proactive memory saving, memory recall injection, sliding window trimming, conversation summarization
- Vector semantic search — Two-phase retrieval: vector embedding recall + optional reranking
- Semantic deduplication — Automatically merges memories when cosine similarity exceeds threshold, avoiding redundancy
- System tools — File operations, process execution (dotnet/node/docker), HTTP requests, background task management
- TUI interface — Terminal.Gui v2 based interface with separate chat, log, and input areas
- .NET 10 SDK
dotnet run --project sharpclawFirst run automatically launches the configuration wizard. Select your AI provider, enter API keys, and configure per-agent settings.
Config is saved to ~/.sharpclaw/config.json. After that, launching goes straight to interactive chat. Type /exit or /quit to exit, Ctrl+Q to quit.
Run the config wizard:
dotnet run --project sharpclaw configConfig file structure (~/.sharpclaw/config.json):
{
"version": 4,
"default": {
"provider": "anthropic",
"endpoint": "https://api.anthropic.com",
"apiKey": "sk-xxx",
"model": "claude-opus-4-6"
},
"agents": {
"main": {},
"recaller": { "enabled": true },
"saver": { "enabled": true, "model": "claude-haiku-4-5-20251001" },
"summarizer": { "enabled": true, "model": "claude-haiku-4-5-20251001" }
},
"memory": {
"enabled": true,
"embeddingEndpoint": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"embeddingApiKey": "sk-xxx",
"embeddingModel": "text-embedding-v4",
"rerankEnabled": true,
"rerankEndpoint": "https://dashscope.aliyuncs.com/compatible-api/v1/reranks",
"rerankApiKey": "sk-xxx",
"rerankModel": "qwen3-vl-rerank"
}
}Each agent inherits from default unless overridden. Set "enabled": false to disable a sub-agent.
Processing flow per conversation turn:
User Input
|
+- MemoryRecaller Recall: retrieve relevant memories, inject into context
|
+- Agent Response Main agent processes (can call SearchMemory/GetRecentMemories tools)
|
+- SlidingWindowChatReducer (AfterMessageAdded)
+- MemorySaver Proactive save: analyze conversation, save/update/delete memories
+- Strip old injected messages
+- Sliding window trim Triggered when exceeding windowSize + buffer
+- ConversationSummarizer Summarize trimmed conversation, inject summary
~/.sharpclaw/config.json— Provider and agent configurationhistory.json— Session state, auto-restored on startupmemories.json— Vector memory store

