@mcp-abap-adt/llm-agent 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +89 -477
  2. package/dist/agent.d.ts.map +1 -1
  3. package/dist/agent.js +2 -1
  4. package/dist/agent.js.map +1 -1
  5. package/dist/agents/anthropic-agent.d.ts +4 -3
  6. package/dist/agents/anthropic-agent.d.ts.map +1 -1
  7. package/dist/agents/anthropic-agent.js +18 -9
  8. package/dist/agents/anthropic-agent.js.map +1 -1
  9. package/dist/agents/base.d.ts +38 -4
  10. package/dist/agents/base.d.ts.map +1 -1
  11. package/dist/agents/base.js +130 -1
  12. package/dist/agents/base.js.map +1 -1
  13. package/dist/agents/deepseek-agent.d.ts +7 -3
  14. package/dist/agents/deepseek-agent.d.ts.map +1 -1
  15. package/dist/agents/deepseek-agent.js +34 -13
  16. package/dist/agents/deepseek-agent.js.map +1 -1
  17. package/dist/agents/openai-agent.d.ts +7 -3
  18. package/dist/agents/openai-agent.d.ts.map +1 -1
  19. package/dist/agents/openai-agent.js +52 -16
  20. package/dist/agents/openai-agent.js.map +1 -1
  21. package/dist/agents/prompt-based-agent.d.ts +4 -3
  22. package/dist/agents/prompt-based-agent.d.ts.map +1 -1
  23. package/dist/agents/prompt-based-agent.js +11 -4
  24. package/dist/agents/prompt-based-agent.js.map +1 -1
  25. package/dist/agents/sap-core-ai-agent.d.ts +0 -1
  26. package/dist/agents/sap-core-ai-agent.d.ts.map +1 -1
  27. package/dist/agents/sap-core-ai-agent.js +0 -3
  28. package/dist/agents/sap-core-ai-agent.js.map +1 -1
  29. package/dist/cli.js +10 -7
  30. package/dist/cli.js.map +1 -1
  31. package/dist/llm-providers/anthropic.d.ts +1 -0
  32. package/dist/llm-providers/anthropic.d.ts.map +1 -1
  33. package/dist/llm-providers/anthropic.js +13 -1
  34. package/dist/llm-providers/anthropic.js.map +1 -1
  35. package/dist/llm-providers/base.d.ts +5 -4
  36. package/dist/llm-providers/base.d.ts.map +1 -1
  37. package/dist/llm-providers/base.js.map +1 -1
  38. package/dist/llm-providers/deepseek.d.ts +4 -2
  39. package/dist/llm-providers/deepseek.d.ts.map +1 -1
  40. package/dist/llm-providers/deepseek.js +93 -7
  41. package/dist/llm-providers/deepseek.js.map +1 -1
  42. package/dist/llm-providers/openai.d.ts +3 -2
  43. package/dist/llm-providers/openai.d.ts.map +1 -1
  44. package/dist/llm-providers/openai.js +87 -7
  45. package/dist/llm-providers/openai.js.map +1 -1
  46. package/dist/llm-providers/sap-core-ai.d.ts +9 -5
  47. package/dist/llm-providers/sap-core-ai.d.ts.map +1 -1
  48. package/dist/llm-providers/sap-core-ai.js +18 -7
  49. package/dist/llm-providers/sap-core-ai.js.map +1 -1
  50. package/dist/mcp/client.d.ts +15 -6
  51. package/dist/mcp/client.d.ts.map +1 -1
  52. package/dist/mcp/client.js +64 -38
  53. package/dist/mcp/client.js.map +1 -1
  54. package/dist/smart-agent/adapters/llm-adapter.d.ts +4 -8
  55. package/dist/smart-agent/adapters/llm-adapter.d.ts.map +1 -1
  56. package/dist/smart-agent/adapters/llm-adapter.js +131 -16
  57. package/dist/smart-agent/adapters/llm-adapter.js.map +1 -1
  58. package/dist/smart-agent/adapters/mcp-client-adapter.d.ts.map +1 -1
  59. package/dist/smart-agent/adapters/mcp-client-adapter.js +4 -1
  60. package/dist/smart-agent/adapters/mcp-client-adapter.js.map +1 -1
  61. package/dist/smart-agent/agent.d.ts +30 -20
  62. package/dist/smart-agent/agent.d.ts.map +1 -1
  63. package/dist/smart-agent/agent.js +461 -356
  64. package/dist/smart-agent/agent.js.map +1 -1
  65. package/dist/smart-agent/builder.d.ts +18 -5
  66. package/dist/smart-agent/builder.d.ts.map +1 -1
  67. package/dist/smart-agent/builder.js +76 -24
  68. package/dist/smart-agent/builder.js.map +1 -1
  69. package/dist/smart-agent/classifier/llm-classifier.d.ts +1 -1
  70. package/dist/smart-agent/classifier/llm-classifier.d.ts.map +1 -1
  71. package/dist/smart-agent/classifier/llm-classifier.js +33 -41
  72. package/dist/smart-agent/classifier/llm-classifier.js.map +1 -1
  73. package/dist/smart-agent/cli.d.ts +3 -2
  74. package/dist/smart-agent/cli.d.ts.map +1 -1
  75. package/dist/smart-agent/cli.js +15 -9
  76. package/dist/smart-agent/cli.js.map +1 -1
  77. package/dist/smart-agent/config.d.ts +4 -15
  78. package/dist/smart-agent/config.d.ts.map +1 -1
  79. package/dist/smart-agent/config.js +109 -84
  80. package/dist/smart-agent/config.js.map +1 -1
  81. package/dist/smart-agent/context/context-assembler.d.ts +14 -2
  82. package/dist/smart-agent/context/context-assembler.d.ts.map +1 -1
  83. package/dist/smart-agent/context/context-assembler.js +35 -49
  84. package/dist/smart-agent/context/context-assembler.js.map +1 -1
  85. package/dist/smart-agent/interfaces/assembler.d.ts +2 -2
  86. package/dist/smart-agent/interfaces/assembler.d.ts.map +1 -1
  87. package/dist/smart-agent/interfaces/index.d.ts +1 -1
  88. package/dist/smart-agent/interfaces/index.d.ts.map +1 -1
  89. package/dist/smart-agent/interfaces/index.js.map +1 -1
  90. package/dist/smart-agent/interfaces/llm.d.ts +2 -1
  91. package/dist/smart-agent/interfaces/llm.d.ts.map +1 -1
  92. package/dist/smart-agent/interfaces/rag.d.ts +4 -0
  93. package/dist/smart-agent/interfaces/rag.d.ts.map +1 -1
  94. package/dist/smart-agent/interfaces/types.d.ts +38 -1
  95. package/dist/smart-agent/interfaces/types.d.ts.map +1 -1
  96. package/dist/smart-agent/interfaces/types.js.map +1 -1
  97. package/dist/smart-agent/llm/token-counting-llm.d.ts +2 -1
  98. package/dist/smart-agent/llm/token-counting-llm.d.ts.map +1 -1
  99. package/dist/smart-agent/llm/token-counting-llm.js +9 -0
  100. package/dist/smart-agent/llm/token-counting-llm.js.map +1 -1
  101. package/dist/smart-agent/logger/session-logger.d.ts +10 -0
  102. package/dist/smart-agent/logger/session-logger.d.ts.map +1 -0
  103. package/dist/smart-agent/logger/session-logger.js +40 -0
  104. package/dist/smart-agent/logger/session-logger.js.map +1 -0
  105. package/dist/smart-agent/pipeline.d.ts +12 -19
  106. package/dist/smart-agent/pipeline.d.ts.map +1 -1
  107. package/dist/smart-agent/pipeline.js +52 -25
  108. package/dist/smart-agent/pipeline.js.map +1 -1
  109. package/dist/smart-agent/policy/index.d.ts +1 -0
  110. package/dist/smart-agent/policy/index.d.ts.map +1 -1
  111. package/dist/smart-agent/policy/index.js +1 -0
  112. package/dist/smart-agent/policy/index.js.map +1 -1
  113. package/dist/smart-agent/policy/tool-availability-registry.d.ts +21 -0
  114. package/dist/smart-agent/policy/tool-availability-registry.d.ts.map +1 -0
  115. package/dist/smart-agent/policy/tool-availability-registry.js +77 -0
  116. package/dist/smart-agent/policy/tool-availability-registry.js.map +1 -0
  117. package/dist/smart-agent/rag/in-memory-rag.d.ts +1 -0
  118. package/dist/smart-agent/rag/in-memory-rag.d.ts.map +1 -1
  119. package/dist/smart-agent/rag/in-memory-rag.js +3 -0
  120. package/dist/smart-agent/rag/in-memory-rag.js.map +1 -1
  121. package/dist/smart-agent/rag/index.d.ts +2 -2
  122. package/dist/smart-agent/rag/index.d.ts.map +1 -1
  123. package/dist/smart-agent/rag/index.js +1 -1
  124. package/dist/smart-agent/rag/index.js.map +1 -1
  125. package/dist/smart-agent/rag/ollama-rag.d.ts +14 -16
  126. package/dist/smart-agent/rag/ollama-rag.d.ts.map +1 -1
  127. package/dist/smart-agent/rag/ollama-rag.js +37 -97
  128. package/dist/smart-agent/rag/ollama-rag.js.map +1 -1
  129. package/dist/smart-agent/rag/openai-embedder.d.ts +18 -0
  130. package/dist/smart-agent/rag/openai-embedder.d.ts.map +1 -0
  131. package/dist/smart-agent/rag/openai-embedder.js +48 -0
  132. package/dist/smart-agent/rag/openai-embedder.js.map +1 -0
  133. package/dist/smart-agent/rag/vector-rag.d.ts +31 -0
  134. package/dist/smart-agent/rag/vector-rag.d.ts.map +1 -0
  135. package/dist/smart-agent/rag/vector-rag.js +144 -0
  136. package/dist/smart-agent/rag/vector-rag.js.map +1 -0
  137. package/dist/smart-agent/server.d.ts.map +1 -1
  138. package/dist/smart-agent/server.js +107 -9
  139. package/dist/smart-agent/server.js.map +1 -1
  140. package/dist/smart-agent/smart-server.d.ts +14 -59
  141. package/dist/smart-agent/smart-server.d.ts.map +1 -1
  142. package/dist/smart-agent/smart-server.js +273 -84
  143. package/dist/smart-agent/smart-server.js.map +1 -1
  144. package/dist/smart-agent/testing/index.d.ts.map +1 -1
  145. package/dist/smart-agent/testing/index.js +33 -1
  146. package/dist/smart-agent/testing/index.js.map +1 -1
  147. package/dist/smart-agent/utils/external-tools-normalizer.d.ts +14 -0
  148. package/dist/smart-agent/utils/external-tools-normalizer.d.ts.map +1 -0
  149. package/dist/smart-agent/utils/external-tools-normalizer.js +135 -0
  150. package/dist/smart-agent/utils/external-tools-normalizer.js.map +1 -0
  151. package/dist/smart-agent/utils/tool-call-deltas.d.ts +4 -0
  152. package/dist/smart-agent/utils/tool-call-deltas.d.ts.map +1 -0
  153. package/dist/smart-agent/utils/tool-call-deltas.js +25 -0
  154. package/dist/smart-agent/utils/tool-call-deltas.js.map +1 -0
  155. package/dist/types.d.ts +17 -3
  156. package/dist/types.d.ts.map +1 -1
  157. package/dist/utils/errors.d.ts +4 -0
  158. package/dist/utils/errors.d.ts.map +1 -0
  159. package/dist/utils/errors.js +31 -0
  160. package/dist/utils/errors.js.map +1 -0
  161. package/package.json +11 -9
  162. package/dist/smoke-adapters.d.ts +0 -17
  163. package/dist/smoke-adapters.d.ts.map +0 -1
  164. package/dist/smoke-adapters.js +0 -178
  165. package/dist/smoke-adapters.js.map +0 -1
