Skip to main content

Python SDK for Strata — persistent memory for AI agents

Project description

strata-memory

Python SDK for Strata — persistent memory for AI agents.

Works locally (no API keys) or remotely via HTTP. Drop-in alternative to Mem0.

Quickstart

pip install strata-memory
from strata import StrataClient

s = StrataClient()

# Store a memory
mem = s.add("Use React Server Components for data fetching", type="decision")

# Search
results = s.search("data fetching patterns", limit=5)
for r in results:
    print(f"[{r.score:.2f}] {r.text[:80]}")

# Update
s.update(mem.id, summary="Prefer RSC for data fetching; useEffect for client-side only")

# Delete
s.delete(mem.id)

Async

from strata import AsyncStrataClient

async with AsyncStrataClient() as s:
    results = await s.search("auth patterns")

Remote Server

s = StrataClient(url="https://your-strata-server.run.app/mcp", token="your-token")

Or via environment variables:

export STRATA_URL=https://your-strata-server.run.app/mcp
export STRATA_TOKEN=your-token
s = StrataClient.from_env()

Strata-Specific Features

Beyond Mem0's CRUD, Strata provides:

# Ingest a full conversation
result = s.ingest(
    messages=[
        {"role": "user", "text": "Fix the CORS error"},
        {"role": "assistant", "text": "Added proxy config to vite.config.ts"},
    ],
    agent="my-agent",
    project="web-app",
)

# Find solutions to errors
solutions = s.find_solutions("CORS error in fetch")

# Discover patterns
patterns = s.find_patterns("deployment issues")

# Find procedures
procedures = s.find_procedures("deploy to Cloud Run")

# Search entities
entities = s.search_entities("React", type="library")

# Store a procedure
s.store_procedure("Deploy to GCR", ["Build image", "Push", "Deploy"])

# Project context
ctx = s.get_project_context("web-app")
projects = s.list_projects()

Framework Integrations

LangChain

pip install strata-memory[langchain]
from strata import StrataClient
from strata.integrations.langchain import StrataRetriever

s = StrataClient()
retriever = StrataRetriever(client=s, search_kwargs={"limit": 5})

# Use with RetrievalQA, ConversationalRetrievalChain, etc.
docs = retriever.invoke("How did we fix auth last time?")

CrewAI

pip install strata-memory[crewai]
from strata import StrataClient
from strata.integrations.crewai import StrataCrewMemory

s = StrataClient()
memory = StrataCrewMemory(client=s, project="research-crew")

memory.store("React 19 uses compiler optimizations")
results = memory.search("React optimizations")

LlamaIndex

pip install strata-memory[llamaindex]
from strata import StrataClient
from strata.integrations.llamaindex import StrataMemoryStore

s = StrataClient()
store = StrataMemoryStore(client=s, project="my-index")

store.put("Server Components handle data fetching server-side")
results = store.query("data fetching")

Migration from Mem0

# Before (Mem0)
from mem0 import Memory
m = Memory()
m.add("User prefers dark mode", user_id="alice")
results = m.search("preferences", user_id="alice")

# After (Strata)
from strata import StrataClient
s = StrataClient()
s.add("User prefers dark mode", user="alice")        # user_id= also works
results = s.search("preferences", user="alice")
Mem0 Strata Notes
Memory() StrataClient() Local subprocess, no API keys
user_id= user= Both accepted (alias)
Requires OPENAI_API_KEY No API key needed Pro features need license
Cloud only for teams Local + cloud Team features via license

Local Model Distillation

Fine-tune a private model from your own coding sessions. Requires a GPU.

pip install strata-memory[distill]

# Check readiness
strata-distill status --db ~/.strata/strata.db

# Fine-tune (requires GPU + ~1,000 training pairs)
strata-distill start --task extraction

# Evaluate
strata-distill eval --model strata-extraction-7b

# Export GGUF
strata-distill export --output ./my-model.gguf

See the distillation spec for full documentation.

Requirements

  • Python 3.10+
  • Node.js (for local strata-mcp subprocess) — not needed for HTTP transport

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

strata_memory-0.1.0.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

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

strata_memory-0.1.0-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file strata_memory-0.1.0.tar.gz.

File metadata

  • Download URL: strata_memory-0.1.0.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for strata_memory-0.1.0.tar.gz
Algorithm Hash digest
SHA256 381525a69ab1153b802216ab9eb4b96eca31bb0dfb87d26fbc29c36d6c18b611
MD5 5a2bcc3921e8c556a48320e56f4b72ea
BLAKE2b-256 235100766d540b4e7de506cfd44aafdf117632eae147333778f6ba74c284194c

See more details on using hashes here.

Provenance

The following attestation bundles were made for strata_memory-0.1.0.tar.gz:

Publisher: release.yml on kytheros/strata-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file strata_memory-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: strata_memory-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for strata_memory-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e476e24d3e584a27347ba7afff1b46f3de4c4c832a321283c319dccbebbd9da
MD5 e4b90a292125a593189c117a5c88405f
BLAKE2b-256 f2b092a14c78a3a878b20334340ec2992eba3500d89288d9670e4b8197227db4

See more details on using hashes here.

Provenance

The following attestation bundles were made for strata_memory-0.1.0-py3-none-any.whl:

Publisher: release.yml on kytheros/strata-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page