Skip to main content

Mirix Client - Lightweight Python client for Mirix server

Project description

Mirix Logo

Mirix Client

Lightweight Python client for interacting with a running Mirix server.


Install

pip install mirix-client

Quick Start

  1. Ensure you have a Mirix server running and an API key.
  2. Set your API key as an environment variable:
export MIRIX_API_KEY=your-api-key
  1. Use the client:
from mirix import MirixClient

client = MirixClient(
    api_key="your-api-key",
)

client.initialize_meta_agent(
    config={
        "llm_config": {
            "model": "gpt-4o-mini",
            "model_endpoint_type": "openai",
            "model_endpoint": "https://api.openai.com/v1",
            "context_window": 128000,
        },
        "build_embeddings_for_memory": True,
        "embedding_config": {
            "embedding_model": "text-embedding-3-small",
            "embedding_endpoint": "https://api.openai.com/v1",
            "embedding_endpoint_type": "openai",
            "embedding_dim": 1536,
        },
        "meta_agent_config": {
            "agents": [
                "core_memory_agent",
                "resource_memory_agent",
                "semantic_memory_agent",
                "episodic_memory_agent",
                "procedural_memory_agent",
                "knowledge_memory_agent",
                "reflexion_agent",
                "background_agent",
            ],
            "memory": {
                "core": [
                    {"label": "human", "value": ""},
                    {"label": "persona", "value": "I am a helpful assistant."},
                ],
                "decay": {
                    "fade_after_days": 30,
                    "expire_after_days": 90,
                },
            },
        },
    }
)

client.add(
    user_id="demo-user",
    messages=[
        {"role": "user", "content": [{"type": "text", "text": "The moon now has a president."}]},
        {"role": "assistant", "content": [{"type": "text", "text": "Noted."}]},
    ],
)

memories = client.retrieve_with_conversation(
    user_id="demo-user",
    messages=[
        {"role": "user", "content": [{"type": "text", "text": "What did we discuss on MirixDB in last 4 days?"}]},
    ],
    limit=5,
)
print(memories)

For more examples, see samples/run_client.py.

License

Mirix is released under the Apache License 2.0. See the LICENSE file for more details.

Contact

For questions, suggestions, or issues, please open an issue on the GitHub repository or contact us at founders@mirix.io.

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

mirix-0.1.6.post1.tar.gz (83.9 kB view details)

Uploaded Source

Built Distribution

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

mirix-0.1.6.post1-py3-none-any.whl (106.1 kB view details)

Uploaded Python 3

File details

Details for the file mirix-0.1.6.post1.tar.gz.

File metadata

  • Download URL: mirix-0.1.6.post1.tar.gz
  • Upload date:
  • Size: 83.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for mirix-0.1.6.post1.tar.gz
Algorithm Hash digest
SHA256 107c0d9ef9b48e701a6d059b904048a16d29bbffbee0a0f1024c8fcd563c4334
MD5 e195a79cc5dac86977757335a48eef66
BLAKE2b-256 0c06eaf6c8d9f88c0f5d0cb330945c3f51db1daeb20e051d49e5333880e30345

See more details on using hashes here.

File details

Details for the file mirix-0.1.6.post1-py3-none-any.whl.

File metadata

  • Download URL: mirix-0.1.6.post1-py3-none-any.whl
  • Upload date:
  • Size: 106.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for mirix-0.1.6.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 af97b52794e4475ca863c012a9fa19b06c3ac191ee070920430f1e777c7a244e
MD5 8318e6d3bc2b58f12620c458bc4ed68f
BLAKE2b-256 9c5ce253a40c1c91df59aa3760a281e6388517338e06adc8fa9712cb693de11c

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