One call to connect

Pull data from 8 sources with db.connect(). Every connector returns a standard ConnectorResult. Credentials can be encrypted and persisted with save=True.

8 connectors
3 types
1 line to connect

How It Works

# Connect, fetch, ingest — one pattern for everything
conn = db.connect("slack", token="xoxb-...", save=True)
result = conn.run(db)
print(f"Ingested {result.claims_ingested} claims")

Chat connectors (Slack, Teams) call db.ingest_chat() — messages are grouped by channel.
Text connectors (Gmail, Google Docs, Notion, Confluence) call db.ingest_text() — each document is extracted as claims.
SQL connectors (PostgreSQL, MySQL) run a query and map columns to claim fields — each row becomes one claim.

All Connectors

Slack

Chat

Live Slack channels via Bot Token (not an export). Requires requests.

conn = db.connect("slack",
    token="xoxb-...",
    channels=["general", "engineering"],
    extraction="heuristic",
)
result = conn.run(db)
ParamRequiredDescription
tokenYesSlack Bot Token (xoxb-...)
channelsNoList of channel names to fetch (default: all)
extractionNoheuristic, smart, or llm (default: heuristic)

Teams

Chat

Microsoft Teams channels via Graph API. Requires requests and an Azure AD app token.

conn = db.connect("teams",
    token=os.environ["TEAMS_ACCESS_TOKEN"],
    team_id="...",
    channels=["general"],
    extraction="heuristic",
)
result = conn.run(db)
ParamRequiredDescription
tokenYesAzure AD access token with ChannelMessage.Read.All
team_idYesMicrosoft Teams team ID
channelsNoList of channel names to fetch (default: all)
extractionNoheuristic, smart, or llm (default: heuristic)

Gmail

Text

Fetch recent email threads via Gmail API. Requires requests.

conn = db.connect("gmail",
    token="ya29.a0...",
    labels=["INBOX"],
    max_results=50,
)
result = conn.run(db)
ParamRequiredDescription
tokenYesGoogle OAuth2 access token
labelsNoGmail labels to filter (default: INBOX)
max_resultsNoMax threads to fetch (default: 50)

Google Docs

Text

Fetch documents by ID via Google Docs API. Requires requests.

conn = db.connect("gdocs",
    token="ya29.a0...",
    document_ids=["1BxiMVs0...", "1CyiNWt1..."],
)
result = conn.run(db)
ParamRequiredDescription
tokenYesGoogle OAuth2 access token
document_idsYesList of Google Docs document IDs

Notion

Text

Fetch pages from a Notion database. Requires requests.

conn = db.connect("notion",
    token="ntn_...",
    database_id="abc123...",
)
result = conn.run(db)
ParamRequiredDescription
tokenYesNotion integration token
database_idYesNotion database ID to query

Confluence

Text

Fetch pages from a Confluence space. Requires requests.

conn = db.connect("confluence",
    url="https://your-org.atlassian.net",
    token="ATATT3x...",
    space_key="ENG",
)
result = conn.run(db)
ParamRequiredDescription
urlYesConfluence base URL
tokenYesAtlassian API token
space_keyYesConfluence space key (e.g. ENG)

PostgreSQL

SQL

Query a Postgres database and map rows to claims. Requires psycopg2-binary.

conn = db.connect("postgres",
    dsn="postgresql://user:pass@host/db",
    query="SELECT gene, relation, target FROM interactions",
    mapping={"subject": "gene", "predicate": "relation", "object": "target"},
)
result = conn.run(db)
ParamRequiredDescription
dsnYesPostgreSQL connection string
queryYesSQL query to execute
mappingYesColumn-to-claim mapping (subject, predicate, object)

MySQL

SQL

Query a MySQL database and map rows to claims. Requires pymysql.

conn = db.connect("mysql",
    dsn="mysql://user:pass@host/db",
    query="SELECT src, rel, dst FROM edges",
    mapping={"subject": "src", "predicate": "rel", "object": "dst"},
)
result = conn.run(db)
ParamRequiredDescription
dsnYesMySQL connection string
queryYesSQL query to execute
mappingYesColumn-to-claim mapping (subject, predicate, object)
No connectors match your search.

Token Store

Pass save=True to any db.connect() call to encrypt and persist the token alongside your database file. Next time, connect without passing the token:

# First time — save encrypted
conn = db.connect("slack", token="xoxb-...", save=True)

# Next time — token loaded automatically
conn = db.connect("slack")

Tokens are encrypted with Fernet (AES-128-CBC) and stored at {db_path}.tokens. Requires the optional cryptography package (pip install cryptography).

Optional Dependencies

ConnectorPackageInstall
Slack, Teams, Gmail, Google Docs, Notion, Confluencerequestspip install requests
PostgreSQLpsycopg2-binarypip install psycopg2-binary
MySQLpymysqlpip install pymysql
Token Store (encrypted)cryptographypip install cryptography