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 +40 -0
- pliamem-0.5.0/README.md +28 -0
- pliamem-0.5.0/pyproject.toml +23 -0
- pliamem-0.5.0/setup.cfg +4 -0
- pliamem-0.5.0/src/pliamem/__init__.py +5 -0
- pliamem-0.5.0/src/pliamem/client.py +43 -0
- pliamem-0.5.0/src/pliamem/exceptions.py +7 -0
- pliamem-0.5.0/src/pliamem.egg-info/PKG-INFO +40 -0
- pliamem-0.5.0/src/pliamem.egg-info/SOURCES.txt +10 -0
- pliamem-0.5.0/src/pliamem.egg-info/dependency_links.txt +1 -0
- pliamem-0.5.0/src/pliamem.egg-info/requires.txt +1 -0
- pliamem-0.5.0/src/pliamem.egg-info/top_level.txt +1 -0
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
|
+
```
|
pliamem-0.5.0/README.md
ADDED
|
@@ -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"
|
pliamem-0.5.0/setup.cfg
ADDED
|
@@ -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,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
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests>=2.25.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pliamem
|