pliamem 0.5.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.
pliamem-0.5.0/PKG-INFO ADDED
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: pliamem
3
+ Version: 0.5.0
4
+ Summary: Python client for Pliamem - Unified memory recall for AI agents
5
+ Author: Jeffrey Milam / Micap AI LLC
6
+ Project-URL: Homepage, https://github.com/jmiaie/pliamem-public
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: requests>=2.25.0
12
+
13
+ # Pliamem Python Client
14
+
15
+ Official Python SDK for [Pliamem](https://github.com/jmiaie/pliamem-public), the unified memory microservice for AI agents.
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install pliamem
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ Make sure your Pliamem Node.js server is running (`node src/server.js`).
26
+
27
+ ```python
28
+ from pliamem import PliamemClient
29
+
30
+ client = PliamemClient(base_url="http://127.0.0.1:3000")
31
+
32
+ # Ask a direct question synthesized from memory
33
+ response = client.ask("What is the ZTB Protocol?")
34
+ print(response["answer"])
35
+
36
+ # Search across all memory layers
37
+ results = client.search("ZTB Protocol", top=3)
38
+ for res in results:
39
+ print(f"[{res['layer']}] {res.get('excerpt', '')[:50]}...")
40
+ ```
@@ -0,0 +1,28 @@
1
+ # Pliamem Python Client
2
+
3
+ Official Python SDK for [Pliamem](https://github.com/jmiaie/pliamem-public), the unified memory microservice for AI agents.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install pliamem
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ Make sure your Pliamem Node.js server is running (`node src/server.js`).
14
+
15
+ ```python
16
+ from pliamem import PliamemClient
17
+
18
+ client = PliamemClient(base_url="http://127.0.0.1:3000")
19
+
20
+ # Ask a direct question synthesized from memory
21
+ response = client.ask("What is the ZTB Protocol?")
22
+ print(response["answer"])
23
+
24
+ # Search across all memory layers
25
+ results = client.search("ZTB Protocol", top=3)
26
+ for res in results:
27
+ print(f"[{res['layer']}] {res.get('excerpt', '')[:50]}...")
28
+ ```
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pliamem"
7
+ version = "0.5.0"
8
+ description = "Python client for Pliamem - Unified memory recall for AI agents"
9
+ readme = "README.md"
10
+ authors = [
11
+ { name="Jeffrey Milam / Micap AI LLC" }
12
+ ]
13
+ classifiers = [
14
+ "Programming Language :: Python :: 3",
15
+ "Operating System :: OS Independent",
16
+ ]
17
+ requires-python = ">=3.8"
18
+ dependencies = [
19
+ "requests>=2.25.0"
20
+ ]
21
+
22
+ [project.urls]
23
+ "Homepage" = "https://github.com/jmiaie/pliamem-public"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ from .client import PliamemClient
2
+ from .exceptions import PliamemAPIError
3
+
4
+ __version__ = "0.5.0"
5
+ __all__ = ["PliamemClient", "PliamemAPIError"]
@@ -0,0 +1,43 @@
1
+ import os
2
+ import requests
3
+ from typing import Dict, Any, List, Optional
4
+ from .exceptions import PliamemAPIError
5
+
6
+ class PliamemClient:
7
+ def __init__(self, base_url: str = "http://127.0.0.1:3000", api_key: Optional[str] = None):
8
+ self.base_url = base_url.rstrip("/")
9
+ self.api_key = api_key or os.environ.get("PLIAMEM_API_KEY")
10
+ self.session = requests.Session()
11
+ if self.api_key:
12
+ self.session.headers.update({"Authorization": f"Bearer {self.api_key}"})
13
+
14
+ def search(self, query: str, layer: Optional[str] = None, top: Optional[int] = None, recent: bool = False) -> List[Dict[str, Any]]:
15
+ """Search across memory layers."""
16
+ params = {"query": query}
17
+ if layer: params["layer"] = layer
18
+ if top: params["top"] = top
19
+ if recent: params["recent"] = "true"
20
+
21
+ response = self.session.get(f"{self.base_url}/v1/search", params=params)
22
+
23
+ if response.status_code != 200:
24
+ raise PliamemAPIError(f"Search failed: {response.text}")
25
+
26
+ return response.json().get("results", [])
27
+
28
+ def ask(self, query: str) -> Dict[str, Any]:
29
+ """Ask the AI a question based on memory context."""
30
+ params = {"query": query}
31
+ response = self.session.get(f"{self.base_url}/v1/ask", params=params)
32
+
33
+ if response.status_code != 200:
34
+ raise PliamemAPIError(f"Ask failed: {response.text}")
35
+
36
+ return response.json()
37
+
38
+ def status(self) -> Dict[str, Any]:
39
+ """Get the status of all memory layers."""
40
+ response = self.session.get(f"{self.base_url}/v1/status")
41
+ if response.status_code != 200:
42
+ raise PliamemAPIError(f"Status check failed: {response.text}")
43
+ return response.json().get("status", {})
@@ -0,0 +1,7 @@
1
+ class PliamemError(Exception):
2
+ """Base exception for Pliamem client."""
3
+ pass
4
+
5
+ class PliamemAPIError(PliamemError):
6
+ """Raised when the Pliamem API returns an error."""
7
+ pass
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: pliamem
3
+ Version: 0.5.0
4
+ Summary: Python client for Pliamem - Unified memory recall for AI agents
5
+ Author: Jeffrey Milam / Micap AI LLC
6
+ Project-URL: Homepage, https://github.com/jmiaie/pliamem-public
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: requests>=2.25.0
12
+
13
+ # Pliamem Python Client
14
+
15
+ Official Python SDK for [Pliamem](https://github.com/jmiaie/pliamem-public), the unified memory microservice for AI agents.
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install pliamem
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ Make sure your Pliamem Node.js server is running (`node src/server.js`).
26
+
27
+ ```python
28
+ from pliamem import PliamemClient
29
+
30
+ client = PliamemClient(base_url="http://127.0.0.1:3000")
31
+
32
+ # Ask a direct question synthesized from memory
33
+ response = client.ask("What is the ZTB Protocol?")
34
+ print(response["answer"])
35
+
36
+ # Search across all memory layers
37
+ results = client.search("ZTB Protocol", top=3)
38
+ for res in results:
39
+ print(f"[{res['layer']}] {res.get('excerpt', '')[:50]}...")
40
+ ```
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/pliamem/__init__.py
4
+ src/pliamem/client.py
5
+ src/pliamem/exceptions.py
6
+ src/pliamem.egg-info/PKG-INFO
7
+ src/pliamem.egg-info/SOURCES.txt
8
+ src/pliamem.egg-info/dependency_links.txt
9
+ src/pliamem.egg-info/requires.txt
10
+ src/pliamem.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests>=2.25.0
@@ -0,0 +1 @@
1
+ pliamem