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.2.0.tar.gz (4.5 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.2.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for memoid-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eba5cb19fc6c9c1199a1af33db7c6ba77c45035af500a045bfe3e9c5a4a48e87
MD5 7798becb28157f5d091f8c00e8912a52
BLAKE2b-256 2b2ef36a91d2adf53a12e79c30523c4fd13d71a08ccdc742479ef60588b89b2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: memoid-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfcd93d159b8158c00a77d4c355e8293574da5ba74db928a793babbe86ea6533
MD5 b2ad882e2538da72f017c3afea3168b2
BLAKE2b-256 86fc348c4084dcd77a4897660292d56759fe1aeb49630a6544c7df83e4832190

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