bridgemem 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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BridgeMem
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: bridgemem
3
+ Version: 0.1.0
4
+ Summary: Official lightweight HTTP and Model Context Protocol (MCP) Python client SDK for BridgeMem autonomous AI memory nodes.
5
+ Author-email: BridgeMem <ccaiuss@gmail.com>
6
+ License-Expression: MIT OR Apache-2.0
7
+ Project-URL: Homepage, https://bridgemem.com
8
+ Project-URL: Documentation, https://bridgemem.org
9
+ Project-URL: Repository, https://github.com/bridgemem/bridgemem-py
10
+ Keywords: bridgemem,mcp,ai,memory,rag,zero-knowledge
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: Database
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: >=3.9
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # BridgeMem Python SDK (`bridgemem`)
22
+
23
+ Official zero-dependency Python client for **BridgeMem** autonomous organizational memory and Zero-Knowledge AI vaults (`https://bridgemem.com` | specification at `https://bridgemem.org`).
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ pip install bridgemem
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```python
34
+ from bridgemem import BridgeMemClient
35
+
36
+ client = BridgeMemClient("http://127.0.0.1:8508", bearer_token="brk_example_key")
37
+ print(client.search(section_id="default", query="invoice retention policy"))
38
+ ```
@@ -0,0 +1,18 @@
1
+ # BridgeMem Python SDK (`bridgemem`)
2
+
3
+ Official zero-dependency Python client for **BridgeMem** autonomous organizational memory and Zero-Knowledge AI vaults (`https://bridgemem.com` | specification at `https://bridgemem.org`).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install bridgemem
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ from bridgemem import BridgeMemClient
15
+
16
+ client = BridgeMemClient("http://127.0.0.1:8508", bearer_token="brk_example_key")
17
+ print(client.search(section_id="default", query="invoice retention policy"))
18
+ ```
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "bridgemem"
7
+ version = "0.1.0"
8
+ description = "Official lightweight HTTP and Model Context Protocol (MCP) Python client SDK for BridgeMem autonomous AI memory nodes."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT OR Apache-2.0"
12
+ authors = [
13
+ { name = "BridgeMem", email = "ccaiuss@gmail.com" }
14
+ ]
15
+ keywords = ["bridgemem", "mcp", "ai", "memory", "rag", "zero-knowledge"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Database",
21
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
22
+ ]
23
+
24
+ [project.urls]
25
+ Homepage = "https://bridgemem.com"
26
+ Documentation = "https://bridgemem.org"
27
+ Repository = "https://github.com/bridgemem/bridgemem-py"
28
+
29
+ [tool.setuptools.packages.find]
30
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,73 @@
1
+ """Official zero-dependency Python client SDK for BridgeMem nodes (https://bridgemem.com)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import urllib.error
7
+ import urllib.request
8
+ from dataclasses import dataclass
9
+ from typing import Any, Dict, Optional
10
+
11
+ __all__ = ["BridgeMemClient", "BridgeMemError", "__version__"]
12
+ __version__ = "0.1.0"
13
+
14
+
15
+ class BridgeMemError(RuntimeError):
16
+ """Raised when a BridgeMem HTTP or MCP call returns an error."""
17
+
18
+ def __init__(self, status: int, message: str) -> None:
19
+ super().__init__(f"BridgeMem HTTP {status}: {message}")
20
+ self.status = status
21
+ self.message = message
22
+
23
+
24
+ @dataclass
25
+ class BridgeMemClient:
26
+ """Lightweight stdlib-only HTTP & MCP JSON-RPC client for a BridgeMem Gate."""
27
+
28
+ endpoint: str = "http://127.0.0.1:8508"
29
+ bearer_token: Optional[str] = None
30
+ timeout_sec: float = 10.0
31
+
32
+ def _request(self, method: str, path: str, payload: Optional[Dict[str, Any]] = None) -> Any:
33
+ url = f"{self.endpoint.rstrip('/')}/{path.lstrip('/')}"
34
+ headers = {"Accept": "application/json"}
35
+ if self.bearer_token:
36
+ headers["Authorization"] = f"Bearer {self.bearer_token.strip()}"
37
+ raw = None
38
+ if payload is not None:
39
+ raw = json.dumps(payload).encode("utf-8")
40
+ headers["Content-Type"] = "application/json"
41
+ req = urllib.request.Request(url, data=raw, headers=headers, method=method)
42
+ try:
43
+ with urllib.request.urlopen(req, timeout=self.timeout_sec) as resp:
44
+ body = resp.read().decode("utf-8", errors="replace")
45
+ return json.loads(body) if body else {}
46
+ except urllib.error.HTTPError as exc:
47
+ detail = exc.read().decode("utf-8", errors="replace")
48
+ raise BridgeMemError(exc.code, detail) from exc
49
+
50
+ def health(self) -> Any:
51
+ return self._request("GET", "/healthz")
52
+
53
+ def search(self, section_id: str, query: str, top_k: int = 8) -> Any:
54
+ return self._request(
55
+ "POST",
56
+ "/api/v1/search",
57
+ {"section_id": section_id, "query": query, "top_k": max(1, min(100, int(top_k)))},
58
+ )
59
+
60
+ def mcp_list_tools(self) -> Any:
61
+ return self._request("POST", "/mcp", {"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}})
62
+
63
+ def mcp_call_tool(self, name: str, arguments: Optional[Dict[str, Any]] = None) -> Any:
64
+ return self._request(
65
+ "POST",
66
+ "/mcp",
67
+ {
68
+ "jsonrpc": "2.0",
69
+ "id": 2,
70
+ "method": "tools/call",
71
+ "params": {"name": name, "arguments": arguments or {}},
72
+ },
73
+ )
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: bridgemem
3
+ Version: 0.1.0
4
+ Summary: Official lightweight HTTP and Model Context Protocol (MCP) Python client SDK for BridgeMem autonomous AI memory nodes.
5
+ Author-email: BridgeMem <ccaiuss@gmail.com>
6
+ License-Expression: MIT OR Apache-2.0
7
+ Project-URL: Homepage, https://bridgemem.com
8
+ Project-URL: Documentation, https://bridgemem.org
9
+ Project-URL: Repository, https://github.com/bridgemem/bridgemem-py
10
+ Keywords: bridgemem,mcp,ai,memory,rag,zero-knowledge
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: Database
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: >=3.9
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # BridgeMem Python SDK (`bridgemem`)
22
+
23
+ Official zero-dependency Python client for **BridgeMem** autonomous organizational memory and Zero-Knowledge AI vaults (`https://bridgemem.com` | specification at `https://bridgemem.org`).
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ pip install bridgemem
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```python
34
+ from bridgemem import BridgeMemClient
35
+
36
+ client = BridgeMemClient("http://127.0.0.1:8508", bearer_token="brk_example_key")
37
+ print(client.search(section_id="default", query="invoice retention policy"))
38
+ ```
@@ -0,0 +1,8 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/bridgemem/__init__.py
5
+ src/bridgemem.egg-info/PKG-INFO
6
+ src/bridgemem.egg-info/SOURCES.txt
7
+ src/bridgemem.egg-info/dependency_links.txt
8
+ src/bridgemem.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ bridgemem