Skip to main content

MongoDB Session Store extension for Agent Kernel

Project description

AgentKernel MongoDB Session Store

agentkernel-mongo is an extension package for the agentkernel framework. It provides a persistent, scalable, and production-ready session store using MongoDB as the backend.

When installed, this package automatically registers itself with the agentkernel framework, allowing you to switch session storage from the default in_memory or redis to mongodb with a simple configuration change.

This package uses MongoDB's native TTL (Time-To-Live) indexing feature to automatically purge stale sessions, ensuring your database remains clean and efficient.

Installation

  1. As a pip extra:
pip install agentkernel[mongo]
  1. As a standalone package (if you already have agentkernel installed):
pip install agentkernel-mongo

This will automatically install the package and its required dependencies, pymongo.

Configuration

This package is designed to work seamlessly with agentkernel's configuration system.

Once installed, you can enable the MongoDB session store by modifying your config.yaml (or equivalent configuration file) for your agentkernel application.

Example config.yaml

# ... other agentkernel configurations ...

session:
  # 1. Set the type to 'mongo'
  type: mongo

  # 2. Add the 'mongo' configuration block
  mongo:
    url: "mongodb://localhost:27017/"
    database: "agent_sessions"
    collection: "sessions"
    ttl: 604800 # Session TTL in seconds (default: 7 days)

# ... other configurations ...

License

This package is licensed under the 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

agentkernel_mongo-0.2.2.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

agentkernel_mongo-0.2.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file agentkernel_mongo-0.2.2.tar.gz.

File metadata

  • Download URL: agentkernel_mongo-0.2.2.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for agentkernel_mongo-0.2.2.tar.gz
Algorithm Hash digest
SHA256 90c52fe5f324c6ea6049886d964248e70f4115d3220b5eb0eb87987774a7a27f
MD5 1bccc90c2a95e3b0422786b7acd5755e
BLAKE2b-256 3dd30e99b8e5752f16e180b52ceaed601223916898232ed0bbbb8451f572802c

See more details on using hashes here.

File details

Details for the file agentkernel_mongo-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for agentkernel_mongo-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1205f4828f39080ea6f53d9c4988f7c520a0ee0023f3f5f5b2d8c719d7f3bf9b
MD5 920fb057c05e12d9de0f54b68afccffc
BLAKE2b-256 bcc4ddf8ac852c17bd9a6e4fa2421e55f22489d62d403fec3ccc157ae8969761

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