Digital Employee Core
A Python library for building and managing AI-powered digital employees with support for tools, MCPs (Model Context Protocol), and flexible configuration management.
Documentation
For comprehensive developer documentation and guides, please refer to the Digital Employee Developer Documentation on GitBook.
Prerequisites
IDE Recommendation
We recommend using one of the following IDEs for developing with this library:
Option 1: PyCharm
- Professional Python IDE with comprehensive features
- Download: https://www.jetbrains.com/pycharm/
- Editions: Professional (paid) or Community (free)
Option 2: Visual Studio Code (and its forks)
- Lightweight, extensible editor with Python support
- VSCode: https://code.visualstudio.com/
- Cursor (AI-powered fork): https://www.cursor.com/
- Windsurf (AI-enhanced fork): https://codeium.com/windsurf
- Install the Python extension for full Python support
Python Installation
This project supports Python 3.12 and 3.13.
Installation Instructions:
-
Linux/WSL:
# Ubuntu/Debian sudo apt update sudo apt install python3.12 python3.12-venv python3.12-dev # Fedora sudo dnf install python3.12
-
macOS:
# Using Homebrew brew install python@3.12
-
Windows:
- Download from python.org
- Or use pyenv-win for version management
Package Manager (uv)
This project uses uv as its package manager for fast and reliable dependency management.
Installation Instructions:
-
Linux/macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
-
Windows (PowerShell):
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Alternative (using pip):
pip install uv
-
Verify Installation:
uv --version
For more information about uv, visit: https://docs.astral.sh/uv/
Setup
Automated Setup (Recommended)
For a complete automated setup that installs all prerequisites and configures the project, run:
./setup.sh
This script will:
- Detect your operating system
- Install Python 3.12 (if not already installed)
- Install uv package manager (if not already installed)
- Check/install gcloud CLI (optional, for private packages)
- Install project dependencies via
make install - Create a
.envfile template
Note: The script may require sudo privileges for installing system packages. After running the script, edit the .env file with your API credentials (see below).
Manual Setup
Alternatively, you can set up the project manually:
1. Install Dependencies
make install
2. Configure Environment
Copy the example environment file and add your credentials:
cp .env.example .env
Edit .env with your configuration:
# Required
AIP_API_URL=https://your-ai-platform-url.com
AIP_API_KEY=your-api-key
How to Obtain API Credentials:
To get the AIP_API_URL and AIP_API_KEY values, contact Squad 4 (Claudia) team:
- Email:
koi-claudia@gdplabs.id
Tool-Specific Requirements
E2B Sandbox Tool
This tool requires an api_key parameter to be provided. You can either:
- Pass the API key directly as a parameter when using the tool, or
- Set the
E2B_API_KEYenvironment variable (the tool will use this automatically if no parameter is provided)
Configuration Management
Understanding MCP Configuration Placeholders
The library uses YAML configuration templates (digital_employee_core/config_templates/mcp_configs.yaml and tool_configs.yaml) that contain placeholder keys in dollar-brace format (e.g., ${GOOGLE_CALENDAR_MCP_URL}). These placeholders need to be replaced with actual values at runtime.
How Placeholders Work:
- Configuration Template (in
mcp_configs.yaml):
digital_employee_google_calendar_mcp:
config:
url: ${GOOGLE_CALENDAR_MCP_URL}
allowed_tools: ${GOOGLE_CALENDAR_MCP_ALLOWED_TOOLS:[]}
authentication:
type: api-key
key: X-API-Key
value: ${GOOGLE_MCP_X_API_KEY}
- Supply Values using
DigitalEmployeeConfiguration:
from digital_employee_core import DigitalEmployeeConfig
configurations = [
DigitalEmployeeConfig(
key="GOOGLE_CALENDAR_MCP_URL",
value="https://api.example.com/calendar/mcp"
),
DigitalEmployeeConfig(
key="GOOGLE_MCP_X_API_KEY",
value="your-secret-api-key"
),
]
- Pass to Digital Employee:
from digital_employee_core import DigitalEmployee
from digital_employee_core.connectors.mcps import google_calendar_mcp
de = DigitalEmployee(
identity=identity,
mcps=[google_calendar_mcp],
configs=configurations # Placeholder values will be replaced automatically
)
de.deploy()
Available Placeholder Keys
For a complete and up-to-date list of available placeholder keys, refer to the configuration template files:
- MCP Configurations:
digital_employee_core/config_templates/mcp_configs.yaml - Tool Configurations:
digital_employee_core/config_templates/tool_configs.yaml
Look for keys in the ${PLACEHOLDER_NAME} format within these files. Common categories include:
- Google MCPs: Calendar, Docs, Drive, Mail, Sheets (+ shared
GOOGLE_MCP_X_API_KEY) - GitHub MCP: URL and API key configurations
- SQL Tool MCP: Database connection and authentication settings
Configuration Priority
Configurations can be supplied in three ways:
- At Initialization (applied during
deploy()):
de = DigitalEmployee(
identity=identity,
mcps=[google_calendar_mcp],
configurations=configurations
)
- At Runtime (applied per
run()call):
response = de.run(
message="Check my calendar",
configurations=runtime_configurations
)
- Combined (initialization configs + runtime configs are merged):
# Initialization configs for persistent settings
de = DigitalEmployee(
identity=identity,
configurations=base_configurations
)
de.deploy()
# Runtime configs for per-request overrides
response = de.run(
message="Send email",
configurations=request_specific_configurations
)
GL Connectors
Mark an MCP as a GL Connector so GL Runner can offer a connection for it, then read the list from the Digital Employee instead of writing it by hand.
from digital_employee_core import as_gl_connector
from glaip_sdk import MCP
my_github = as_gl_connector(
MCP(name="my_github", transport="http", config={"url": "https://example.com/github/mcp"}),
name="github",
required=True,
)
# After building a Digital Employee that uses my_github
digital_employee.get_gl_connectors()
# [{"name": "github", "required": True}]
The MCP and the connector have separate names. my_github stays as the MCP's name, which agents use to reference it. name="github" is the connector name: the GL Connectors integration that GL Runner offers the user a connection for. Several MCPs can share one connector name, and get_gl_connectors() lists connector names, not MCP names.
as_gl_connector returns a copy, so the MCP you pass is unchanged. The marker is stored in MCP.metadata as {"gl_connector": {"name": "github", "required": True}}. Pass only required to change an MCP that is already marked.
get_gl_connectors() reads each pipeline step's agent, its sub-agents, and MCPs added by escalation. A connector used by several MCPs appears once, and it is required if any of them marks it so. Unmarked MCPs, MCPs referenced only by name, and custom pipeline steps without an agent are left out.
Marking changes nothing at run time. A marked MCP authenticates exactly as it did before.
Library MCPs such as google_mail_mcp carry no marker, so they are not listed. You can mark one by hand, but it keeps its static key, so GL Runner offers a connection that the run ignores.
Run Examples
Basic Example
uv run python examples/basic_example.py
Subclass Example
uv run python examples/subclass_example.py
Deploy to GL Runner
The optional gl-runner extra deploys an app to GL Runner as a digital_employee runnable:
pip install "digital-employee-core[gl-runner]"
from digital_employee_core.gl_runner import deploy_to_gl_runner
deploy_to_gl_runner(
key="my-app",
entrypoint=main, # module-level function in my_app/; deployed as "my_app/main.py:main"
digital_employee=digital_employee, # e.g. DigitalEmployeeBuilder()...build(); sends its identity, configs and GL Connectors
sandbox={"enabled": True, "timeout_seconds": 600}, # optional; run in a GL Runner sandbox
extra_packages=["my_app_core"], # optional; installed packages the worker lacks, shipped in the bundle
env={"MY_MODEL_API_KEY": os.environ["MY_MODEL_API_KEY"]}, # optional; read from context["config"]["env"]
smoke_message="Hello", # optional post-deploy run that must succeed
activation_timeout=960, # optional; seconds to wait for activation, e.g. while requirements.txt builds
)
To check what would be deployed first, pass dry_run=True. The bundle is staged in .local/bundle and
the existing configurations are read, but nothing is deployed. The returned runnable holds what a real deploy
would send, and its deploy() sends it:
runnable = deploy_to_gl_runner(key="my-app", entrypoint=main, digital_employee=digital_employee, dry_run=True)
print(runnable.entrypoint, runnable.bundle_path, sorted(runnable.config))
runnable.deploy() # when it looks right
runnable.config["configurations"] and runnable.config["env"] hold the existing values decrypted, so do
not print or log them. smoke_message, activation_timeout and activation_poll_interval cannot be combined
with dry_run; pass the activation options to runnable.deploy() instead.
- The app must use a flat layout: the package is a direct child of the app folder.
- The Digital Employee's
configsare sent as user-editable runtime configurations, every value encrypted (config_value(..., encrypted=True)). GL Runner returns them redacted, so users can replace a value but not read it back. Values must be JSON-serializable.gl_connectors_de_token,gl_connectors_user_tokenandgl_connectors_base_url(any case) are left out, since GL Runner supplies them on every run. - The runnable's connectors are the Digital Employee's
get_gl_connectors()(see GL Connectors). Each deploy replaces the runnable's connector list, so a connector the Digital Employee no longer uses is removed. - Every deploy enables GL Runner's run artifacts (
run_artifacts: {"enabled": true}) and external human-in-the-loop decisions (hitl: {"external": true}). Neither changes a run until the app uses it: it writes an artifact, or awaitscontext["__gl_hitl_wait"]. - On redeploy, configuration values already on the runnable (which users may have edited) are kept, and resent encrypted.
sandboxsets GL Runner'ssandboxblock (enabled, plus optionalbackendopensandbox/e2bandtimeout_seconds). GL Runner stops sandboxed runs after 30 seconds by default, so settimeout_secondsfor agent runs. Withsandbox=Nonea redeploy keeps the runnable's current block; pass{"enabled": False}to turn sandboxing off.smoke_messagetriggers one run after the deploy and raises unless it succeeds. The deploy waits 120 seconds for it, plus the sandbox'stimeout_secondswhen the sandbox is enabled, and raisesTimeoutErrorpast that. Only the run ID and status are logged, never the run result.- To install extra packages in the sandbox, ship a
requirements.txtin the app package, beside the entrypoint (my_app/requirements.txt). It is copied to the bundle root, where GL Runner reads it, validates each line and builds the packages into a sandbox template during the deploy (see GL Runner's Sandbox Custom Dependencies). That needs the sandbox enabled, given here or kept from the server; otherwise the deploy is refused. A first build can take up to 15 minutes, so raiseactivation_timeout(the gl-runner-sdk default is 120 seconds), e.g. to 960. Arequirements.txtin the app folder is not bundled. envsets GL Runner'sconfig.env, for values the entrypoint reads fromcontext["config"]["env"], such as a secret the app does not take as a config yet. Values must be strings and are sent encrypted. The env is owned by the deploy: a given env replaces the runnable's,{}clears it, and withenv=Nonea redeploy keeps the runnable's current env.extra_packageslists top-level import names of packages installed here but not on the GL Runner worker, such as a sibling*-corepackage installed from a local path. Each is copied from where it is installed into the bundle root, next to the app package. Their own dependencies are not copied.- Schedules are not managed by this function; existing schedules on the runnable are left as they are.
base_url/api_keydefault toGL_RUNNER_BASE_URL/GL_RUNNER_API_KEY.
Run Tests
# Run unit tests (excludes integration tests)
make test
# Run with verbose output
uv run pytest -v
# Run with coverage report
make coverage
# Run with coverage HTML report
make coverage FORMAT=html
# Open htmlcov/index.html in browser
# Run specific test file
uv run pytest tests/digital_employee/test_core.py
Metadata
Release files for digital-employee-core 0.1.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| digital_employee_core-0.1.19.tar.gz | 80.0 kB | Without provenance | Details for digital_employee_core-0.1.19.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| digital_employee_core-0.1.19-py3-none-any.whl | Python 3 | none | any | Details for digital_employee_core-0.1.19-py3-none-any.whl |
Total release size: 186.8 kB
Release files / digital_employee_core-0.1.19.tar.gz
| Download URL | digital_employee_core-0.1.19.tar.gz |
|---|---|
| Size | 80.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bf164b5c1726ae5695f810d89f262839f088160bad8e41662a4703567d60189
|
|
BLAKE2b-256 checksum How to use checksums |
8cce86689af7209fd26629d70f4ece0df7ffd8c41597dc9c5bdfbd60304b4741
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / digital_employee_core-0.1.19-py3-none-any.whl
| Download URL | digital_employee_core-0.1.19-py3-none-any.whl |
|---|---|
| Size | 106.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cdbd9ce0559bd2394ff3d25fbfceb7871b8a23f6b03f00123bee6e9fe4f9162d
|
|
BLAKE2b-256 checksum How to use checksums |
d5ac889f4680ec093067b0ff788b43290f8d0ee312cbe7f9959a2507001c0c3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for digital-employee-core 0.1.19
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.