Skip to main content

woolly-ai

Python client for the local memory API of Woolly, project memory for coding agents that knows when a fact goes stale.

Use it to give the agents you build memory that stays on your computer. Save preferences, decisions and episodes, search them, and rate what helped.

Install

pip install woolly-ai

You also need Woolly running on the same computer:

curl -fsSL https://usewoolly.com/install.sh | sh
woolly serve

Use it

import woolly

woolly.remember("Moved to Denver in October", key="user.location")
woolly.remember("I prefer short answers")

for m in woolly.recall("where do I live?"):
    print(m.content)

Add memory to any AI app

woolly.context() returns a short note of relevant memories, ready to add to a prompt:

import woolly
from openai import OpenAI

client = OpenAI()
question = "Any good hikes near me this weekend?"

response = client.chat.completions.create(
    model="gpt-4.1-mini",
    messages=[
        {"role": "system", "content": "You are a helpful assistant.\n\n" + woolly.context(question)},
        {"role": "user", "content": question},
    ],
)

It works the same with Anthropic, Ollama or any other model.

Memory for the agents you build

The same API as mem0, on your own machine. add turns a conversation into memories for one user, and a local model decides whether each fact is new, updates an older one, or is no longer true. search finds them before your agent answers.

woolly.add(
    [
        {"role": "user", "content": "I just moved to Austin"},
        {"role": "assistant", "content": "Nice!"},
    ],
    user_id="alice",
)
# {"results": [{"memory": "Lives in Austin", "event": "UPDATE", "previous_memory": "Lives in Denver", ...}]}

memories = woolly.search("where does she live?", user_id="alice")["results"]

Scope with user_id, agent_id, run_id or project. Also get_all, history (every version of a memory), delete_all, link (recall one memory, get a related one too), feedback (say whether a memory helped), scoped_conflicts and resolve_scoped, and dream, which merges duplicates and settles facts that changed. Pass infer=False to add to save messages as they are, without a model, and memory_type="procedure" (or preference, episode) to say what kind they are; search and recall take type=[...]. See Memory API for agents.

More

from woolly import Woolly

w = Woolly()                      # finds the server and token automatically
r = w.remember("Prefers spaces", key="code.indent", source="agent")
if r.saved_as_conflict:           # it disagrees with something the user said
    print("Needs review:", r.conflicts_with.content)

w.profile().markdown              # a summary of everything known
w.forget(memory_id)               # moves it to the trash
w.restore(memory_id)              # brings it back

Woolly refuses passwords, API keys and instruction-like text that doesn't come from the user. Those calls raise woolly.WoollyError.

Docs: usewoolly.com/docs/python

Metadata

Release files for woolly-ai 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for woolly-ai 0.6.1
File Size Uploaded Provenance Actions
woolly_ai-0.6.1.tar.gz 11.5 kB Without provenance Details for woolly_ai-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for woolly-ai 0.6.1
File Interpreter ABI Platform Actions
woolly_ai-0.6.1-py3-none-any.whl Python 3 none any Details for woolly_ai-0.6.1-py3-none-any.whl

Total release size: 21.3 kB

Release files / woolly_ai-0.6.1.tar.gz

Download URL woolly_ai-0.6.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dd1cbc4d816842bef33c102309006aebe9eaecb0db4dd52d841010fc6e9f6a76
BLAKE2b-256 checksum
How to use checksums
f925019021742a0c900859eebde39f89137026597035ef751f97903717923363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / woolly_ai-0.6.1-py3-none-any.whl

Download URL woolly_ai-0.6.1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1f2568c1a99c2d744bb8b3c5486b3584b1f7bdeb6570309611d2cc949da9395
BLAKE2b-256 checksum
How to use checksums
0ca5376046f0639375259e03b0796af3f4c00153572b7a7aa0532871d98cb28e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for woolly-ai 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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