Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit Β·
d13cac7
1
Parent(s): 7b4e2da
readme update
Browse files
README.md
CHANGED
|
@@ -27,6 +27,15 @@ This starts an interactive chat session with the agent. Type your messages and t
|
|
| 27 |
|
| 28 |
The agent will automatically discover and register all tools from configured MCP servers.
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
## Architecture
|
| 31 |
|
| 32 |
### Component Overview
|
|
@@ -59,16 +68,20 @@ The agent will automatically discover and register all tools from configured MCP
|
|
| 59 |
β β β β β ContextManager β β β β β β
|
| 60 |
β β β β β β’ Message history β β β β β β
|
| 61 |
β β β β β (litellm.Message[]) β β β β β β
|
|
|
|
| 62 |
β β β β ββββββββββββββββββββββββββββββ β β β β β
|
| 63 |
β β β β β β β β β
|
| 64 |
β β β β ββββββββββββββββββββββββββββββ β β β β β
|
| 65 |
β β β β β ToolRouter β β β β β β
|
| 66 |
-
β β β β β ββ
|
| 67 |
-
β β β β β ββ
|
| 68 |
-
β β β β β ββ
|
| 69 |
-
β β β β β
|
| 70 |
-
β β β β β
|
| 71 |
-
β β β β β
|
|
|
|
|
|
|
|
|
|
| 72 |
β β β β ββββββββββββββββββββββββββββββ β β β β β
|
| 73 |
β β β ββββββββββββββββββββββββββββββββββββ β β β β
|
| 74 |
β β β β β β β
|
|
@@ -122,16 +135,20 @@ User Message
|
|
| 122 |
agent/
|
| 123 |
βββ config.py # Configuration models
|
| 124 |
βββ main.py # Interactive CLI entry point
|
|
|
|
|
|
|
| 125 |
βββ context_manager/
|
| 126 |
-
β βββ manager.py # Message history
|
| 127 |
βββ core/
|
| 128 |
βββ agent_loop.py # Main agent loop and handlers
|
| 129 |
βββ session.py # Session management
|
| 130 |
βββ mcp_client.py # MCP SDK integration
|
| 131 |
βββ tools.py # ToolRouter and built-in tools
|
| 132 |
|
| 133 |
-
|
| 134 |
-
|
|
|
|
|
|
|
| 135 |
eval/ # Evaluation suite (see eval/README.md)
|
| 136 |
```
|
| 137 |
|
|
@@ -144,6 +161,7 @@ The agent emits the following events via `event_queue`:
|
|
| 144 |
- `assistant_message` - LLM response text
|
| 145 |
- `tool_call` - Tool being called with arguments
|
| 146 |
- `tool_output` - Tool execution result
|
|
|
|
| 147 |
- `turn_complete` - Agent finished processing
|
| 148 |
- `error` - Error occurred during processing
|
| 149 |
- `interrupted` - Agent was interrupted
|
|
@@ -178,18 +196,21 @@ def create_builtin_tools() -> list[ToolSpec]:
|
|
| 178 |
|
| 179 |
### Adding MCP Servers
|
| 180 |
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
```
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
|
|
|
| 195 |
```
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
The agent will automatically discover and register all tools from configured MCP servers.
|
| 29 |
|
| 30 |
+
|
| 31 |
+
### Env Setup
|
| 32 |
+
```bash
|
| 33 |
+
ANTHROPIC_API_KEY=<one-key-to-rule-them-all>
|
| 34 |
+
HF_TOKEN=<hf-token-to-access-the-hub>
|
| 35 |
+
GITHUB_TOKEN=<gh-pat-key-for-not-reinventing-the-wheel>
|
| 36 |
+
HF_NAMESPACE=<hf-namespace-to-use>
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
## Architecture
|
| 40 |
|
| 41 |
### Component Overview
|
|
|
|
| 68 |
β β β β β ContextManager β β β β β β
|
| 69 |
β β β β β β’ Message history β β β β β β
|
| 70 |
β β β β β (litellm.Message[]) β β β β β β
|
| 71 |
+
β β β β β β’ Auto-compaction (180k) β β β β β β
|
| 72 |
β β β β ββββββββββββββββββββββββββββββ β β β β β
|
| 73 |
β β β β β β β β β
|
| 74 |
β β β β ββββββββββββββββββββββββββββββ β β β β β
|
| 75 |
β β β β β ToolRouter β β β β β β
|
| 76 |
+
β β β β β ββ explore_hf_docs β β β β β β
|
| 77 |
+
β β β β β ββ fetch_hf_docs β β β β β β
|
| 78 |
+
β β β β β ββ search_hf_api_endpointsβ β β β β β
|
| 79 |
+
β β β β β ββ plan_tool β β β β β β
|
| 80 |
+
β β β β β ββ hf_jobs* β β β β β β
|
| 81 |
+
β β β β β ββ hf_private_repos* β β β β β β
|
| 82 |
+
β β β β β ββ github_* (3 tools) β β β β β β
|
| 83 |
+
β β β β β ββ MCP tools (e.g., β β β β β β
|
| 84 |
+
β β β β β model_search, etc.) β β β β β β
|
| 85 |
β β β β ββββββββββββββββββββββββββββββ β β β β β
|
| 86 |
β β β ββββββββββββββββββββββββββββββββββββ β β β β
|
| 87 |
β β β β β β β
|
|
|
|
| 135 |
agent/
|
| 136 |
βββ config.py # Configuration models
|
| 137 |
βββ main.py # Interactive CLI entry point
|
| 138 |
+
βββ prompts/
|
| 139 |
+
β βββ system_prompt.yaml # Agent behavior and personality
|
| 140 |
βββ context_manager/
|
| 141 |
+
β βββ manager.py # Message history & auto-compaction
|
| 142 |
βββ core/
|
| 143 |
βββ agent_loop.py # Main agent loop and handlers
|
| 144 |
βββ session.py # Session management
|
| 145 |
βββ mcp_client.py # MCP SDK integration
|
| 146 |
βββ tools.py # ToolRouter and built-in tools
|
| 147 |
|
| 148 |
+
configs/
|
| 149 |
+
βββ main_agent_config.json # Model and MCP server configuration
|
| 150 |
+
|
| 151 |
+
tests/ # Integration and unit tests
|
| 152 |
eval/ # Evaluation suite (see eval/README.md)
|
| 153 |
```
|
| 154 |
|
|
|
|
| 161 |
- `assistant_message` - LLM response text
|
| 162 |
- `tool_call` - Tool being called with arguments
|
| 163 |
- `tool_output` - Tool execution result
|
| 164 |
+
- `approval_request` - Requesting user approval for sensitive operations
|
| 165 |
- `turn_complete` - Agent finished processing
|
| 166 |
- `error` - Error occurred during processing
|
| 167 |
- `interrupted` - Agent was interrupted
|
|
|
|
| 196 |
|
| 197 |
### Adding MCP Servers
|
| 198 |
|
| 199 |
+
Edit `configs/main_agent_config.json`:
|
| 200 |
+
|
| 201 |
+
```json
|
| 202 |
+
{
|
| 203 |
+
"model_name": "anthropic/claude-sonnet-4-5-20250929",
|
| 204 |
+
"mcpServers": {
|
| 205 |
+
"your-server-name": {
|
| 206 |
+
"transport": "http",
|
| 207 |
+
"url": "https://example.com/mcp",
|
| 208 |
+
"headers": {
|
| 209 |
+
"Authorization": "Bearer ${YOUR_TOKEN}"
|
| 210 |
+
}
|
| 211 |
+
}
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
```
|
| 215 |
+
|
| 216 |
+
Note: Environment variables like `${YOUR_TOKEN}` are auto-substituted from `.env`.
|