powr-memory-sdk 1.0.1__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.
- powr_memory_sdk-1.0.1/PKG-INFO +451 -0
- powr_memory_sdk-1.0.1/README.md +424 -0
- powr_memory_sdk-1.0.1/pyproject.toml +52 -0
- powr_memory_sdk-1.0.1/setup.cfg +4 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/__init__.py +185 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/base.py +110 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/central/__init__.py +14 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/central/client.py +201 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/central/engine.py +84 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/central/session.py +277 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/factory.py +118 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/__init__.py +46 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/context.py +393 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/engine.py +126 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/exceptions.py +45 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/langchain.py +155 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/models.py +86 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/session.py +642 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/sqlite_storage.py +333 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/state.py +179 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/stm.py +154 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/storage.py +72 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/local/tools.py +175 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/server/__init__.py +4 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/server/server.py +414 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/wrappers/__init__.py +10 -0
- powr_memory_sdk-1.0.1/src/memory_sdk/wrappers/openai_wrapper.py +167 -0
- powr_memory_sdk-1.0.1/src/powr_memory_sdk.egg-info/PKG-INFO +451 -0
- powr_memory_sdk-1.0.1/src/powr_memory_sdk.egg-info/SOURCES.txt +35 -0
- powr_memory_sdk-1.0.1/src/powr_memory_sdk.egg-info/dependency_links.txt +1 -0
- powr_memory_sdk-1.0.1/src/powr_memory_sdk.egg-info/entry_points.txt +2 -0
- powr_memory_sdk-1.0.1/src/powr_memory_sdk.egg-info/requires.txt +21 -0
- powr_memory_sdk-1.0.1/src/powr_memory_sdk.egg-info/top_level.txt +1 -0
- powr_memory_sdk-1.0.1/tests/test_central_engine.py +103 -0
- powr_memory_sdk-1.0.1/tests/test_local_engine.py +56 -0
- powr_memory_sdk-1.0.1/tests/test_openai_wrapper.py +66 -0
- powr_memory_sdk-1.0.1/tests/test_unified_factory.py +75 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: powr-memory-sdk
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Universal AI Agent Memory SDK: Embedded Local SQLite STM + Central Distributed MCP Server in one unified API.
|
|
5
|
+
Author: Lawazia AI Team
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: ai,agent,memory,stm,mcp,model-context-protocol,working-memory,context,openai,langchain
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
11
|
+
Requires-Dist: mcp>=1.0.0
|
|
12
|
+
Provides-Extra: openai
|
|
13
|
+
Requires-Dist: openai>=1.0.0; extra == "openai"
|
|
14
|
+
Provides-Extra: server
|
|
15
|
+
Requires-Dist: uvicorn>=0.20.0; extra == "server"
|
|
16
|
+
Requires-Dist: fastapi>=0.100.0; extra == "server"
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
20
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
21
|
+
Provides-Extra: all
|
|
22
|
+
Requires-Dist: openai>=1.0.0; extra == "all"
|
|
23
|
+
Requires-Dist: uvicorn>=0.20.0; extra == "all"
|
|
24
|
+
Requires-Dist: fastapi>=0.100.0; extra == "all"
|
|
25
|
+
Requires-Dist: langchain-core>=0.1.0; extra == "all"
|
|
26
|
+
Requires-Dist: pytest>=7.0; extra == "all"
|
|
27
|
+
|
|
28
|
+
# ๐ง powr-memory-sdk
|
|
29
|
+
|
|
30
|
+
**Universal AI Agent Memory SDK** โ Embedded Local SQLite + Central Distributed MCP Server, one unified API.
|
|
31
|
+
|
|
32
|
+
Give your AI agents persistent memory across turns, users, and services โ in **4 lines of code**.
|
|
33
|
+
|
|
34
|
+
[](https://pypi.org/project/powr-memory-sdk/)
|
|
35
|
+
[](https://pypi.org/project/powr-memory-sdk/)
|
|
36
|
+
[](LICENSE)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## โก Quickstart
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install powr-memory-sdk
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from memory_sdk import mem
|
|
48
|
+
|
|
49
|
+
session = mem("user_123")
|
|
50
|
+
session.remember("name", "Gunit")
|
|
51
|
+
session.add_user("Mujhe Python sikhna hai")
|
|
52
|
+
messages = session.to_messages("You are a helpful assistant.")
|
|
53
|
+
# โ Pass `messages` directly to any LLM (OpenAI, Groq, Anthropic, Ollama)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**That's it.** No server to start, no config file, no database setup.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## ๐๏ธ Two Modes โ One API
|
|
61
|
+
|
|
62
|
+
| | **Local Mode** | **Central Mode** |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| **Storage** | Embedded SQLite (your machine) | Deployed MCP Server (shared) |
|
|
65
|
+
| **Best for** | Dev, CLI tools, single agent | Production, multi-agent, microservices |
|
|
66
|
+
| **Setup** | Zero โ just a file path | Zero โ uses deployed server by default |
|
|
67
|
+
| **Latency** | Sub-millisecond | ~5โ20 ms network |
|
|
68
|
+
| **API** | โ
Identical | โ
Identical |
|
|
69
|
+
|
|
70
|
+
> **The API is 100% identical across both modes** โ switch anytime with one line.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## ๐ฆ Installation
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Basic (local SQLite memory only)
|
|
78
|
+
pip install powr-memory-sdk
|
|
79
|
+
|
|
80
|
+
# With OpenAI support
|
|
81
|
+
pip install "powr-memory-sdk[openai]"
|
|
82
|
+
|
|
83
|
+
# With LangChain support
|
|
84
|
+
pip install "powr-memory-sdk[openai,langchain-core]"
|
|
85
|
+
|
|
86
|
+
# Everything
|
|
87
|
+
pip install "powr-memory-sdk[all]"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## ๐ Usage
|
|
93
|
+
|
|
94
|
+
### Zero-Config โ `mem` Singleton (Recommended)
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from memory_sdk import mem
|
|
98
|
+
|
|
99
|
+
# Uses local SQLite automatically โ safe, zero-config, keeps data on your machine
|
|
100
|
+
session = mem("user_123")
|
|
101
|
+
session.remember("name", "Ali")
|
|
102
|
+
session.remember({"city": "Lahore", "diet": "Vegetarian"})
|
|
103
|
+
|
|
104
|
+
session.add_user("Dinner mein kya khaaon?")
|
|
105
|
+
session.add_assistant("Lahore mein vegetarian ke liye Dal Makhani best hai!")
|
|
106
|
+
|
|
107
|
+
messages = session.to_messages("You are a helpful assistant.")
|
|
108
|
+
# โ Ready to pass to any LLM API
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Switch Mode โ One Line
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from memory_sdk import mem
|
|
115
|
+
|
|
116
|
+
# Custom local SQLite database file
|
|
117
|
+
mem.configure(mode="local", db_path="app.db")
|
|
118
|
+
|
|
119
|
+
# Central MCP server (for distributed / multi-agent architectures)
|
|
120
|
+
mem.configure(mode="central", url="http://localhost:8765/mcp")
|
|
121
|
+
|
|
122
|
+
# Back to default local storage
|
|
123
|
+
mem.configure(mode="local")
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## ๐ Integration Examples
|
|
129
|
+
|
|
130
|
+
### OpenAI
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from openai import OpenAI
|
|
134
|
+
from memory_sdk import mem
|
|
135
|
+
|
|
136
|
+
client = OpenAI()
|
|
137
|
+
|
|
138
|
+
def chat(user_id: str, message: str) -> str:
|
|
139
|
+
session = mem(user_id)
|
|
140
|
+
session.add_user(message)
|
|
141
|
+
|
|
142
|
+
response = client.chat.completions.create(
|
|
143
|
+
model="gpt-4o-mini",
|
|
144
|
+
messages=session.to_messages("You are a helpful assistant.")
|
|
145
|
+
)
|
|
146
|
+
reply = response.choices[0].message.content
|
|
147
|
+
session.add_assistant(reply)
|
|
148
|
+
return reply
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### AutoOpenAI โ 1-Line Drop-in Replacement
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
# Change just this one line in your existing OpenAI project:
|
|
155
|
+
# from openai import OpenAI
|
|
156
|
+
from memory_sdk import AutoOpenAI as OpenAI
|
|
157
|
+
|
|
158
|
+
client = OpenAI(session_id="user_123") # Memory is fully automatic
|
|
159
|
+
|
|
160
|
+
response = client.chat.completions.create(
|
|
161
|
+
model="gpt-4o-mini",
|
|
162
|
+
messages=[{"role": "user", "content": "Mera naam Ali hai"}]
|
|
163
|
+
)
|
|
164
|
+
# SDK automatically saves the message and injects memory on next call
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### FastAPI
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
from fastapi import FastAPI
|
|
171
|
+
from memory_sdk import mem
|
|
172
|
+
|
|
173
|
+
app = FastAPI()
|
|
174
|
+
|
|
175
|
+
@app.on_event("startup")
|
|
176
|
+
def setup():
|
|
177
|
+
mem.configure(mode="local", db_path="prod.db", window_size=10)
|
|
178
|
+
|
|
179
|
+
@app.post("/chat/{user_id}")
|
|
180
|
+
async def chat(user_id: str, message: str):
|
|
181
|
+
session = mem(user_id)
|
|
182
|
+
session.add_user(message)
|
|
183
|
+
messages = session.to_messages("You are a helpful assistant.")
|
|
184
|
+
# ... your LLM call here
|
|
185
|
+
reply = "Hello!"
|
|
186
|
+
session.add_assistant(reply)
|
|
187
|
+
return {"reply": reply}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Flask
|
|
191
|
+
|
|
192
|
+
```python
|
|
193
|
+
from flask import Flask, request, jsonify
|
|
194
|
+
from memory_sdk import mem
|
|
195
|
+
|
|
196
|
+
app = Flask(__name__)
|
|
197
|
+
mem.configure(mode="local", db_path="app.db")
|
|
198
|
+
|
|
199
|
+
@app.route("/chat/<user_id>", methods=["POST"])
|
|
200
|
+
def chat(user_id):
|
|
201
|
+
message = request.json["message"]
|
|
202
|
+
session = mem(user_id)
|
|
203
|
+
session.add_user(message)
|
|
204
|
+
messages = session.to_messages("You are a helpful assistant.")
|
|
205
|
+
return jsonify({"messages": messages})
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### LangChain Agent
|
|
209
|
+
|
|
210
|
+
```python
|
|
211
|
+
from langchain_openai import ChatOpenAI
|
|
212
|
+
from memory_sdk import mem
|
|
213
|
+
|
|
214
|
+
llm = ChatOpenAI(model="gpt-4o-mini")
|
|
215
|
+
|
|
216
|
+
def chat(user_id: str, message: str) -> str:
|
|
217
|
+
session = mem(user_id)
|
|
218
|
+
agent = llm.bind_tools(session.get_langchain_tools())
|
|
219
|
+
|
|
220
|
+
session.add_user(message)
|
|
221
|
+
response = agent.invoke(session.to_messages("You are helpful."))
|
|
222
|
+
session.add_assistant(response.content)
|
|
223
|
+
return response.content
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Telegram / WhatsApp Bot
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
from memory_sdk import mem
|
|
230
|
+
|
|
231
|
+
def handle_message(chat_id: str, message: str) -> str:
|
|
232
|
+
session = mem(chat_id) # chat_id = unique user identifier
|
|
233
|
+
session.add_user(message)
|
|
234
|
+
messages = session.to_messages("You are a helpful assistant.")
|
|
235
|
+
reply = your_llm(messages) # your LLM call
|
|
236
|
+
session.add_assistant(reply)
|
|
237
|
+
return reply
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## ๐ Full API Reference
|
|
243
|
+
|
|
244
|
+
### `mem` โ Zero-Config Singleton
|
|
245
|
+
|
|
246
|
+
```python
|
|
247
|
+
from memory_sdk import mem
|
|
248
|
+
|
|
249
|
+
mem.configure(mode, **kwargs) # Configure once at startup
|
|
250
|
+
session = mem("user_id") # Get/create a session (callable)
|
|
251
|
+
session = mem.session("user_id") # Same โ explicit style
|
|
252
|
+
mem.close() # Release resources
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Session Methods
|
|
256
|
+
|
|
257
|
+
```python
|
|
258
|
+
session = mem("user_123")
|
|
259
|
+
|
|
260
|
+
# โโ Save facts โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
261
|
+
session.remember("key", "value") # single fact
|
|
262
|
+
session.remember({"k1": "v1", "k2": "v2"}) # multiple facts at once
|
|
263
|
+
|
|
264
|
+
# โโ Read facts โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
265
|
+
session.recall("key") # one fact โ value or None
|
|
266
|
+
session.recall() # all facts โ dict
|
|
267
|
+
session.profile() # all facts โ dict (alias)
|
|
268
|
+
|
|
269
|
+
# โโ Conversation โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
270
|
+
session.add_user("...") # record user message
|
|
271
|
+
session.add_assistant("...") # record assistant reply
|
|
272
|
+
session.add_system("...") # record system message
|
|
273
|
+
session.history(limit=10) # recent messages list
|
|
274
|
+
|
|
275
|
+
# โโ LLM-ready output โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
276
|
+
session.to_messages(
|
|
277
|
+
system_prompt="You are helpful.", # optional base prompt
|
|
278
|
+
include_memory=True, # inject facts into system message
|
|
279
|
+
)
|
|
280
|
+
# โ [{"role": "system", "content": "..."}, {"role": "user", ...}, ...]
|
|
281
|
+
|
|
282
|
+
# โโ Cleanup โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
283
|
+
session.clear(keep_state=True) # clear messages, keep facts
|
|
284
|
+
session.forget() # wipe everything (messages + facts)
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### `mem.configure()` Options
|
|
288
|
+
|
|
289
|
+
```python
|
|
290
|
+
mem.configure(
|
|
291
|
+
mode="central", # "central" (default) or "local"
|
|
292
|
+
|
|
293
|
+
# Central mode options:
|
|
294
|
+
url="http://...", # MCP server URL (or set MCP_SERVER_URL env var)
|
|
295
|
+
project="my_app", # namespace for session isolation
|
|
296
|
+
|
|
297
|
+
# Local mode options:
|
|
298
|
+
db_path="app.db", # SQLite file path (or ":memory:" for transient)
|
|
299
|
+
window_size=10, # max recent messages to keep in context
|
|
300
|
+
auto_summarize=False, # LLM-based rolling summarization
|
|
301
|
+
)
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## โ๏ธ Environment Variables
|
|
307
|
+
|
|
308
|
+
Set these instead of hardcoding in code:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
# Central server URL (overrides built-in default)
|
|
312
|
+
MCP_SERVER_URL=https://your-server.run.app/mcp
|
|
313
|
+
|
|
314
|
+
# Alternate env var name
|
|
315
|
+
MEMORY_SERVER_URL=https://your-server.run.app/mcp
|
|
316
|
+
|
|
317
|
+
# Force a mode (optional)
|
|
318
|
+
MEMORY_MODE=local
|
|
319
|
+
|
|
320
|
+
# Local DB path (optional)
|
|
321
|
+
MEMORY_DB_PATH=./data/agent.db
|
|
322
|
+
|
|
323
|
+
# Model for auto-summarization
|
|
324
|
+
MEMORY_SUMMARIZER_MODEL=gpt-4o-mini
|
|
325
|
+
|
|
326
|
+
# OpenAI key (needed only for auto_summarize=True)
|
|
327
|
+
OPENAI_API_KEY=sk-...
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## ๐ Running Your Own Central Server
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
# Install server extras
|
|
336
|
+
pip install "powr-memory-sdk[server]"
|
|
337
|
+
|
|
338
|
+
# Start the MCP memory server
|
|
339
|
+
memory-server --port 8765
|
|
340
|
+
|
|
341
|
+
# Point your app to it
|
|
342
|
+
export MCP_SERVER_URL=http://localhost:8765/mcp
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
Or with Docker:
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
docker build -t memory-server .
|
|
349
|
+
docker run -p 8765:8765 -e PORT=8765 memory-server
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Then in your code:
|
|
353
|
+
|
|
354
|
+
```python
|
|
355
|
+
from memory_sdk import mem
|
|
356
|
+
mem.configure(mode="central", url="http://localhost:8765/mcp")
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## ๐ Central MCP Server โ Live Deployed
|
|
362
|
+
|
|
363
|
+
A central memory server is already live and ready to use:
|
|
364
|
+
|
|
365
|
+
```
|
|
366
|
+
URL : https://memory-module-813340036970.asia-south1.run.app/mcp
|
|
367
|
+
Region : asia-south1 (Mumbai)
|
|
368
|
+
Protocol: Streamable HTTP (MCP)
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
This is the **default** when you use `mode="central"` without specifying a `url`. All session data is namespaced by `project` so different apps don't interfere.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## ๐งช Testing
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
# Run all tests
|
|
379
|
+
pytest tests/ -v
|
|
380
|
+
|
|
381
|
+
# With coverage
|
|
382
|
+
pytest tests/ --cov=memory_sdk --cov-report=term-missing
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
**Testing tip โ use in-memory SQLite:**
|
|
386
|
+
|
|
387
|
+
```python
|
|
388
|
+
# conftest.py
|
|
389
|
+
import pytest
|
|
390
|
+
from memory_sdk import mem
|
|
391
|
+
|
|
392
|
+
@pytest.fixture(autouse=True)
|
|
393
|
+
def isolate_memory():
|
|
394
|
+
mem.configure(mode="local", db_path=":memory:")
|
|
395
|
+
yield
|
|
396
|
+
mem.close()
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## ๐๏ธ Project Structure
|
|
402
|
+
|
|
403
|
+
```
|
|
404
|
+
memory-sdk/
|
|
405
|
+
โโโ src/memory_sdk/
|
|
406
|
+
โ โโโ __init__.py โ mem singleton + all exports
|
|
407
|
+
โ โโโ factory.py โ Memory() factory router
|
|
408
|
+
โ โโโ base.py โ BaseMemory / BaseSession protocols
|
|
409
|
+
โ โโโ local/ โ Embedded SQLite engine
|
|
410
|
+
โ โ โโโ engine.py
|
|
411
|
+
โ โ โโโ session.py โ Full session + sliding window + summarizer
|
|
412
|
+
โ โ โโโ sqlite_storage.py
|
|
413
|
+
โ โ โโโ tools.py โ OpenAI function-call tool schemas
|
|
414
|
+
โ โ โโโ langchain.py โ LangChain tool wrappers
|
|
415
|
+
โ โโโ central/ โ Distributed MCP engine
|
|
416
|
+
โ โ โโโ engine.py
|
|
417
|
+
โ โ โโโ session.py
|
|
418
|
+
โ โ โโโ client.py โ Async MCP HTTP client
|
|
419
|
+
โ โโโ server/
|
|
420
|
+
โ โ โโโ server.py โ Standalone MCP memory server
|
|
421
|
+
โ โโโ wrappers/
|
|
422
|
+
โ โโโ openai_wrapper.py โ AutoOpenAI drop-in replacement
|
|
423
|
+
โโโ examples/
|
|
424
|
+
โ โโโ 01_local_mode_quickstart.py
|
|
425
|
+
โ โโโ 02_central_mode_quickstart.py
|
|
426
|
+
โ โโโ 03_switching_modes.py
|
|
427
|
+
โ โโโ 04_openai_autopilot.py
|
|
428
|
+
โโโ tests/
|
|
429
|
+
โโโ pyproject.toml
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## ๐ Compatibility
|
|
435
|
+
|
|
436
|
+
| Framework | Support |
|
|
437
|
+
|---|---|
|
|
438
|
+
| Python | 3.10+ |
|
|
439
|
+
| OpenAI SDK | โ
|
|
|
440
|
+
| LangChain | โ
|
|
|
441
|
+
| FastAPI | โ
|
|
|
442
|
+
| Flask | โ
|
|
|
443
|
+
| Django | โ
|
|
|
444
|
+
| Groq | โ
(same OpenAI API) |
|
|
445
|
+
| Anthropic | โ
(via `to_messages()`) |
|
|
446
|
+
| Ollama | โ
(via `to_messages()`) |
|
|
447
|
+
| Any MCP client | โ
|
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
|