Skip to main content

Python SDK for Memoid - AI Memory Layer

Project description

Memoid Python SDK

Python SDK for Memoid - AI Memory Layer for intelligent applications.

Installation

pip install memoid

Quick Start

from memoid import MemoryClient

client = MemoryClient("your-api-key")

# Add memory from conversation
memories = client.add(
    messages=[
        {"role": "user", "content": "I'm vegetarian and love Italian food"},
        {"role": "assistant", "content": "Great! I'll remember that."}
    ],
    user_id="user_123"
)

# Search memories
results = client.search(
    query="What dietary restrictions does the user have?",
    user_id="user_123"
)

for result in results:
    print(f"{result.memory} (score: {result.score})")

Async Support

from memoid import AsyncMemoryClient

async with AsyncMemoryClient("your-api-key") as client:
    memories = await client.add(
        messages=[{"role": "user", "content": "My favorite color is blue"}],
        user_id="user_123"
    )

    results = await client.search(query="favorite color", user_id="user_123")

API Reference

MemoryClient

add(messages, user_id=None, agent_id=None, metadata=None)

Add memories from a conversation.

get(memory_id)

Get a specific memory by ID.

get_all(user_id=None, agent_id=None, limit=100, offset=0)

Get all memories with optional filtering.

search(query, user_id=None, agent_id=None, limit=10)

Search memories using natural language.

update(memory_id, memory, metadata=None)

Update a memory.

delete(memory_id)

Delete a memory.

delete_all(user_id=None, agent_id=None)

Delete all memories with optional filtering.

get_graph(user_id=None, agent_id=None)

Get the knowledge graph.

License

MIT

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

memoid-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

memoid-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: memoid-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for memoid-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1d8cb62dba058849f34f683a5400b9587ca733c86a7e3645a9426032a7ce3de5
MD5 748edf3efd4390cf3a817525c7dd25e9
BLAKE2b-256 e0cf6289b222437b469bd6f20f01765d42674259a0a05738b1b20fd72bf57b8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: memoid-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for memoid-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b357be0522b930b48310637a4c88fc5d3115f2bbc2ebe8f871228a8a544485aa
MD5 a3794ef6fa0e2a6b1b3b43b367a5ef60
BLAKE2b-256 edbbdc121c3b3d6aac5bff29be692d8efd546ed75f0737644090c9840f435164

See more details on using hashes here.

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