Async Python client for the MyPalace memory service
Project description
mypalace-client
Async Python client for the MyPalace Memory Service.
Install
pip install mypalace-client
# Optional gRPC transport:
pip install "mypalace-client[grpc]"
Quick start
import asyncio
from palace_client import PalaceClient
async def main():
async with PalaceClient(
base_url="http://localhost:8000",
api_key="pk_live_...",
) as client:
# Add a memory
mem = await client.create(
user_id="u1",
content="Joshua likes oat milk",
memory_type="preference",
)
# Search
results = await client.search(query="milk", user_id="u1", limit=5)
for r in results:
print(r.score, r.content)
asyncio.run(main())
Features
Mirrors the full Palace HTTP API:
- Memory CRUD + semantic search + smart-ingestion (
infer=True) - Sessions + messages
- Episode reflection + narrative arc synthesis
- FSRS dynamics (promote/demote/score)
- Intentions (set/check/format)
- Layered context assembly
- Manual supersede + supersession history
Auth
Pass api_key to the constructor; the client sends it as X-Palace-Key on every request. Without an API key, the client works against a server with PALACE_AUTH_DISABLED=true.
gRPC (optional)
Phase 3 ships a focused gRPC mirror covering MemoryService (Create/Get/Delete/Search/List). Use PalaceGrpcClient when you want lower-overhead binary transport for memory ops:
from palace_client.grpc import PalaceGrpcClient
async with PalaceGrpcClient("localhost:50051", api_key="pk_live_...") as c:
mem = await c.create(user_id="u1", content="hello via gRPC")
Other surfaces (sessions, episodes, etc.) ride HTTP via PalaceClient.
License
PolyForm Noncommercial 1.0.0 — see LICENSE.md.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mypalace_client-0.7.1.tar.gz.
File metadata
- Download URL: mypalace_client-0.7.1.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d36173c8c4f5005571d7a9269585f4989f8f5fdc0f07f3d3c5deef4eb2f04fc5
|
|
| MD5 |
4878f4d3df462b251cc03290974307c5
|
|
| BLAKE2b-256 |
b1588f1329df52e1e357c7ad8501faa657ed31ea53773820c83163c50aac15e3
|
Provenance
The following attestation bundles were made for mypalace_client-0.7.1.tar.gz:
Publisher:
release.yml on BangRocket/MyPalace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mypalace_client-0.7.1.tar.gz -
Subject digest:
d36173c8c4f5005571d7a9269585f4989f8f5fdc0f07f3d3c5deef4eb2f04fc5 - Sigstore transparency entry: 1438354959
- Sigstore integration time:
-
Permalink:
BangRocket/MyPalace@66700c12820a156d4d9da6fab354849fc79e2727 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/BangRocket
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@66700c12820a156d4d9da6fab354849fc79e2727 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mypalace_client-0.7.1-py3-none-any.whl.
File metadata
- Download URL: mypalace_client-0.7.1-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0befa48c18cf289e86cb604762f3667c7d0497cfc1724a9b2b589979a86802b
|
|
| MD5 |
5c2d326a6209ced27533de7d2e894c37
|
|
| BLAKE2b-256 |
cdf3f3d3ee00ce0802b3a64d63e77b40de15581cf697854cfe72799322cedaeb
|
Provenance
The following attestation bundles were made for mypalace_client-0.7.1-py3-none-any.whl:
Publisher:
release.yml on BangRocket/MyPalace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mypalace_client-0.7.1-py3-none-any.whl -
Subject digest:
b0befa48c18cf289e86cb604762f3667c7d0497cfc1724a9b2b589979a86802b - Sigstore transparency entry: 1438355178
- Sigstore integration time:
-
Permalink:
BangRocket/MyPalace@66700c12820a156d4d9da6fab354849fc79e2727 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/BangRocket
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@66700c12820a156d4d9da6fab354849fc79e2727 -
Trigger Event:
push
-
Statement type: