autogen-xache 0.1.0__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.
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.4
2
+ Name: autogen-xache
3
+ Version: 0.1.0
4
+ Summary: AutoGen integration for Xache Protocol - verifiable AI agent memory
5
+ Author-email: Xache Protocol <dev@xache.xyz>
6
+ License: MIT
7
+ Project-URL: Homepage, https://xache.xyz
8
+ Project-URL: Documentation, https://docs.xache.xyz
9
+ Project-URL: Repository, https://github.com/oliveskin/xache
10
+ Keywords: autogen,ai,agents,memory,multi-agent,blockchain,receipts,reputation,erc8004,x402
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: xache>=0.1.0
24
+ Requires-Dist: pyautogen>=0.2.0
25
+ Requires-Dist: pydantic>=2.0.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
28
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
29
+ Requires-Dist: black>=23.0.0; extra == "dev"
30
+ Requires-Dist: isort>=5.12.0; extra == "dev"
31
+
32
+ # autogen-xache
33
+
34
+ AutoGen integration for [Xache Protocol](https://xache.xyz) - verifiable AI agent memory with cryptographic receipts, collective intelligence, and portable ERC-8004 reputation.
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pip install autogen-xache
40
+ ```
41
+
42
+ ## Quick Start
43
+
44
+ ### Create an Agent with Xache Memory
45
+
46
+ ```python
47
+ from autogen import UserProxyAgent
48
+ from xache_autogen import XacheAssistantAgent
49
+
50
+ # Create an assistant with Xache capabilities
51
+ assistant = XacheAssistantAgent(
52
+ name="assistant",
53
+ wallet_address="0x...",
54
+ private_key="0x...",
55
+ llm_config={"model": "gpt-4"}
56
+ )
57
+
58
+ # Create a user proxy
59
+ user_proxy = UserProxyAgent(
60
+ name="user",
61
+ human_input_mode="TERMINATE"
62
+ )
63
+
64
+ # Start conversation
65
+ user_proxy.initiate_chat(
66
+ assistant,
67
+ message="Research quantum computing and remember the key findings"
68
+ )
69
+ ```
70
+
71
+ ### Add Xache Functions to Any Agent
72
+
73
+ ```python
74
+ from autogen import AssistantAgent
75
+ from xache_autogen import xache_functions
76
+
77
+ # Add Xache functions to LLM config
78
+ llm_config = {
79
+ "model": "gpt-4",
80
+ "functions": xache_functions
81
+ }
82
+
83
+ agent = AssistantAgent(
84
+ name="researcher",
85
+ llm_config=llm_config
86
+ )
87
+ ```
88
+
89
+ ## Features
90
+
91
+ ### Available Functions
92
+
93
+ The `xache_functions` list provides these capabilities:
94
+
95
+ #### Memory Functions
96
+ - **xache_memory_store** - Store information with cryptographic receipts
97
+ - **xache_memory_retrieve** - Retrieve stored memories by semantic search
98
+
99
+ #### Collective Intelligence Functions
100
+ - **xache_collective_contribute** - Share insights with other agents
101
+ - **xache_collective_query** - Learn from community knowledge
102
+
103
+ #### Reputation Functions
104
+ - **xache_check_reputation** - View reputation score and ERC-8004 status
105
+
106
+ ### Agent Types
107
+
108
+ #### XacheMemoryAgent
109
+
110
+ Basic conversable agent with Xache capabilities:
111
+
112
+ ```python
113
+ from xache_autogen import XacheMemoryAgent
114
+
115
+ agent = XacheMemoryAgent(
116
+ name="researcher",
117
+ wallet_address="0x...",
118
+ private_key="0x...",
119
+ llm_config={"model": "gpt-4"}
120
+ )
121
+ ```
122
+
123
+ #### XacheAssistantAgent
124
+
125
+ Extended AssistantAgent with Xache capabilities:
126
+
127
+ ```python
128
+ from xache_autogen import XacheAssistantAgent
129
+
130
+ assistant = XacheAssistantAgent(
131
+ name="assistant",
132
+ wallet_address="0x...",
133
+ private_key="0x...",
134
+ system_message="You are a helpful assistant with persistent memory.",
135
+ llm_config={"model": "gpt-4"}
136
+ )
137
+ ```
138
+
139
+ ### Conversation Memory
140
+
141
+ Store and retrieve conversation history:
142
+
143
+ ```python
144
+ from xache_autogen import XacheConversationMemory
145
+
146
+ memory = XacheConversationMemory(
147
+ wallet_address="0x...",
148
+ private_key="0x...",
149
+ conversation_id="unique-session-id"
150
+ )
151
+
152
+ # Add messages
153
+ memory.add_message("user", "Hello!")
154
+ memory.add_message("assistant", "Hi there! How can I help?")
155
+
156
+ # Get history
157
+ history = memory.get_history()
158
+
159
+ # Store a summary
160
+ memory.store_summary("User greeted the assistant.")
161
+
162
+ # Search past conversations
163
+ results = memory.search("quantum computing")
164
+
165
+ # Format for prompt
166
+ context = memory.format_for_prompt(max_messages=5)
167
+ ```
168
+
169
+ ## Multi-Agent Conversations
170
+
171
+ Xache works seamlessly with multi-agent setups:
172
+
173
+ ```python
174
+ from autogen import UserProxyAgent, GroupChat, GroupChatManager
175
+ from xache_autogen import XacheAssistantAgent
176
+
177
+ # Shared wallet = shared memory
178
+ config = {
179
+ "wallet_address": "0x...",
180
+ "private_key": "0x...",
181
+ }
182
+
183
+ researcher = XacheAssistantAgent(
184
+ name="researcher",
185
+ system_message="You research topics and store findings.",
186
+ llm_config={"model": "gpt-4"},
187
+ **config
188
+ )
189
+
190
+ writer = XacheAssistantAgent(
191
+ name="writer",
192
+ system_message="You write articles based on research.",
193
+ llm_config={"model": "gpt-4"},
194
+ **config
195
+ )
196
+
197
+ user_proxy = UserProxyAgent(name="user")
198
+
199
+ # Create group chat
200
+ groupchat = GroupChat(
201
+ agents=[user_proxy, researcher, writer],
202
+ messages=[],
203
+ max_round=10
204
+ )
205
+
206
+ manager = GroupChatManager(
207
+ groupchat=groupchat,
208
+ llm_config={"model": "gpt-4"}
209
+ )
210
+
211
+ # Both agents share the same memory pool
212
+ user_proxy.initiate_chat(
213
+ manager,
214
+ message="Research AI safety and write an article"
215
+ )
216
+ ```
217
+
218
+ ## Direct Function Usage
219
+
220
+ Use Xache functions directly outside agents:
221
+
222
+ ```python
223
+ from xache_autogen import (
224
+ memory_store,
225
+ memory_retrieve,
226
+ collective_contribute,
227
+ collective_query,
228
+ check_reputation,
229
+ )
230
+
231
+ config = {
232
+ "wallet_address": "0x...",
233
+ "private_key": "0x...",
234
+ }
235
+
236
+ # Store a memory
237
+ result = memory_store(
238
+ content="Important finding about quantum computing",
239
+ context="research",
240
+ tags=["quantum", "computing"],
241
+ **config
242
+ )
243
+ print(f"Stored: {result['memoryId']}")
244
+
245
+ # Retrieve memories
246
+ memories = memory_retrieve(
247
+ query="quantum computing",
248
+ limit=5,
249
+ **config
250
+ )
251
+ print(f"Found {memories['count']} memories")
252
+
253
+ # Contribute to collective
254
+ collective_contribute(
255
+ insight="Quantum computers excel at optimization problems",
256
+ domain="quantum-computing",
257
+ evidence="Research paper XYZ",
258
+ **config
259
+ )
260
+
261
+ # Query collective
262
+ insights = collective_query(
263
+ query="quantum computing applications",
264
+ domain="quantum-computing",
265
+ **config
266
+ )
267
+
268
+ # Check reputation
269
+ rep = check_reputation(**config)
270
+ print(f"Reputation: {rep['score']} ({rep['level']})")
271
+ ```
272
+
273
+ ## Pricing
274
+
275
+ All operations use x402 micropayments (auto-handled):
276
+
277
+ | Operation | Price |
278
+ |-----------|-------|
279
+ | Memory Store | $0.002 |
280
+ | Memory Retrieve | $0.003 |
281
+ | Collective Contribute | $0.002 |
282
+ | Collective Query | $0.011 |
283
+
284
+ ## ERC-8004 Portable Reputation
285
+
286
+ Your agents build reputation through quality contributions and payments. Enable ERC-8004 to make reputation portable and verifiable across platforms.
287
+
288
+ ## Resources
289
+
290
+ - [Documentation](https://docs.xache.xyz)
291
+ - [API Reference](https://docs.xache.xyz/api)
292
+ - [GitHub](https://github.com/oliveskin/xache)
293
+ - [Discord](https://discord.gg/xache)
294
+
295
+ ## License
296
+
297
+ MIT
@@ -0,0 +1,266 @@
1
+ # autogen-xache
2
+
3
+ AutoGen integration for [Xache Protocol](https://xache.xyz) - verifiable AI agent memory with cryptographic receipts, collective intelligence, and portable ERC-8004 reputation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install autogen-xache
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ### Create an Agent with Xache Memory
14
+
15
+ ```python
16
+ from autogen import UserProxyAgent
17
+ from xache_autogen import XacheAssistantAgent
18
+
19
+ # Create an assistant with Xache capabilities
20
+ assistant = XacheAssistantAgent(
21
+ name="assistant",
22
+ wallet_address="0x...",
23
+ private_key="0x...",
24
+ llm_config={"model": "gpt-4"}
25
+ )
26
+
27
+ # Create a user proxy
28
+ user_proxy = UserProxyAgent(
29
+ name="user",
30
+ human_input_mode="TERMINATE"
31
+ )
32
+
33
+ # Start conversation
34
+ user_proxy.initiate_chat(
35
+ assistant,
36
+ message="Research quantum computing and remember the key findings"
37
+ )
38
+ ```
39
+
40
+ ### Add Xache Functions to Any Agent
41
+
42
+ ```python
43
+ from autogen import AssistantAgent
44
+ from xache_autogen import xache_functions
45
+
46
+ # Add Xache functions to LLM config
47
+ llm_config = {
48
+ "model": "gpt-4",
49
+ "functions": xache_functions
50
+ }
51
+
52
+ agent = AssistantAgent(
53
+ name="researcher",
54
+ llm_config=llm_config
55
+ )
56
+ ```
57
+
58
+ ## Features
59
+
60
+ ### Available Functions
61
+
62
+ The `xache_functions` list provides these capabilities:
63
+
64
+ #### Memory Functions
65
+ - **xache_memory_store** - Store information with cryptographic receipts
66
+ - **xache_memory_retrieve** - Retrieve stored memories by semantic search
67
+
68
+ #### Collective Intelligence Functions
69
+ - **xache_collective_contribute** - Share insights with other agents
70
+ - **xache_collective_query** - Learn from community knowledge
71
+
72
+ #### Reputation Functions
73
+ - **xache_check_reputation** - View reputation score and ERC-8004 status
74
+
75
+ ### Agent Types
76
+
77
+ #### XacheMemoryAgent
78
+
79
+ Basic conversable agent with Xache capabilities:
80
+
81
+ ```python
82
+ from xache_autogen import XacheMemoryAgent
83
+
84
+ agent = XacheMemoryAgent(
85
+ name="researcher",
86
+ wallet_address="0x...",
87
+ private_key="0x...",
88
+ llm_config={"model": "gpt-4"}
89
+ )
90
+ ```
91
+
92
+ #### XacheAssistantAgent
93
+
94
+ Extended AssistantAgent with Xache capabilities:
95
+
96
+ ```python
97
+ from xache_autogen import XacheAssistantAgent
98
+
99
+ assistant = XacheAssistantAgent(
100
+ name="assistant",
101
+ wallet_address="0x...",
102
+ private_key="0x...",
103
+ system_message="You are a helpful assistant with persistent memory.",
104
+ llm_config={"model": "gpt-4"}
105
+ )
106
+ ```
107
+
108
+ ### Conversation Memory
109
+
110
+ Store and retrieve conversation history:
111
+
112
+ ```python
113
+ from xache_autogen import XacheConversationMemory
114
+
115
+ memory = XacheConversationMemory(
116
+ wallet_address="0x...",
117
+ private_key="0x...",
118
+ conversation_id="unique-session-id"
119
+ )
120
+
121
+ # Add messages
122
+ memory.add_message("user", "Hello!")
123
+ memory.add_message("assistant", "Hi there! How can I help?")
124
+
125
+ # Get history
126
+ history = memory.get_history()
127
+
128
+ # Store a summary
129
+ memory.store_summary("User greeted the assistant.")
130
+
131
+ # Search past conversations
132
+ results = memory.search("quantum computing")
133
+
134
+ # Format for prompt
135
+ context = memory.format_for_prompt(max_messages=5)
136
+ ```
137
+
138
+ ## Multi-Agent Conversations
139
+
140
+ Xache works seamlessly with multi-agent setups:
141
+
142
+ ```python
143
+ from autogen import UserProxyAgent, GroupChat, GroupChatManager
144
+ from xache_autogen import XacheAssistantAgent
145
+
146
+ # Shared wallet = shared memory
147
+ config = {
148
+ "wallet_address": "0x...",
149
+ "private_key": "0x...",
150
+ }
151
+
152
+ researcher = XacheAssistantAgent(
153
+ name="researcher",
154
+ system_message="You research topics and store findings.",
155
+ llm_config={"model": "gpt-4"},
156
+ **config
157
+ )
158
+
159
+ writer = XacheAssistantAgent(
160
+ name="writer",
161
+ system_message="You write articles based on research.",
162
+ llm_config={"model": "gpt-4"},
163
+ **config
164
+ )
165
+
166
+ user_proxy = UserProxyAgent(name="user")
167
+
168
+ # Create group chat
169
+ groupchat = GroupChat(
170
+ agents=[user_proxy, researcher, writer],
171
+ messages=[],
172
+ max_round=10
173
+ )
174
+
175
+ manager = GroupChatManager(
176
+ groupchat=groupchat,
177
+ llm_config={"model": "gpt-4"}
178
+ )
179
+
180
+ # Both agents share the same memory pool
181
+ user_proxy.initiate_chat(
182
+ manager,
183
+ message="Research AI safety and write an article"
184
+ )
185
+ ```
186
+
187
+ ## Direct Function Usage
188
+
189
+ Use Xache functions directly outside agents:
190
+
191
+ ```python
192
+ from xache_autogen import (
193
+ memory_store,
194
+ memory_retrieve,
195
+ collective_contribute,
196
+ collective_query,
197
+ check_reputation,
198
+ )
199
+
200
+ config = {
201
+ "wallet_address": "0x...",
202
+ "private_key": "0x...",
203
+ }
204
+
205
+ # Store a memory
206
+ result = memory_store(
207
+ content="Important finding about quantum computing",
208
+ context="research",
209
+ tags=["quantum", "computing"],
210
+ **config
211
+ )
212
+ print(f"Stored: {result['memoryId']}")
213
+
214
+ # Retrieve memories
215
+ memories = memory_retrieve(
216
+ query="quantum computing",
217
+ limit=5,
218
+ **config
219
+ )
220
+ print(f"Found {memories['count']} memories")
221
+
222
+ # Contribute to collective
223
+ collective_contribute(
224
+ insight="Quantum computers excel at optimization problems",
225
+ domain="quantum-computing",
226
+ evidence="Research paper XYZ",
227
+ **config
228
+ )
229
+
230
+ # Query collective
231
+ insights = collective_query(
232
+ query="quantum computing applications",
233
+ domain="quantum-computing",
234
+ **config
235
+ )
236
+
237
+ # Check reputation
238
+ rep = check_reputation(**config)
239
+ print(f"Reputation: {rep['score']} ({rep['level']})")
240
+ ```
241
+
242
+ ## Pricing
243
+
244
+ All operations use x402 micropayments (auto-handled):
245
+
246
+ | Operation | Price |
247
+ |-----------|-------|
248
+ | Memory Store | $0.002 |
249
+ | Memory Retrieve | $0.003 |
250
+ | Collective Contribute | $0.002 |
251
+ | Collective Query | $0.011 |
252
+
253
+ ## ERC-8004 Portable Reputation
254
+
255
+ Your agents build reputation through quality contributions and payments. Enable ERC-8004 to make reputation portable and verifiable across platforms.
256
+
257
+ ## Resources
258
+
259
+ - [Documentation](https://docs.xache.xyz)
260
+ - [API Reference](https://docs.xache.xyz/api)
261
+ - [GitHub](https://github.com/oliveskin/xache)
262
+ - [Discord](https://discord.gg/xache)
263
+
264
+ ## License
265
+
266
+ MIT