package/README.md CHANGED
@@ -1,28 +1,26 @@
1
- # LLM Proxy
1
+ # Smart Agent & Server
2
2
 
3
- Minimal LLM agent that normalizes provider access and surfaces MCP tools without executing them.
3
+ A high-performance, RAG-orchestrated LLM agent and OpenAI-compatible server with deep MCP integration.
4
4
 
5
5
  ## Overview
6
6
 
7
- This agent acts as a thin orchestration layer between LLM providers and MCP (Model Context Protocol) servers. It provides tool catalogs to the LLM and returns the raw LLM response to the consumer.
7
+ This project provides a robust orchestration layer that transforms standard LLMs into specialized autonomous agents. It handles multi-turn tool loops, long-term memory via RAG, and serves everything through a standard OpenAI-compatible API.
8
8
 
9
- **Provider Paths:**
10
- - Direct providers are supported: `OpenAIProvider`, `AnthropicProvider`, `DeepSeekProvider`
11
- - SAP AI Core gateway is also supported via `SapCoreAIProvider`
12
- - In SAP deployments, SAP AI Core is typically the recommended integration path
9
+ **Key Components:**
10
+ - **SmartAgent:** The core orchestrator that manages intent classification, RAG retrieval, and tool execution loops.
11
+ - **SmartServer:** A production-ready HTTP server that makes the agent accessible to any OpenAI-compatible client (Cline, Goose, etc.).
12
+ - **Hybrid RAG:** A multi-vector search engine combining semantic embeddings with BM25 lexical scoring.
13
13
 
