This release is a pre-release and may not be stable for production use.
fraise-sdk (Python)
A Python client for a Fraise memory server, plus ready-made memory tools for agent frameworks.
Install
pip install fraise-sdk # core client only
pip install 'fraise-sdk[openai]' # + OpenAI Agents SDK tools
pip install 'fraise-sdk[anthropic]' # + Claude Agent SDK tools
Client
Two operations, both over the server's single query endpoint:
from fraise_sdk import FraiseClient
with FraiseClient("http://localhost:9876") as fraise:
fraise.remember("anne loves the color orange", topics=["color"], entities=["anne"])
result = fraise.recall("anne", "color", top=5)
for hit in result:
print(hit.value, hit.score)
recall returns a RecallResult (.count, .hits, and it iterates/len()s over the hits). Vector search is supported by passing an embedding:
fraise.remember("the kingfisher is electric blue", graph=6, vector=embedding)
hits = fraise.recall(graph=6, vector=embedding) # seeded only by the vector
A recall needs a seed, not a keyword: a vector or a topics/entities filter is one on its own, so fraise.recall(topics=["birds"]) — everything about a topic — is a query in its own right.
Anything the typed helpers do not cover is reachable through the raw fraise.query("recall@3 ...") escape hatch.
Some queries run but read like a near-miss of a different query — a recall whose first keyword is also a grammar keyword, e.g. fraise.recall("since", "7d"), one : away from a since:7d time filter. The server answers them and attaches a warning; the SDK lists it on result.warnings and re-emits it as a FraiseWarning:
import warnings
from fraise_sdk import FraiseWarning
warnings.filterwarnings("ignore", category=FraiseWarning) # silence wholesale
The query shapes that warn (and the neighbouring ones that stay silent) are catalogued in Warnings.
Embeddings (optional)
Give the client an embedder and it encodes text to a vector automatically — remember embeds its value, recall embeds its query phrase (or its keywords):
from fraise_sdk import FraiseClient
from fraise_sdk.providers import OpenAIEmbedder # needs fraise-sdk[openai]
fraise = FraiseClient("http://localhost:9876", embedder=OpenAIEmbedder(dimensions=128))
fraise.remember("the kingfisher is electric blue", graph=6) # stored with its vector
hits = fraise.recall("small bright bird", graph=6, query="small bright bird")
An embedder is anything implementing the Embedder ABC (subclass it and define embed(text) -> Sequence[float]) or a plain callable(text) -> Sequence[float], so a lambda over your own model works too. Per call you can force it with embed=True, skip it with embed=False, or override with an explicit vector=. Only OpenAI is provided today — Anthropic has no embeddings API.
OpenAI Agents tools
memory_tools(client) returns a recall and a remember FunctionTool bound to one memory graph, so the agent decides what to store and retrieve:
from agents import Agent, Runner
from fraise_sdk import FraiseClient
from fraise_sdk.integrations.openai_agents import memory_tools
fraise = FraiseClient("http://localhost:9876")
agent = Agent(
name="Assistant",
instructions="Remember durable facts the user shares, and recall them when relevant.",
tools=memory_tools(fraise),
)
result = Runner.run_sync(agent, "My favourite colour is orange. Remember that.")
print(result.final_output)
Pass an embedder — memory_tools(fraise, embedder=OpenAIEmbedder()) — to make the tools vectorise implicitly: recall and remember encode their text through it and carry the vector alongside.
See examples/openai-agents/ for a complete, Docker-runnable script.
Claude Agent SDK tools
The Claude Agent SDK groups tools into an in-process MCP server, so the entry point is memory_server(client); pair it with allowed_tools():
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient
from fraise_sdk import FraiseClient
from fraise_sdk.integrations.claude_agents import memory_server, allowed_tools
fraise = FraiseClient("http://localhost:9876")
options = ClaudeAgentOptions(
system_prompt="Remember durable facts the user shares, and recall them when relevant.",
mcp_servers={"fraise_memory": memory_server(fraise)},
allowed_tools=allowed_tools(),
)
memory_server(fraise, embedder=OpenAIEmbedder()) makes the tools vectorise implicitly, exactly as in the OpenAI integration.
See examples/claude-agent-sdk/ for a complete, Docker-runnable script.
Notes & limits
- A fact value is stored inside a single-quoted phrase where every character is literal; the SDK escapes apostrophes for you, so
remember("it's blue")stores the text exactly as written. - Keywords, topics, and entities are single whitespace-free tokens.
- The first vector written to a graph fixes that graph's embedding dimension; later writes to the same graph must match it.
FraiseClientdefaults to a 30s request timeout (timeout=on the constructor or on individualquery/remember/recallcalls overrides it); a request that exceeds it raisesFraiseErrornaming the timeout, distinct from the error raised when the server can't be reached at all.
Release files for fraise-sdk 0.1.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fraise_sdk-0.1.0rc2.tar.gz | 20.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fraise_sdk-0.1.0rc2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.6 kB
Release files / fraise_sdk-0.1.0rc2.tar.gz
| Download URL | fraise_sdk-0.1.0rc2.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
625a68ab6978a56e661d5e36014545f1ebf66dcb9aee4c36fef230f0bffbbd9e
|
|
BLAKE2b-256 checksum How to use checksums |
93d3f5e22b0c65a60afc7c4b4c73b2f60bee96fee7644fde0ae81f45522b2e92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fraise_sdk-0.1.0rc2-py3-none-any.whl
| Download URL | fraise_sdk-0.1.0rc2-py3-none-any.whl |
|---|---|
| Size | 35.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea70ce7d293e907fce295b53981f47a773593c8621b5f3df9a4ee1f53ac94a6f
|
|
BLAKE2b-256 checksum How to use checksums |
7fe19401eda51862abefd17cbf3a86b35141b37d8c86b6ec5324e8ff010c9c26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|