Smarter Connection
Overview
A Connection is a Smarter resource type that defines and stores the credentials and configuration needed to access an external system on which an AI application depends — most commonly a relational database or a REST API. Like every Smarter resource, a Connection is declared through a manifest conforming to the Smarter Application Manifest (SAM) specification, with apiVersion, kind, metadata, and spec sections. The spec captures the connection details required to establish a session with the target system: engine/driver, network location, authentication credentials, and pooling or timeout behavior, depending on the connection type. Once applied, a Connection exists as a named, reusable resource that other resources in the platform — such as Plugins or data-driven applications — can reference by name to read from or write to that backend, without needing to redeclare connection details in every dependent resource.
Connections exist to separate how to reach a system from what to do with it once connected. This separation keeps credentials centralized and governed in one place, allows a single underlying system to be shared across multiple applications or environments through a simple name reference, and lets connection details change independently of the resources that depend on them. Because a Connection is a first-class SAM resource, it follows the same lifecycle as every other resource type in the platform — apply, get, describe, delete — so database and service connectivity can be managed declaratively, version-controlled, and audited alongside the rest of an AI application’s configuration, rather than handled as out-of-band infrastructure setup.
Connection Types
API Connection: Connect to REST APIs.
SQL Connection: Connect to SQL databases.
Example Manifest
apiVersion: smarter.sh/v1
kind: SqlConnection
metadata:
description: Sql database connection pwd for smarter_test_db at sql.lawrencemcdaniel.com:3306
name: smarter_test_db
tags:
- test
- sample
- smarter
annotations:
- smarter.sh/smarter-test-db/owner: smarter-test-user
- smarter.sh/smarter-test-db/creator: QA Team
- smarter.sh/smarter-test-db/purpose: unit testing
- smarter.sh/smarter-test-db/release-date: 2024-06-15
- smarter.sh/smarter-test-db/backward-compatibility: true
version: 0.1.0
spec:
connection:
authenticationMethod: tcpip
database: smarter_test_db
dbEngine: django.db.backends.mysql
username: smarter_test_user
hostname: sql.lawrencemcdaniel.com
maxOverflow: 10
password: smarter_test_user
poolSize: 5
port: 3306
timeout: 30
useSsl: false