14
14
  ## Features
15
15
 
16
- - ✅ Multiple LLM provider paths (direct providers and SAP AI Core gateway)
17
- - ✅ MCP client integration with multiple transport protocols
18
- - ✅ Stdio transport (for local processes)
19
- - ✅ SSE transport (Server-Sent Events)
20
- - ✅ Streamable HTTP transport (bidirectional NDJSON)
21
- - ✅ Auto-detection of transport from URL
22
- - ✅ Tool catalog surfacing (no tool execution at this layer)
23
- - ✅ Conversation history management
24
- - ✅ Raw LLM response passthrough for consumers
25
- - 🔄 Streaming support (planned)
16
+ - ✅ **Real Incremental Streaming:** True per-token streaming for both text and tool-call deltas.
17
+ - ✅ **OpenAI SSE Compliance:** Fully compatible with official OpenAI SDKs and IDE plugins.
18
+ - ✅ **Hybrid RAG Search:** Combines Vector similarity (semantic) with BM25 (lexical) for pinpoint accuracy in technical domains like SAP/ABAP.
19
+ - ✅ **Multi-Intent Classification:** Automatically routes requests to `chat` (fast-path), `action` (tool-loop), or long-term memory (`fact`/`state`).
20
+ - ✅ **Reasoning Mode:** Optional transparent thought process (`<reasoning>` blocks) to explain agent strategy.
21
+ - ✅ **Resilience:** Built-in exponential backoff retries for LLM/Embeddings and auto-reconnect for MCP servers.
22
+ - ✅ **Helper LLM Support:** Offload summarization and translation tasks to cheaper/faster models.
23
+ - ✅ **Startup Health Checks:** Immediate diagnostics for all dependencies (Ollama, MCP, LLM).
26
24
 
27
25
  ## Installation
28
26
 
@@ -30,486 +28,100 @@ This agent acts as a thin orchestration layer between LLM providers and MCP (Mod
30
28
  npm install @mcp-abap-adt/llm-agent
31
29
  ```
32
30
 
33
- ## Usage
34
-
35
- The agent can be used in two ways:
36
-
37
- 1. **Embedded in application** - Import and use directly in your CAP service or application (same process)
38
- 2. **Standalone service** - Run as a separate service/process
39
-
40
- Both modes connect to MCP servers via transport protocols (HTTP/SSE/stdio), not directly to MCP server instances.
41
-
42
- ### Embedded Usage (Same Process)
43
-
44
- When using the agent embedded in your application (e.g., in `cloud-llm-hub` CAP service), you import it as a module:
45
-
46
- ```typescript
47
- // srv/agent-service.ts
48
- import { SapCoreAIAgent, SapCoreAIProvider, MCPClientWrapper } from '@mcp-abap-adt/llm-agent';
49
- import { executeHttpRequest } from '@sap-cloud-sdk/http-client';
50
-
51
- export default class AgentService extends cds.Service {
52
- private agent: SapCoreAIAgent;
53
-
54
- async init() {
55
- // Create SAP AI Core provider (all LLM providers through SAP AI Core)
56
- const llmProvider = new SapCoreAIProvider({
57
- destinationName: 'SAP_AI_CORE_DEST', // SAP destination for AI Core
58
- model: 'gpt-4o-mini', // Model name determines which provider SAP AI Core uses
59
- httpClient: async (config) => {
60
- return await executeHttpRequest(
61
- { destinationName: config.destinationName },
62
- {
63
- method: config.method as any,
64
- url: config.url,
65
- headers: config.headers,
66
- data: config.data,
67
- }
68
- );
69
- },
70
- });
71
-
72
- // Create MCP client
73
- const mcpClient = new MCPClientWrapper({
74
- url: 'http://localhost:4004/mcp/stream/http', // MCP proxy endpoint
75
- headers: {
76
- 'Authorization': 'Basic YWxpY2U6',
77
- 'X-SAP-Destination': 'SAP_DEV_DEST',
78
- },
79
- });
80
-
81
- // Create agent
82
- this.agent = new SapCoreAIAgent({
83
- llmProvider,
84
- mcpClient,
85
- });
86
-
87
- await this.agent.connect();
88
- }
89
-
90
- async chat(message: string) {
91
- return await this.agent.process(message);
92
- }
93
- }
94
- ```
95
-
96
- **Architecture Note:**
97
- - The agent is imported as a module (like `@fr0ster/mcp-abap-adt`)
98
- - Even when embedded in the same process, the agent connects to the MCP proxy via HTTP transport
99
- - The MCP proxy embeds the `mcp-abap-adt` server instance
100
- - This keeps the architecture clean: agent → MCP proxy (via HTTP) → embedded MCP server
101
-
102
- See [Embedded Usage Guide](../../docs/LLM_AGENT_EMBEDDED_USAGE.md) for complete examples including per-request agent instances and caching strategies.
103
-
104
- ### Standalone Usage (Separate Process)
105
-
106
- ### Basic Example (Stdio Transport)
107
-
108
- ```typescript
109
- import { SapCoreAIAgent, SapCoreAIProvider, MCPClientWrapper } from '@mcp-abap-adt/llm-agent';
110
- import { executeHttpRequest } from '@sap-cloud-sdk/http-client';
111
-
112
- // Create SAP AI Core provider
113
- const llmProvider = new SapCoreAIProvider({
114
- destinationName: 'SAP_AI_CORE_DEST',
115
- model: 'gpt-4o-mini', // Routes to OpenAI through SAP AI Core
116
- httpClient: async (config) => {
117
- return await executeHttpRequest(
118
- { destinationName: config.destinationName },
119
- {
120
- method: config.method as any,
121
- url: config.url,
122
- headers: config.headers,
123
- data: config.data,
124
- }
125
- );
126
- },
127
- });
128
-
129
- const mcpClient = new MCPClientWrapper({
130
- transport: 'stdio',
131
- command: 'node',
132
- args: ['path/to/mcp-server.js'],
133
- });
134
-
135
- const agent = new SapCoreAIAgent({
136
- llmProvider,
137
- mcpClient,
138
- });
139
-
140
- await agent.connect();
141
- const response = await agent.process('What tools are available?');
142
- console.log(response.message);
143
- ```
144
-
145
- ### HTTP Transport (Auto-Detection)
146
-
147
- ```typescript
148
- import { Agent, OpenAIProvider, MCPClientWrapper } from '@mcp-abap-adt/llm-agent';
149
-
150
- const llmProvider = new OpenAIProvider({
151
- apiKey: process.env.OPENAI_API_KEY!,
152
- model: 'gpt-4o-mini',
153
- });
154
-
155
- // Auto-detects 'stream-http' from URL
156
- const mcpClient = new MCPClientWrapper({
157
- url: 'http://localhost:4004/mcp/stream/http',
158
- headers: {
159
- 'Authorization': 'Basic YWxpY2U6',
160
- 'Content-Type': 'application/x-ndjson',
161
- },
162
- });
163
-
164
- const agent = new Agent({
165
- llmProvider,
166
- mcpClient,
167
- });
168
-
169
- await mcpClient.connect();
170
- const sessionId = mcpClient.getSessionId(); // Get session ID for subsequent requests
171
-
172
- const response = await agent.process('What tools are available?');
173
- // The response is returned as-is; tool execution is handled by the consumer.
174
- console.log(response.message);
175
- ```
176
-
177
- ### Explicit Transport Selection
178
-
179
- ```typescript
180
- // SSE transport
181
- const sseClient = new MCPClientWrapper({
182
- transport: 'sse',
183
- url: 'http://localhost:4004/mcp/stream/sse',
184
- headers: {
185
- 'Authorization': 'Basic YWxpY2U6',
186
- },
187
- });
188
-
189
- // Streamable HTTP transport
190
- const httpClient = new MCPClientWrapper({
191
- transport: 'stream-http',
192
- url: 'http://localhost:4004/mcp/stream/http',
193
- headers: {
194
- 'Authorization': 'Basic YWxpY2U6',
195
- },
196
- });
197
- ```
31
+ ## Quick Start
198
32
 
199
- See [src/mcp/README.md](src/mcp/README.md) for detailed transport configuration options.
200
-
201
- ### Embedded Usage in CAP Service
202
-
203
- The agent can be imported and used directly in CAP services, similar to how `mcp-abap-adt` is used:
204
-
205
- ```typescript
206
- // srv/agent-service.ts
207
- import { Agent, OpenAIProvider } from '@mcp-abap-adt/llm-agent';
208
-
209
- export default class AgentService extends cds.Service {
210
- private agent: Agent;
211
-
212
- async init() {
213
- this.agent = new Agent({
214
- llmProvider: new OpenAIProvider({
215
- apiKey: process.env.OPENAI_API_KEY!,
216
- }),
217
- mcpConfig: {
218
- url: 'http://localhost:4004/mcp/stream/http',
219
- headers: {
220
- 'Authorization': 'Basic YWxpY2U6',
221
- 'X-SAP-Destination': 'SAP_DEV_DEST',
222
- },
223
- },
224
- });
225
-
226
- await this.agent.connect();
227
- }
228
-
229
- async chat(message: string) {
230
- return await this.agent.process(message);
231
- }
232
- }
233
- ```
234
-
235
- See [docs/LLM_AGENT_EMBEDDED_USAGE.md](../../docs/LLM_AGENT_EMBEDDED_USAGE.md) for complete embedded usage guide.
236
-
237
- ## Development
238
-
239
- **Cross-Platform Development:** This project is configured for consistent behavior across Windows, Linux, and macOS. See the parent project's [Cross-Platform Development Guide](../../docs/CROSS_PLATFORM_GUIDE.md) for setup instructions and troubleshooting.
240
-
241
- **Verify your setup:** Run `npm run verify:setup` from the root project to check cross-platform configuration.
242
-
243
- ```bash
244
- # Install dependencies
245
- npm install
246
-
247
- # Setup environment (copy template and fill in your values)
248
- cp .env.template .env
249
- # Edit .env with your API keys and settings
250
-
251
- # Build
252
- npm run build
253
-
254
- # Development mode (with tsx for hot reload)
255
- # Will automatically load .env file if it exists
256
- npm run dev
257
-
258
- # Run test launcher (after build)
259
- npm start
260
-
261
- # Or with custom message
262
- npm start "List all available ABAP programs"
263
- ```
264
-
265
- ### Environment Configuration
266
-
267
- The agent supports configuration via `.env` file for easier setup:
268
-
269
- 1. Copy the template:
33
+ 1. **Initialize Configuration:**
34
+ Run the agent once to generate the default `smart-server.yaml` template:
270
35
  ```bash
271
- cp .env.template .env
36
+ npx llm-agent-beta
272
37
  ```
273
38
 
274
- 2. Edit `.env` with your settings:
275
- ```bash
276
- # Direct provider configuration (used by current CLI launcher)
277
- LLM_PROVIDER=openai # openai | anthropic | deepseek
278
- OPENAI_API_KEY=sk-proj-your-key
279
- OPENAI_MODEL=gpt-4o-mini
280
-
281
- # MCP Configuration (optional, for MCP integration)
282
- MCP_ENDPOINT=http://localhost:4004/mcp/stream/http
283
- MCP_DISABLED=false
284
- ```
285
-
286
- **Optional (library-level SAP AI Core provider):**
287
- SAP_CORE_AI_URL=https://api.ai.core.sap
288
- SAP_CORE_AI_DESTINATION=SAP_AI_CORE_DEST
39
+ 2. **Configure:**
40
+ Edit `smart-server.yaml` and `.env` with your API keys and MCP endpoints.
289
41
 
290
- 3. Run the agent - it will automatically load `.env`:
42
+ 3. **Launch Server:**
291
43
  ```bash
292
- npm run dev:llm
44
+ npm run dev -- --config smart-server.yaml
293
45
  ```
294
46
 
295
- Environment variables from `.env` can be overridden by actual environment variables.
296
-
297
- ### Test Launcher
298
-
299
- The agent includes a simple CLI test launcher for quick testing.
300
-
301
- **Note:** The current CLI launcher uses direct providers (`openai`, `anthropic`, `deepseek`). `ollama` is listed in comments but not implemented.
302
-
303
- #### Test LLM Only (Without MCP)
304
-
305
- Test just the LLM provider without MCP integration:
306
-
307
- **OpenAI:**
308
- ```bash
309
- # Basic usage - set API key and run
310
- export OPENAI_API_KEY="sk-proj-your-actual-key-here"
311
- npm run dev:llm
312
-
313
- # Or inline
314
- OPENAI_API_KEY="sk-proj-your-key" npm run dev:llm
315
-
316
- # With custom message
317
- export OPENAI_API_KEY="sk-proj-your-key"
318
- npm run dev:llm "Hello! Can you introduce yourself?"
319
-
320
- # With specific model
321
- export OPENAI_API_KEY="sk-proj-your-key"
322
- export OPENAI_MODEL="gpt-4o" # or gpt-4-turbo, gpt-4o-mini, etc.
323
- npm run dev:llm
324
-
325
- # With organization ID (for team accounts)
326
- export OPENAI_API_KEY="sk-proj-your-key"
327
- export OPENAI_ORG="org-your-org-id"
328
- npm run dev:llm
329
-
330
- # With project ID (for project-specific billing)
331
- export OPENAI_API_KEY="sk-proj-your-key"
332
- export OPENAI_PROJECT="proj-your-project-id" # or OPENAI_PRJ
333
- npm run dev:llm
334
-
335
- # Full configuration
336
- export OPENAI_API_KEY="sk-proj-your-key"
337
- export OPENAI_MODEL="gpt-4o"
338
- export OPENAI_ORG="org-your-org-id"
339
- export OPENAI_PROJECT="proj-your-project-id"
340
- npm run dev:llm
341
- ```
342
-
343
- **Anthropic (Claude):**
344
- ```bash
345
- # Set provider and API key
346
- export LLM_PROVIDER=anthropic
347
- export ANTHROPIC_API_KEY="sk-ant-your-actual-key-here"
348
- npm run dev:llm
349
-
350
- # With custom message
351
- export LLM_PROVIDER=anthropic
352
- export ANTHROPIC_API_KEY="sk-ant-your-key"
353
- npm run dev:llm "What can you do?"
354
-
355
- # With specific model
356
- export LLM_PROVIDER=anthropic
357
- export ANTHROPIC_API_KEY="sk-ant-your-key"
358
- export ANTHROPIC_MODEL="claude-3-5-sonnet-20241022" # or claude-3-opus, etc.
359
- npm run dev:llm
360
- ```
361
-
362
- **DeepSeek:**
363
- ```bash
364
- # Set provider and API key
365
- export LLM_PROVIDER=deepseek
366
- export DEEPSEEK_API_KEY="sk-your-actual-key-here"
367
- npm run dev:llm
368
-
369
- # With custom message
370
- export LLM_PROVIDER=deepseek
371
- export DEEPSEEK_API_KEY="sk-your-key"
372
- npm run dev:llm "Explain what you can do"
373
- ```
374
-
375
- **Alternative methods:**
376
- ```bash
377
- # Method 1: Using dedicated script (recommended)
378
- export OPENAI_API_KEY="sk-proj-..."
379
- npm run dev:llm
380
-
381
- # Method 2: Using flag
382
- export OPENAI_API_KEY="sk-proj-..."
383
- npm run dev -- --llm-only
384
-
385
- # Method 3: Using environment variable
386
- export OPENAI_API_KEY="sk-proj-..."
387
- export MCP_DISABLED=true
388
- npm run dev
389
- ```
390
-
391
- #### Basic Usage with OpenAI (With MCP)
392
-
393
- ```bash
394
- # Method 1: Export environment variable
395
- export OPENAI_API_KEY="sk-proj-..."
396
- export MCP_ENDPOINT="http://localhost:4004/mcp/stream/http"
397
- npm run dev
398
-
399
- # Method 2: Inline (one-time use)
400
- OPENAI_API_KEY="sk-proj-..." npm run dev
401
-
402
- # Method 3: With custom message
403
- export OPENAI_API_KEY="sk-proj-..."
404
- npm run dev "What ABAP programs are available?"
47
+ ## Usage
405
48
 
406
- # Method 4: Using .env file (if you have dotenv setup)
407
- # Create .env file:
408
- # OPENAI_API_KEY=sk-proj-...
409
- # MCP_ENDPOINT=http://localhost:4004/mcp/stream/http
410
- npm run dev
49
+ ### Connecting IDE Clients
50
+
51
+ Point your favorite AI client to your local SmartServer:
52
+ - **Base URL:** `http://localhost:4004/v1`
53
+ - **Model ID:** `smart-agent`
54
+ - **API Key:** (any string, e.g., `sk-none`)
55
+
56
+ ### Intent Types
57
+
58
+ SmartAgent automatically classifies your input into:
59
+ - **Fact:** Technical rules or constraints (e.g., "ABAP Cloud forbids direct table access"). Stored in long-term facts RAG.
60
+ - **State:** Project context or temporary observations (e.g., "Kristina approves decisions", "Sky is blue"). Stored in state RAG.
61
+ - **Chat:** Trivial questions or math (e.g., "2+2"). Processed via fast-path without project context.
62
+ - **Action:** (Default) Engineering tasks requiring tools and deep analysis.
63
+
64
+ ## Advanced Configuration (YAML)
65
+
66
+ ```yaml
67
+ port: 4004
68
+ host: 0.0.0.0
69
+
70
+ # Hybrid RAG Settings
71
+ rag:
72
+ type: ollama
73
+ url: http://localhost:11434
74
+ vectorWeight: 0.7
75
+ keywordWeight: 0.3
76
+
77
+ # Multi-model Pipeline
78
+ pipeline:
79
+ llm:
80
+ main:
81
+ provider: deepseek
82
+ apiKey: ${DEEPSEEK_API_KEY}
83
+ model: deepseek-chat
84
+ classifier:
85
+ provider: deepseek
86
+ apiKey: ${DEEPSEEK_API_KEY}
87
+ model: deepseek-chat
88
+ temperature: 0.1
89
+ helper:
90
+ provider: deepseek
91
+ apiKey: ${DEEPSEEK_API_KEY}
92
+ model: deepseek-chat # Used for fast summarization/translation
93
+ temperature: 0.1
94
+
95
+ # Feature Toggles
96
+ agent:
97
+ showReasoning: true # Enable debug thought blocks
98
+ maxIterations: 10
99
+ historyAutoSummarizeLimit: 15
411
100
  ```
412
101
 
413
- #### Complete Example
102
+ ## Development
414
103
 
415
104
  ```bash
416
- # From project root
417
- cd submodules/llm-agent
418
-
419
- # Set required environment variables
420
- export OPENAI_API_KEY="sk-proj-your-actual-key-here"
421
- export MCP_ENDPOINT="http://localhost:4004/mcp/stream/http"
422
- export SAP_DESTINATION="SAP_DEV_DEST" # Optional, for SAP integration
423
-
424
- # Optional: Set model
425
- export OPENAI_MODEL="gpt-4o-mini" # or gpt-4o, gpt-4-turbo, etc.
426
-
427
- # Run test launcher
428
- npm run dev
429
-
430
- # Or with custom message
431
- npm run dev "List all available tools and describe what they do"
432
- ```
105
+ # Build project
106
+ npm run build
433
107
 
434
- #### Testing with Different LLM Providers
108
+ # Run tests
109
+ npm run test:all
435
110
 
436
- **Anthropic (Claude):**
437
- ```bash
438
- export LLM_PROVIDER=anthropic
439
- export ANTHROPIC_API_KEY="sk-ant-your-key-here"
440
- export ANTHROPIC_MODEL="claude-3-5-sonnet-20241022" # Optional
111
+ # Development with hot-reload
441
112
  npm run dev
442
- ```
443
113
 
444
- **DeepSeek:**
445
- ```bash
446
- export LLM_PROVIDER=deepseek
447
- export DEEPSEEK_API_KEY="sk-your-key-here"
448
- export DEEPSEEK_MODEL="deepseek-chat" # Optional
449
- npm run dev
450
- ```
114
+ # Smart server production entrypoint
115
+ npm run start
451
116
 
452
- #### Example Output
453
-
454
- ```
455
- 🤖 LLM Proxy Test Launcher v0.0.1
456
-
457
- 📋 Configuration:
458
- LLM Provider: openai
459
- MCP Endpoint: http://localhost:4004/mcp/stream/http
460
- Test Message: What tools are available?
461
-
462
- ✅ Created OpenAI provider
463
- ✅ Created MCP client
464
-
465
- ✅ Created agent instance
466
- Agent type: OpenAIAgent
467
-
468
- 🔌 Connecting to MCP server...
469
- ✅ Connected to MCP server
470
-
471
- 📦 Available tools: 31
472
- - GetProgram: Retrieve ABAP program source code...
473
- - GetClass: Retrieve ABAP class source code...
474
- - GetFunction: Retrieve ABAP function module...
475
- ... and 28 more
476
-
477
- 💬 Processing message: "What tools are available?"
478
-
479
- 📤 Response:
480
- ────────────────────────────────────────────────────────────
481
- I can see you have 31 tools available for working with ABAP systems...
482
-
483
- ⏱️ Duration: 2341ms
484
-
485
- 📜 Conversation history: 4 messages
486
-
487
- ✅ Test completed successfully!
117
+ # Legacy compatibility aliases
118
+ npm run start:smart
119
+ npm run dev:llm
120
+ npm run start:llm
121
+ npm run test
122
+ npm run test:llm
488
123
  ```
489
124
 
490
- The test launcher will:
491
- - Connect to MCP server
492
- - List available tools
493
- - Process a test message
494
- - Show response
495
- - Display conversation history
496
-
497
- ## Tool Execution Responsibility
498
-
499
- The agent does not execute tools. It only:
500
- - Fetches MCP tool catalogs
501
- - Passes tool definitions to the LLM
502
- - Returns the raw LLM response to the consumer
503
-
504
- If your application needs tool execution, parse the model output in the consumer layer and call MCP tools there.
505
-
506
- ## Architecture
507
-
508
- - `src/agents/` - Agent implementations (BaseAgent, SapCoreAIAgent, etc.)
509
- - `src/llm-providers/` - LLM provider implementations (OpenAI, Anthropic, DeepSeek, SapCoreAI)
510
- - `src/mcp/` - MCP client wrapper
511
- - `src/types.ts` - TypeScript type definitions
512
-
513
125
  ## License
514
126
 
515
127
  MIT
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,mBAAmB,CAAiB;gBAEhC,MAAM,EAAE,WAAW;IAe/B;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;OAEG;IACG,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAyC1D;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;OAEG;IACH,YAAY,IAAI,IAAI;IAIpB;;OAEG;IACH,UAAU,IAAI,OAAO,EAAE;CAGxB"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,mBAAmB,CAAiB;gBAEhC,MAAM,EAAE,WAAW;IAe/B;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;OAEG;IACG,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA2C1D;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;OAEG;IACH,YAAY,IAAI,IAAI;IAIpB;;OAEG;IACH,UAAU,IAAI,OAAO,EAAE;CAGxB"}
package/dist/agent.js CHANGED
@@ -59,9 +59,10 @@ export class Agent {
59
59
  };
