crewlayer 0.1.0__py3-none-any.whl

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,232 @@
1
+ Metadata-Version: 2.4
2
+ Name: crewlayer
3
+ Version: 0.1.0
4
+ Summary: Open source memory & context backend for AI agents
5
+ Project-URL: Homepage, https://github.com/GerardSole/CrewLayer
6
+ Project-URL: Repository, https://github.com/GerardSole/CrewLayer
7
+ Project-URL: Documentation, https://github.com/GerardSole/CrewLayer/blob/main/sdk/README.md
8
+ Project-URL: Bug Tracker, https://github.com/GerardSole/CrewLayer/issues
9
+ Author-email: Gerard Solé <gesoca2003@gmail.com>
10
+ License: MIT
11
+ Keywords: agents,ai,autogen,context,crewai,crewlayer,langchain,llamaindex,llm,memory
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.12
23
+ Requires-Dist: httpx<1.0,>=0.27.0
24
+ Provides-Extra: all-integrations
25
+ Requires-Dist: crewai>=0.28.0; extra == 'all-integrations'
26
+ Requires-Dist: langchain-core<1.0,>=0.2.0; extra == 'all-integrations'
27
+ Requires-Dist: llama-index-core>=0.10.0; extra == 'all-integrations'
28
+ Requires-Dist: pyautogen>=0.2.0; extra == 'all-integrations'
29
+ Provides-Extra: autogen
30
+ Requires-Dist: pyautogen>=0.2.0; extra == 'autogen'
31
+ Provides-Extra: build
32
+ Requires-Dist: build>=1.2; extra == 'build'
33
+ Requires-Dist: twine>=6.0; extra == 'build'
34
+ Provides-Extra: crewai
35
+ Requires-Dist: crewai>=0.28.0; extra == 'crewai'
36
+ Provides-Extra: dev
37
+ Requires-Dist: httpx<1.0,>=0.27.0; extra == 'dev'
38
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
39
+ Requires-Dist: pytest>=8.0; extra == 'dev'
40
+ Provides-Extra: langchain
41
+ Requires-Dist: langchain-core<1.0,>=0.2.0; extra == 'langchain'
42
+ Provides-Extra: llamaindex
43
+ Requires-Dist: llama-index-core>=0.10.0; extra == 'llamaindex'
44
+ Description-Content-Type: text/markdown
45
+
46
+ # CrewLayer Python SDK
47
+
48
+ Open source memory & context backend for AI agents.
49
+ Persistent memory, action logging, and shared blackboard — all in one REST API.
50
+
51
+ [![PyPI](https://img.shields.io/pypi/v/crewlayer)](https://pypi.org/project/crewlayer/)
52
+ [![Python](https://img.shields.io/pypi/pyversions/crewlayer)](https://pypi.org/project/crewlayer/)
53
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/GerardSole/CrewLayer/blob/main/LICENSE)
54
+
55
+ **Source & docs:** [github.com/GerardSole/CrewLayer](https://github.com/GerardSole/CrewLayer)
56
+
57
+ ---
58
+
59
+ ## Install
60
+
61
+ ```bash
62
+ pip install crewlayer
63
+ ```
64
+
65
+ Requires Python 3.12+. Runtime dependency: `httpx` only.
66
+
67
+ ---
68
+
69
+ ## Quick start
70
+
71
+ ```python
72
+ from crewlayer import CrewLayerClient
73
+
74
+ client = CrewLayerClient(api_key="crwl_...", base_url="http://localhost:8000")
75
+
76
+ # Persist a message to short-term memory
77
+ client.memory.append(agent_id="agent-uuid", role="user", content="I prefer dark mode")
78
+
79
+ # Semantic recall from long-term memory
80
+ results = client.memory.recall(agent_id="agent-uuid", query="UI preferences", limit=5)
81
+ for item in results.results:
82
+ print(f"[{item.similarity:.2f}] {item.content}")
83
+
84
+ # Log an action (full audit trail)
85
+ client.actions.log(agent_id="agent-uuid", tool_name="web_search",
86
+ input_params={"q": "crewlayer"}, status="success", duration_ms=120)
87
+
88
+ # Shared blackboard between agents
89
+ client.context.write(namespace="project-42", key="phase", value={"stage": "planning"})
90
+ entry = client.context.read("project-42", "phase")
91
+ print(entry.value) # {"stage": "planning"}
92
+
93
+ client.close()
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Async client
99
+
100
+ ```python
101
+ import asyncio
102
+ from crewlayer import CrewLayerAsyncClient
103
+
104
+ async def main():
105
+ async with CrewLayerAsyncClient(api_key="crwl_...") as client:
106
+ await client.memory.append(agent_id="agent-uuid", role="user", content="Hello")
107
+ result = await client.memory.recall(agent_id="agent-uuid", query="greeting")
108
+ print(result.results)
109
+
110
+ asyncio.run(main())
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Integrations
116
+
117
+ Optional extras bring first-class support for popular AI frameworks.
118
+ Each integration falls back gracefully when the framework is not installed.
119
+
120
+ | Extra | Install | What you get |
121
+ |---|---|---|
122
+ | `langchain` | `pip install crewlayer[langchain]` | `AgentLayerMemory`, `AgentLayerVectorStore`, `AgentLayerCallbackHandler` |
123
+ | `crewai` | `pip install crewlayer[crewai]` | `AgentLayerMemoryProvider`, `AgentLayerTaskLogger` |
124
+ | `llamaindex` | `pip install crewlayer[llamaindex]` | `CrewLayerMemoryBuffer`, `CrewLayerVectorIndex`, `CrewLayerQueryEngine`, `CrewLayerCallbackManager` |
125
+ | `autogen` | `pip install crewlayer[autogen]` | `CrewLayerConversableAgent`, `CrewLayerGroupChatManager`, `CrewLayerAgentMemory`, `sync_agent_status` |
126
+ | `all-integrations` | `pip install crewlayer[all-integrations]` | All of the above |
127
+
128
+ ### LangChain
129
+
130
+ ```python
131
+ from crewlayer import CrewLayerClient
132
+ from crewlayer.integrations.langchain import AgentLayerMemory
133
+ from langchain.chains import ConversationChain
134
+ from langchain_openai import ChatOpenAI
135
+
136
+ client = CrewLayerClient(api_key="crwl_...")
137
+ memory = AgentLayerMemory(client=client, agent_id="agent-uuid", session_id="user-123")
138
+ chain = ConversationChain(llm=ChatOpenAI(), memory=memory)
139
+ chain.predict(input="What's my name?")
140
+ ```
141
+
142
+ ### CrewAI
143
+
144
+ ```python
145
+ from crewlayer.integrations.crewai import AgentLayerMemoryProvider, AgentLayerTaskLogger
146
+ from crewai.memory import LongTermMemory
147
+ from crewai import Task
148
+
149
+ storage = AgentLayerMemoryProvider(client=client, agent_id="agent-uuid")
150
+ ltm = LongTermMemory(storage=storage)
151
+
152
+ logger = AgentLayerTaskLogger(client=client, agent_id="agent-uuid")
153
+ task = Task(description="Summarize feedback", expected_output="...", agent=agent, callback=logger)
154
+ ```
155
+
156
+ ### LlamaIndex
157
+
158
+ ```python
159
+ from crewlayer.integrations.llamaindex import CrewLayerVectorIndex
160
+ from llama_index.core.schema import Document
161
+
162
+ index = CrewLayerVectorIndex(client=client, agent_id="agent-uuid", similarity_top_k=4)
163
+ index.insert(Document(text="User prefers dark mode"))
164
+ engine = index.as_query_engine()
165
+ response = engine.query("UI preferences")
166
+ print(response.response)
167
+ ```
168
+
169
+ ### AutoGen (multi-agent blackboard)
170
+
171
+ The killer feature: `CrewLayerGroupChatManager` writes every turn to a shared blackboard.
172
+ Any agent — or external observer — can read live group state without being in the chat.
173
+
174
+ ```python
175
+ from crewlayer.integrations.autogen import (
176
+ CrewLayerConversableAgent, CrewLayerGroupChatManager, CrewLayerAgentMemory,
177
+ )
178
+ import autogen
179
+
180
+ client = CrewLayerClient(api_key="crwl_...")
181
+ researcher = CrewLayerConversableAgent(name="researcher", client=client, agent_id="uuid-r",
182
+ llm_config={"config_list": [...]})
183
+ writer = CrewLayerConversableAgent(name="writer", client=client, agent_id="uuid-w",
184
+ llm_config={"config_list": [...]})
185
+
186
+ groupchat = autogen.GroupChat(agents=[researcher, writer], messages=[], max_round=10)
187
+ manager = CrewLayerGroupChatManager(client=client, group_id="project-alpha", groupchat=groupchat)
188
+ CrewLayerAgentMemory(client=client, agent_id="uuid-r").apply(researcher)
189
+
190
+ researcher.initiate_chat(manager, message="Let's plan the release.")
191
+
192
+ # From anywhere — see who spoke last
193
+ latest = client.context.read("project-alpha", "latest_turn")
194
+ print(latest.value) # {"agent": "writer", "content": "...", "turn": 3}
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Error handling
200
+
201
+ ```python
202
+ from crewlayer import CrewLayerError, AuthError, NotFoundError, ConflictError, RateLimitError
203
+
204
+ try:
205
+ client.memory.recall(agent_id="bad-id", query="test")
206
+ except AuthError:
207
+ print("Invalid API key")
208
+ except NotFoundError:
209
+ print("Agent not found")
210
+ except ConflictError as e:
211
+ print(f"Version conflict: {e}")
212
+ except RateLimitError:
213
+ print("Rate limited")
214
+ except CrewLayerError as e:
215
+ print(f"HTTP {e.status_code}: {e}")
216
+ ```
217
+
218
+ All exceptions expose `.status_code` (int | None) and `.response` (dict | None).
219
+
220
+ ---
221
+
222
+ ## Self-hosting
223
+
224
+ ```bash
225
+ git clone https://github.com/GerardSole/CrewLayer
226
+ cd CrewLayer
227
+ docker compose up -d # starts PostgreSQL + Redis
228
+ alembic upgrade head
229
+ uvicorn main:app --reload # API at http://localhost:8000
230
+ ```
231
+
232
+ Full documentation: [github.com/GerardSole/CrewLayer](https://github.com/GerardSole/CrewLayer)
@@ -0,0 +1,17 @@
1
+ crewlayer/__init__.py,sha256=G0j2q8dxdGYXLYvUS6aBiSmMjbtXZkFXcu1oNgOMpM4,1077
2
+ crewlayer/_actions.py,sha256=fIUR6LnDjtenvPXzfMaSLz0tpgDlv4VUSvBXPyCGdSA,5239
3
+ crewlayer/_client.py,sha256=7CnW6SLQmMmHrAAFkbjwTYdLrBO_aMeODTOr6DY03EQ,2609
4
+ crewlayer/_context.py,sha256=JbyBN0Vd6ozJQmVPxq5cPMHjj2CfBvQgynJ8iBsSZqY,3871
5
+ crewlayer/_exceptions.py,sha256=mJyr2NrVazKhYLPjdQRjHX-_zzmTjqsKR_ixQF59INc,1896
6
+ crewlayer/_http.py,sha256=bfp-f7ZzR27X_u78c0H_vQf7bYgeppZPsY3OaSsId7w,3284
7
+ crewlayer/_memory.py,sha256=oPByTsTE1ojZLzbXDNHsiPhig1heKskirHxNrybFT9E,5824
8
+ crewlayer/_types.py,sha256=Kpwh4TOA4PITT8R3K5hENUesZunguogT-mtp9-hX6vQ,6525
9
+ crewlayer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ crewlayer/integrations/__init__.py,sha256=4IRdw0kQ--epapo-valWKlQKcT4pbPuJlWz9rchnlLM,202
11
+ crewlayer/integrations/autogen.py,sha256=_A9jEUmB7U6mw9wOpkrBuJkWuTq7r_2in7mDcvuTjt8,18273
12
+ crewlayer/integrations/crewai.py,sha256=Fm7KCLbeNaeJtlVbCbtxldmZQ4678DyDGqNMsX6BqYE,7238
13
+ crewlayer/integrations/langchain.py,sha256=wQ8PLUTYLqG2P0f9j6Ym4HCMlvlCg7Hal2XOu_VHu9I,14149
14
+ crewlayer/integrations/llamaindex.py,sha256=vXYkXH9AwEf2Hmen6Oo2IZrCWK5l3W4hP1izwiS4k04,18289
15
+ crewlayer-0.1.0.dist-info/METADATA,sha256=eNp6O2Jo4NW7q29-53qg-aIih1esm2h-6kVgXvBHiqA,8323
16
+ crewlayer-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
17
+ crewlayer-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.30.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any