solana-agent 20.0.0__tar.gz → 22.0.5__tar.gz

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 (35) hide show
  1. {solana_agent-20.0.0 → solana_agent-22.0.5}/PKG-INFO +240 -76
  2. {solana_agent-20.0.0 → solana_agent-22.0.5}/README.md +236 -71
  3. {solana_agent-20.0.0 → solana_agent-22.0.5}/pyproject.toml +6 -6
  4. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/adapters/llm_adapter.py +21 -17
  5. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/client/solana_agent.py +13 -7
  6. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/factories/agent_factory.py +3 -4
  7. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/client/client.py +6 -3
  8. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/providers/llm.py +2 -1
  9. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/services/agent.py +2 -1
  10. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/services/query.py +2 -1
  11. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/services/routing.py +1 -2
  12. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/repositories/memory.py +6 -9
  13. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/services/agent.py +185 -103
  14. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/services/query.py +16 -4
  15. {solana_agent-20.0.0 → solana_agent-22.0.5}/LICENSE +0 -0
  16. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/__init__.py +0 -0
  17. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/adapters/__init__.py +0 -0
  18. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/adapters/mongodb_adapter.py +0 -0
  19. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/client/__init__.py +0 -0
  20. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/domains/__init__.py +0 -0
  21. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/domains/agent.py +0 -0
  22. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/domains/routing.py +0 -0
  23. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/factories/__init__.py +0 -0
  24. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/__init__.py +0 -0
  25. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/plugins/plugins.py +0 -0
  26. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/providers/data_storage.py +0 -0
  27. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/interfaces/providers/memory.py +0 -0
  28. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/plugins/__init__.py +0 -0
  29. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/plugins/manager.py +0 -0
  30. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/plugins/registry.py +0 -0
  31. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/plugins/tools/__init__.py +0 -0
  32. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/plugins/tools/auto_tool.py +0 -0
  33. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/repositories/__init__.py +0 -0
  34. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/services/__init__.py +0 -0
  35. {solana_agent-20.0.0 → solana_agent-22.0.5}/solana_agent/services/routing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 20.0.0
3
+ Version: 22.0.5
4
4
  Summary: Agentic IQ
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents,agi
@@ -14,11 +14,10 @@ Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
- Requires-Dist: openai (>=1.68.2,<2.0.0)
18
- Requires-Dist: pydantic (>=2.11.1,<3.0.0)
17
+ Requires-Dist: openai (>=1.70.0,<2.0.0)
18
+ Requires-Dist: pydantic (>=2.11.2,<3.0.0)
19
19
  Requires-Dist: pymongo (>=4.11.3,<5.0.0)
20
- Requires-Dist: zep-cloud (>=2.8.0,<3.0.0)
21
- Requires-Dist: zep-python (>=2.0.2,<3.0.0)
20
+ Requires-Dist: zep-cloud (>=2.9.0,<3.0.0)
22
21
  Project-URL: Documentation, https://docs.solana-agent.com
23
22
  Project-URL: Repository, https://github.com/truemagic-coder/solana-agent
24
23
  Description-Content-Type: text/markdown
@@ -40,9 +39,11 @@ Description-Content-Type: text/markdown
40
39
  Build your AI business in three lines of code!
41
40
 
42
41
  ## Why?
43
- * Three lines of code required
42
+ * Three lines of code setup
43
+ * Multi-Agent Swarm
44
44
  * Multi-Modal Streaming
45
45
  * Conversational Memory & History
46
+ * Built-in Internet Search
46
47
  * Intelligent Routing
47
48
  * Business Alignment
48
49
  * Extensible Tooling
@@ -53,12 +54,15 @@ Build your AI business in three lines of code!
53
54
 
54
55
  ## Features
55
56
 
57
+ * Easy three lines of code setup
58
+ * Designed for a multi-agent swarm
56
59
  * Seamless text and audio streaming with real-time multi-modal processing
57
60
  * Persistent memory that preserves context across all agent interactions
61
+ * Quick built-in Internet Search to answer your queries
58
62
  * Streamlined message history for all agent interactions
59
- * Intelligent query routing to agents with optimal domain expertise
63
+ * Intelligent query routing to agents with optimal domain expertise or your own custom routing
60
64
  * Unified value system ensuring brand-aligned agent responses
61
- * Powerful tool integration using standard Python packages and/or inline classes
65
+ * Powerful tool integration using standard Python packages and/or inline tools
62
66
  * Assigned tools are utilized by agents automatically and effectively
63
67
  * Simple business definition using JSON
64
68
 
