A project to integrate together Agent Development Kit (ADK) with MongoDB session management as backend storage.
Project description
MongoDB Session Service for Google ADK (Agent Development Kit)
A session management library for the Google ADK framework that uses MongoDB as a backend.
This package provides a MongodbSessionService that implements the google.adk.sessions.base_session_service.BaseSessionService abstract base class. It allows you to store and manage session state in a MongoDB database, fully replicating the three-tiered state management (app, user, and session) found in the core ADK session services.
Installation
You can install the package from PyPI:
pip install adk-mongodb-session
Usage
First, instantiate the MongodbSessionService with your MongoDB connection details.
import asyncio
from adk_mongodb_session.mongodb.sessions import MongodbSessionService
# Initialize the service
session_service = MongodbSessionService(
db_url="mongodb://localhost:27017/",
database="my_adk_agent_db",
collection_prefix="sessions" # This will create sessions_sessions, sessions_app_states, etc.
)
# ... and then use it in your async context
example_session = await session_service.create_session(
app_name="my_app",
user_id="example_user",
state={"initial_key": "initial_value"} # State can be initialized
)
Running Tests
For development, clone the repository and install it in editable mode with the testing dependencies:
git clone https://github.com/your-username/adk-mongodb-session.git
cd adk-mongodb-session
pip install -e ".[test]"
Then, run the tests using unittest:
python -m unittest discover tests
Contributing
Contributions are welcome! Please see the CONTRIBUTING.md file for details on how to report bugs, suggest enhancements, and submit pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file adk_mongodb_session-1.0.8.tar.gz.
File metadata
- Download URL: adk_mongodb_session-1.0.8.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f551b21579b73fca34337b5d53773b38bf7892699a23ba1fa33e5a8656a859e
|
|
| MD5 |
75025b2463cf1de6240239fc0bf01958
|
|
| BLAKE2b-256 |
2c3c19574a3df9ca608deed8a997335f66fc95224911937dee6f46fc1709868b
|
Provenance
The following attestation bundles were made for adk_mongodb_session-1.0.8.tar.gz:
Publisher:
publish-to-pypi.yml on SergeySetti/adk-mongodb-session
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adk_mongodb_session-1.0.8.tar.gz -
Subject digest:
6f551b21579b73fca34337b5d53773b38bf7892699a23ba1fa33e5a8656a859e - Sigstore transparency entry: 600994867
- Sigstore integration time:
-
Permalink:
SergeySetti/adk-mongodb-session@1e619c3e24a0bde32ab49accd2196a33e3a7eb8a -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/SergeySetti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1e619c3e24a0bde32ab49accd2196a33e3a7eb8a -
Trigger Event:
release
-
Statement type:
File details
Details for the file adk_mongodb_session-1.0.8-py3-none-any.whl.
File metadata
- Download URL: adk_mongodb_session-1.0.8-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19ee9630be8f795a7240c3803a56cc6276444b065c67dfb0c8b89dbdfed5278a
|
|
| MD5 |
0a3af41f0c895020a1e0e5f55d92cefc
|
|
| BLAKE2b-256 |
f01f71d6a3b39188ed992655fc64b6655090cfd8d5a10becbd289d4e255f9a88
|
Provenance
The following attestation bundles were made for adk_mongodb_session-1.0.8-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on SergeySetti/adk-mongodb-session
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adk_mongodb_session-1.0.8-py3-none-any.whl -
Subject digest:
19ee9630be8f795a7240c3803a56cc6276444b065c67dfb0c8b89dbdfed5278a - Sigstore transparency entry: 600994868
- Sigstore integration time:
-
Permalink:
SergeySetti/adk-mongodb-session@1e619c3e24a0bde32ab49accd2196a33e3a7eb8a -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/SergeySetti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1e619c3e24a0bde32ab49accd2196a33e3a7eb8a -
Trigger Event:
release
-
Statement type: