Skip to main content
Pre-release

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.
  • FraiseClient defaults to a 30s request timeout (timeout= on the constructor or on individual query/remember/recall calls overrides it); a request that exceeds it raises FraiseError naming the timeout, distinct from the error raised when the server can't be reached at all.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fraise_sdk-0.1.0rc1.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fraise_sdk-0.1.0rc1-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file fraise_sdk-0.1.0rc1.tar.gz.

File metadata

  • Download URL: fraise_sdk-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for fraise_sdk-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 073a2442db4326f8afaf08f50485ba2a419bc227306af98ebf37228090b92dae
MD5 c6290e4e2a4d7f4621e000e85f8da3fa
BLAKE2b-256 1c451e942f7c8f46a6ae1c7dd45ccce4145e6f577d84f896b039fbe511168fd5

See more details on using hashes here.

File details

Details for the file fraise_sdk-0.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: fraise_sdk-0.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for fraise_sdk-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcfbbfe27f572e15bbfb9ff13706620a83bfcf237aded33b38f186d197cd4caf
MD5 798c73866d07d4f2d7648b2b5af37a3a
BLAKE2b-256 144baafb5d7bdf58667244863574bc4549d7e94761606e56eeada7cad1307355

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0rc1 This release

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page