60
60
  }
61
61
  catch (error) {
62
+ const errorMessage = error instanceof Error ? error.message : String(error);
62
63
  return {
63
64
  message: '',
64
- error: error.message || 'Agent processing failed',
65
+ error: errorMessage || 'Agent processing failed',
65
66
  };
66
67
  }
67
68
  }
package/dist/agent.js.map CH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AC,IAAI,CAAC;gBAC5B,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,WAAW,CAAC,OAAO;aAC7B,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,GAAG,EAAE,WAAW,CAAC,GAAG;aACrB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,OAAO;gBACL,OAAO,EAAE,EAAE;gBACX,KAAK,EAAE,YAAY,IAAI,yBAAyB;aACjD,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACK,kBAAkB,CACxB,KAAqD;QAErD,MAAM,gBAAgB,GAAG,KAAK;aAC3B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACZ,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,IAAI,gBAAgB,EAAE,CAAC;QACnE,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,OAAO;;EAET,gBAAgB;;yFAEuE,CAAC;IACxF,CAAC;IAED;;OAEG;IACH,YAAY;QACV,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;CACF"}
@@ -5,8 +5,8 @@
5
5
  * tool use blocks in the response content.
6
6
  */
7
7
  import type { AnthropicProvider } from '../llm-providers/anthropic.js';
