akseljoonas HF Staff commited on
Commit
83c8c40
Β·
1 Parent(s): a35ac53

readme update

Browse files
Files changed (1) hide show
  1. README.md +44 -23
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
- β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€ bash β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
67
- β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€ read_file β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
68
- β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€ write_file β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
69
- β”‚ β”‚ β”‚ β”‚ β”‚ └─ McpConnectionManager β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
70
- β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€ mcp__server1__* β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
71
- β”‚ β”‚ β”‚ β”‚ β”‚ └─ mcp__server2__* β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
 
 
 
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 management
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
- test_integration.py # Basic integration tests
134
- test_tools.py # Tool execution tests
 
 
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
- Add to your config:
182
-
183
- ```python
184
- config = Config(
185
- model_name="anthropic/claude-sonnet-4-5-20250929",
186
- mcp_servers=[
187
- MCPServerConfig(
188
- name="your_server",
189
- command="command",
190
- args=["arg1", "arg2"],
191
- env={"KEY": "value"}
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`.