@@ -67,7 +71,7 @@ Build your AI business in three lines of code!
67
71
  * [Python](https://python.org) - Programming Language
68
72
  * [OpenAI](https://openai.com) - LLMs
69
73
  * [MongoDB](https://mongodb.com) - Conversational History (optional)
70
- * [Zep](https://getzep.com) - Conversational Memory (optional)
74
+ * [Zep Cloud](https://getzep.com) - Conversational Memory (optional)
71
75
 
72
76
  ## Installation
73
77
 
@@ -75,31 +79,14 @@ You can install Solana Agent using pip:
75
79
 
76
80
  `pip install solana-agent`
77
81
 
78
- ## Basic Usage
82
+ ## Usage
83
+
84
+ ### Text/Text Streaming
79
85
 
80
86
  ```python
81
87
  from solana_agent import SolanaAgent
82
88
 
83
89
  config = {
84
- "business": { # optional
85
- "mission": "To provide users with a one-stop shop for their queries.",
86
- "values": {
87
- "Friendliness": "Users must be treated fairly, openly, and with friendliness.",
88
- "Ethical": "Agents must use a strong ethical framework in their interactions with users.",
89
- },
90
- "goals": [
91
- "Empower users with great answers to their queries.",
92
- ],
93
- "voice": "The voice of the brand is that of a research business."
94
- },
95
- "mongo": { # optional
96
- "connection_string": "mongodb://localhost:27017",
97
- "database": "solana_agent"
98
- },
99
- "zep": { # optional
100
- "api_key": "your-zep-api-key",
101
- "base_url": "your-zep-base-url", # not applicable if using Zep Cloud
102
- },
103
90
  "openai": {
104
91
  "api_key": "your-openai-api-key",
105
92
  },
@@ -123,17 +110,104 @@ async for response in solana_agent.process("user123", "What are the latest AI de
123
110
  print(response, end="")
124
111
  ```
125
112
 
126
- ## Plugin Usage
113
+ ### Audio/Audio Streaming
127
114
 
128
- Plugins like Solana Agent Kit (sakit) integrate automatically with Solana Agent.
115
+ ```python
116
+ from solana_agent import SolanaAgent
129
117
 
130
- `pip install sakit`
118
+ config = {
119
+ "openai": {
120
+ "api_key": "your-openai-api-key",
121
+ },
122
+ "agents": [
123
+ {
124
+ "name": "research_specialist",
125
+ "instructions": "You are an expert researcher who synthesizes complex information clearly.",
126
+ "specialization": "Research and knowledge synthesis",
127
+ },
128
+ {
129
+ "name": "customer_support",
130
+ "instructions": "You provide friendly, helpful customer support responses.",
131
+ "specialization": "Customer inquiries",
132
+ }
133
+ ],
134
+ }
135
+
136
+ solana_agent = SolanaAgent(config=config)
137
+
138
+ audio_content = audio_file.read()
139
+
140
+ async for response in solana_agent.process("user123", audio_content, output_format="audio", audio_voice="nova", audio_input_format="webm", audio_output_format="aac"):
141
+ print(response, end="")
142
+ ```
143
+
144
+ ### Text/Audio Streaming
131
145
 
132
146
  ```python
133
147
  from solana_agent import SolanaAgent
134
148
 
135
149
  config = {
136
- "business": { # optional
150
+ "openai": {
151
+ "api_key": "your-openai-api-key",
152
+ },
153
+ "agents": [
154
+ {
155
+ "name": "research_specialist",
156
+ "instructions": "You are an expert researcher who synthesizes complex information clearly.",
157
+ "specialization": "Research and knowledge synthesis",
158
+ },
159
+ {
160
+ "name": "customer_support",
161
+ "instructions": "You provide friendly, helpful customer support responses.",
162
+ "specialization": "Customer inquiries",
163
+ }
164
+ ],
165
+ }
166
+
167
+ solana_agent = SolanaAgent(config=config)
168
+
169
+ async for response in solana_agent.process("user123", "What is the latest news on Elon Musk?", output_format="audio", audio_voice="nova", audio_output_format="aac"):
170
+ print(response, end="")
171
+ ```
172
+
173
+ ### Audio/Text Streaming
174
+
175
+ ```python
176
+ from solana_agent import SolanaAgent
177
+
178
+ config = {
179
+ "openai": {
180
+ "api_key": "your-openai-api-key",
181
+ },
182
+ "agents": [
183
+ {
184
+ "name": "research_specialist",
185
+ "instructions": "You are an expert researcher who synthesizes complex information clearly.",
186
+ "specialization": "Research and knowledge synthesis",
187
+ },
188
+ {
189
+ "name": "customer_support",
190
+ "instructions": "You provide friendly, helpful customer support responses.",
191
+ "specialization": "Customer inquiries",
192
+ }
193
+ ],
194
+ }
195
+
196
+ solana_agent = SolanaAgent(config=config)
197
+
198
+ audio_content = audio_file.read()
199
+
200
+ async for response in solana_agent.process("user123", audio_content, audio_input_format="aac"):
201
+ print(response, end="")
202
+ ```
203
+
204
+ ## Optional Feature Configs
205
+
206
+ ### Business Alignment
207
+
208
+ ```python
209
+ config = {
210
+ "business": {
137
211
  "mission": "To provide users with a one-stop shop for their queries.",
138
212
  "values": {
139
213
  "Friendliness": "Users must be treated fairly, openly, and with friendliness.",
@@ -144,31 +218,70 @@ config = {
144
218
  ],
145
219
  "voice": "The voice of the brand is that of a research business."
146
220
  },
147
- "openai": { # optional
148
- "api_key": "your-openai-api-key",
149
- },
150
- "ollama": { # optional
151
- "url": "your-ollama-url",
152
- },
153
- "mongo": { # optional
221
+ }
222
+ ```
223
+
224
+ ### Conversational History
225
+
226
+ ```python
227
+ config = {
228
+ "mongo": {
154
229
  "connection_string": "mongodb://localhost:27017",
155
230
  "database": "solana_agent"
156
231
  },
157
- "zep": { # optional
158
- "api_key": "your-zep-api-key",
159
- "base_url": "your-zep-base-url", # not applicable if using Zep Cloud
232
+ }
233
+ ```
234
+
235
+ ### Conversational Memory
236
+
237
+ ```python
238
+ config = {
239
+ "zep": {
240
+ "api_key": "your-zep-cloud-api-key",
241
+ },
242
+ }
243
+ ```
244
+
245
+ ### Disable Internet Searching
246
+
247
+ ```python
248
+ async for response in solana_agent.process("user123", "Write me a poem.", internet_search=False):
249
+ print(response, end="")
250
+ ```
251
+
252
+ ### Customize Audio Voice
253
+
254
+ This is an audio to audio example using the `audio_instructions` parameter.
255
+
256
+ ```python
257
+ async for response in solana_agent.process("user123", audio_content, output_format="audio", audio_voice="nova", audio_input_format="webm", audio_output_format="aac", audio_instructions="You speak with an American southern accent"):
258
+ print(response, end="")
259
+ ```
260
+
261
+ ## Tools
262
+
263
+ Tools can be used from plugins like Solana Agent Kit (sakit) or via custom inline tools. Tools available via plugins integrate automatically with Solana Agent.
264
+
265
+ ### Plugin Usage Example
266
+
267
+ `pip install sakit`
268
+
269
+ ```python
270
+ from solana_agent import SolanaAgent
271
+
272
+ config = {
273
+ "openai": {
274
+ "api_key": "your-openai-api-key",
160
275
  },
161
276
  "tools": {
162
277
  "search_internet": {
163
- "api_key": "your-perplexity-key", # Required
164
- "citations": True, # Optional, defaults to True
165
- "model": "sonar" # Optional, defaults to "sonar"
278
+ "api_key": "your-perplexity-api-key",
166
279
  },
167
280
  },
168
281
  "agents": [
169
282
  {
170
283
  "name": "research_specialist",
171
- "instructions": "You are an expert researcher who synthesizes complex information clearly.",
284
+ "instructions": "You are an expert researcher who synthesizes complex information clearly. You use your search_internet tool to get the latest information.",
172
285
  "specialization": "Research and knowledge synthesis",
173
286
  "tools": ["search_internet"],
174
287
  },
@@ -182,13 +295,11 @@ config = {
182
295
 
183
296
  solana_agent = SolanaAgent(config=config)
184
297
 
185
- async for response in solana_agent.process("user123", "What are the latest AI developments?"):
298
+ async for response in solana_agent.process("user123", "What are the latest AI developments?", internet_search=False):
186
299
  print(response, end="")
187
300
  ```
188
301
 
189
- To create a plugin like Solana Agent Kit - read the [code](https://github.com/truemagic-coder/solana-agent-kit)
190
-
191
- ## Custom Inline Tool Usage
302
+ ### Custom Inline Tool Example
192
303
 
193
304
  ```python
194
305
  from solana_agent import SolanaAgent
@@ -241,31 +352,9 @@ class TestTool(Tool):
241
352
  }
242
353
 
243
354
  config = {
244
- "business": { # optional
245
- "mission": "To provide users with a one-stop shop for their queries.",
246
- "values": {
247
- "Friendliness": "Users must be treated fairly, openly, and with friendliness.",
248
- "Ethical": "Agents must use a strong ethical framework in their interactions with users.",
249
- },
250
- "goals": [
251
- "Empower users with great answers to their queries.",
252
- ],
253
- "voice": "The voice of the brand is that of a research business."
254
- },
255
- "openai": { # optional
355
+ "openai": {
256
356
  "api_key": "your-openai-api-key",
257
357
  },
258
- "ollama": { # optional
259
- "url": "your-ollama-url",
260
- },
261
- "mongo": { # optional
262
- "connection_string": "mongodb://localhost:27017",
263
- "database": "solana_agent"
264
- },
265
- "zep": { # optional
266
- "api_key": "your-zep-api-key",
267
- "base_url": "your-zep-base-url", # not applicable if using Zep Cloud
268
- },
269
358
  "agents": [
270
359
  {
271
360
  "name": "research_specialist",
@@ -284,18 +373,93 @@ solana_agent = SolanaAgent(config=config)
284
373
 
285
374
  test_tool = TestTool()
286
375
 
287
- solana_agent.register_tool(test_tool)
376
+ solana_agent.register_tool("customer_support", test_tool)
288
377
 
289
378
  async for response in solana_agent.process("user123", "What are the latest AI developments?"):
290
379
  print(response, end="")
291
380
  ```
292
381
 
382
+ ## Training your Agents
383
+
384
+ Many use-cases for Solana Agent require training your agents on your company data.
385
+
386
+ This can be accomplished via runtime prompt injection. Integrations that work well with this method are KBs like Pinecone and FAQs.
387
+
388
+ ```python
389
+ from solana_agent import SolanaAgent
390
+
391
+ config = {
392
+ "openai": {
393
+ "api_key": "your-openai-api-key",
394
+ },
395
+ "agents": [
396
+ {
397
+ "name": "research_specialist",
398
+ "instructions": "You are an expert researcher who synthesizes complex information clearly.",
399
+ "specialization": "Research and knowledge synthesis",
400
+ },
401
+ {
402
+ "name": "customer_support",
403
+ "instructions": "You provide friendly, helpful customer support responses.",
404
+ "specialization": "Customer inquiries",
405
+ }
406
+ ],
407
+ }
408
+
409
+ solana_agent = SolanaAgent(config=config)
410
+
411
+ async for response in solana_agent.process("user123", "What are the latest AI developments?", "This is my FAQ"):
412
+ print(response, end="")
413
+ ```
414
+
415
+ ## Custom Routing
416
+
417
+ In advanced cases like implementing a ticketing system on-top of Solana Agent - you can use your own router.
418
+
419
+ ```python
420
+ from solana_agent import SolanaAgent
421
+ from solana_agent.interfaces.services.routing import RoutingService as RoutingServiceInterface
422
+
423
+ config = {
424
+ "openai": {
425
+ "api_key": "your-openai-api-key",
426
+ },
427
+ "agents": [
428
+ {
429
+ "name": "research_specialist",
430
+ "instructions": "You are an expert researcher who synthesizes complex information clearly.",
431
+ "specialization": "Research and knowledge synthesis",
432
+ },
433
+ {
434
+ "name": "customer_support",
435
+ "instructions": "You provide friendly, helpful customer support responses.",
436
+ "specialization": "Customer inquiries",
437
+ }
438
+ ],
439
+ }
440
+
441
+ class Router(RoutingServiceInterface)
442
+ def __init__(self):
443
+ # your router initialization - delete the following pass
444
+ pass
445
+
446
+ async def route_query(self, query: str) -> str:
447
+ # a simple example to route always to customer_support agent
448
+ return "customer_support"
449
+
450
+ router = Router()
451
+
452
+ solana_agent = SolanaAgent(config=config)
453
+
454
+ async for response in solana_agent.process("user123", "What are the latest AI developments?", router=router):
455
+ print(response, end="")
456
+ ```
457
+
293
458
  ## Notes
294
459
  * Solana Agent agents can only call one tool per response.
295
460
  * Solana Agent agents choose the best tool for the job.
296
461
  * Solana Agent tools do not use OpenAI function calling.
297
462
  * Solana Agent tools are async functions.
298
- * Solana Agent will use OpenAI for audio and Ollama and for text if both config vars are set
299
463
 
300
464
  ## Local Setup
301
465