Skip to main content

Crypto.com Agent Plugin – SQLite

The Crypto.com Agent Plugin – SQLite adds support for persistent state storage using SQLite in the Crypto.com Agent Client ecosystem. This plugin allows conversational agents to store, retrieve, and manage session states efficiently using a lightweight, file-based database.

Features

SQLite Integration

  • Stores and retrieves agent conversation states using a local SQLite database.
  • Supports fast, lightweight persistence — no external DB required.
  • Automatically creates the database and schema if they don't exist.
  • Ensures thread-safe database access via check_same_thread=False.

Plugin Architecture

  • Packaged as a standalone Python plugin.

  • Implements the AgentPlugin storage interface with full support for:

    • save_state()
    • load_state()
    • delete_state()
    • list_keys()
  • Uses Python entry points and PEP 621 standards (pyproject.toml).

Easy to Install and Extend

  • Fully decoupled from the core Agent SDK.
  • Compatible with other plugins (e.g., Discord, LangFuse, CLI).
  • Automatically discovered and initialized by the SDK.

Installation

Install the plugin into your environment:

pip install cryptocom-agent-plugin-sqlite

Usage

Importing the Plugin

from crypto_com_agent_plugin_sqlite import SQLitePlugin

Using with the Agent SDK

from crypto_com_agent_client import Agent
from crypto_com_agent_plugin_sqlite import SQLitePlugin

sqlite_plugin = SQLitePlugin(db_path="agent_state.db")

agent = Agent.init(
    llm_config={...},
    blockchain_config={...},
    plugins={...},
    plugin_instances=[sqlite_plugin],
)

agent.start()

Plugin Lifecycle

This plugin defines:

  • mode = "support" — it does not control the event loop; multiple support plugins can run together.
  • save_state(state, key) — stores agent state for a specific session_id:thread_id.
  • load_state(key) — retrieves stored state by key.
  • delete_state(key) — removes stored state.
  • list_keys() — lists all session keys stored in the database.

Example

from crypto_com_agent_plugin_sqlite import SQLitePlugin

# Initialize storage
storage = SQLitePlugin(db_path="agent_state.db")

# Save a sample state
state = {
    "messages": [
        {"type": "HumanMessage", "content": "Hello!"}
    ]
}
storage.save_state(state, key="session1:thread1")

# Load the saved state
loaded = storage.load_state(key="session1:thread1")
print(loaded)

# List all saved keys
print(storage.list_keys())

# Delete the saved state
storage.delete_state("session1:thread1")

Entry Point Declaration

This plugin is auto-discoverable via pyproject.toml:

[tool.poetry.plugins."crypto_com_agent.plugins"]
sqlite = "crypto_com_agent_plugin_sqlite:SQLitePlugin"

This allows the Agent SDK to dynamically discover and initialize your plugin.

File Structure

crypto_com_agent_plugin_sqlite/
├── __init__.py
└── sqlite_plugin.py   # Main plugin implementation

Contributing

We welcome contributions! Please ensure your plugin:

  • Adheres to the AgentPlugin storage interface.
  • Includes proper type hints, docstrings, and unit tests.
  • Handles serialization and deserialization safely.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for cryptocom-agent-plugin-sqlite 1.0.4

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

Built distribution (wheel)

Table of built distributions (wheels) for cryptocom-agent-plugin-sqlite 1.0.4
File Interpreter ABI Platform
cryptocom_agent_plugin_sqlite-1.0.4-py3-none-any.whl Python 3 none any Details

Release files / cryptocom_agent_plugin_sqlite-1.0.4-py3-none-any.whl

Download URL cryptocom_agent_plugin_sqlite-1.0.4-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e8f18f70b42539a1ab5ea605ed800b8de6f45e0a570a4ced051d2ce59930d42
BLAKE2b-256 checksum
How to use checksums
40cd57371b1225f8cb828aa94b69c8aa257fff18f569f2689f20b07b4539ee2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for cryptocom-agent-plugin-sqlite 1.0.4

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