8
- import type { Message } from '../types.js';
9
- import { BaseAgent, type BaseAgentConfig } from './base.js';
8
+ import type { AgentStreamChunk, Message } from '../types.js';
9
+ import { type AgentCallOptions, BaseAgent, type BaseAgentConfig } from './base.js';
10
10
  export interface AnthropicAgentConfig extends BaseAgentConfig {
11
11
  llmProvider: AnthropicProvider;
12
12
  }
@@ -16,7 +16,7 @@ export declare class AnthropicAgent extends BaseAgent {
16
16
  /**
17
17
  * Call Anthropic with tools using tools API
18
18
  */
19
- protected callLLMWithTools(messages: Message[], tools: any[]): Promise<{
19
+ protected callLLMWithTools(messages: Message[], tools: unknown[]): Promise<{
20
20
  content: string;
21
21
  raw?: unknown;
22
22
  }>;
@@ -28,5 +28,6 @@ export declare class AnthropicAgent extends BaseAgent {
28
28
  * Format messages for Anthropic API
29
29
  */
30
30
  private formatMessagesForAnthropic;
31
+ protected streamLLMWithTools(_messages: Message[], _tools: unknown[], _options?: AgentCallOptions): AsyncGenerator<AgentStreamChunk, void, unknown>;
31
32
  }
32
33
  //# sourceMappingURL=anthropic-agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic-agent.d.ts","sourceRoot":"","sources":["../../src/agents/anthropic-agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,WAAW,EAAE,iBAAiB,CAAC;CAChC;AAED,qBAAa,cAAe,SAAQ,SAAS;IAC3C,OAAO,CAAC,WAAW,CAAoB;gBAE3B,MAAM,EAAE,oBAAoB;IAKxC;;OAEG;cACa,gBAAgB,CAC9B,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,GAAG,EAAE,GACX,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAiD9C;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAWpC;;OAEG;IACH,OAAO,CAAC,0BAA0B;CAQnC"}
1
+ {"version":3,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