gmail_source() or slack_source(), that returns a dlt resource you pass straight to remember(). Every connector syncs the same way: the first run loads everything, later runs pick up only what changed, and items deleted in the app are forgotten. This page explains that shared mechanism once, then gives each connector’s setup, code and specifics in Connectors.
This page drives connectors from your own script, with credentials you hold. To let users connect their own accounts to a running Cognee server through OAuth instead, see Integrations: Gmail, Google Drive, Google Calendar, Dropbox, Linear, Notion and Slack also run that way.
Available Connectors
How a Connector Sync Works
1. Set Up Access to the App
Open your app’s section under Connectors and follow its Setup steps first. They cover what the connector needs before it can read anything: the install extra, if any, the account or app to create, the scopes or permissions to grant, and the credentials and environment variables the example script reads. Some apps need a few minutes of work in their own console, such as a Google Cloud OAuth client or a Slack app invited to the channel.2. Build the Source
resource_name, which names the staging table that holds dlt’s copy of the data and the sync state that makes later runs incremental. Keep it the same across runs, and use one per account and scope: two sources must never share one.
Nothing is fetched when you build a source. The connector reads the app only when remember() runs it.
3. Sync It With remember()
primary_key="id"keys each item by its id in the app (a message id, a file id, a note’s path).write_disposition="merge"upserts items by that key. Every connector’s resource declaresmerge, and leaving the argument out keeps it (on Cognee before 1.6.8, pass it explicitly). Never pass"replace": it keeps only what the latest run fetched, and an incremental run fetches only what changed, so the rest of the synced data would be lost.max_rows_per_table=0makes explicit what Cognee always does for a connector: it reads the whole staging table back, whatevermax_rows_per_tableorDLT_MAX_ROWS_PER_TABLEsays, so the deletion check compares against everything synced so far.self_improvement=Falseskips the automatic Improve step after the sync. It is optional.
remember(). Use a dataset per connector and scope, so it is easy to inspect, query and remove.
source.cognee_sync_stats reports what the run did, such as how many items were read, skipped, deleted or failed. The keys differ per connector.
4. Sync Again
Run the same source andremember() call again, for example on a schedule. The connector uses its saved sync state (a cursor, a token, or a fingerprint of each item) to fetch only what changed, and Cognee builds the graph only for new or changed documents. A run with nothing changed upstream extracts nothing. This relies on incremental_loading, which is on by default; passing incremental_loading=False re-runs graph extraction on every document in the dataset.
Several connectors cap the work of one run with a request or time budget. A run cut short keeps the state it reached and reports a failed_<reason> key, such as failed_budget or failed_rate_limit, in cognee_sync_stats. Run the sync again and it continues where it stopped.
5. Deletions Are Forgotten
An item deleted in the app, or moved out of the synced scope, is removed from memory on a later sync: its document, graph and vectors. Two conditions apply to every connector:- The ingestion runs in the foreground.
cognee.add(..., run_in_background=True)skips the deletion pass.remember(run_in_background=True)still forgets deletions, because it runsadd()in the foreground inside its background task. - You can delete from the dataset. With write permission only, the sync stores new items but keeps the deleted ones.
6. Ask the Synced Data
recall() to the connector’s dataset. Connectors that tag each document with node sets, such as a Slack channel or an Obsidian tag, also let you narrow recall with node_name.
7. Start Over or Remove the Data
cognee.forget() and cognee.prune remove what Cognee built, but not dlt’s staged copy or the connector’s sync state. The next sync reads the staged copy back, so every item returns to memory and goes through graph extraction again. Leave prune calls out of real syncs. To remove a connector’s data for good, forget the dataset and drop the staged copy with drop_dlt_dataset, as described in Cleaning Up dlt’s Staging Data.
Connectors
Apollo connector
Apollo connector
The Apollo connector syncs one Apollo.io team’s contacts, accounts, and sequences into cognee memory, incrementally, and forgets records when they are deleted in Apollo. A contact names its account by the account’s own title from the accounts listing, and falls back to its own Custom fields are not rendered unless you list them in Privacy and
dlt state stores the Apollo team id, each record’s id with a fingerprint, and
apollo_source() returns a dlt resource you hand directly to cognee.remember(), so it takes the document-mode path (its source tag is apollo): each record becomes a document that goes through chunking and LLM entity extraction. It reads your team’s own CRM records, never Apollo’s enrichment database, and never creates, changes, or deletes anything in Apollo.Setup
Nothing to install. The Apollo connector is bundled with the Cognee SDK and needs no extra: its REST client usesrequests, which dlt (a core dependency) already requires.Create an API key in Apollo under Settings > Integrations > API. A master key works. A scoped key needs the endpoints below, and only those of the kinds you sync:contacts/show and accounts/show are read only to check a record that stopped appearing. Apollo answers HTTP 403 for a team or plan without API access to an endpoint, and the run stops with an ApolloAccessError that names it. That access comes with a paid plan or a trial, not a free plan; the connector has not been tested against a live account yet. A 403 on contacts/show or accounts/show does not stop the run: the record is kept and counted in failed_access.Example
Parameters
apollo_source() accepts these keyword-only parameters:The returned resource is preconfigured with
primary_key="id", write_disposition="merge", and a _deleted hard-delete column.Labels are what Apollo’s UI calls lists. Every argument that takes ids takes a list or tuple of id strings; anything else, a bare string included, is refused. Changing a filter, include, or custom_field_ids changes what is selected or rendered: records that leave the selection are forgotten, and changing custom_field_ids re-ingests every record whose rendered text changes as a result.Stage and list filters are checked against Apollo’s own lists on every run. An id Apollo does not list (a typo, a deleted stage, or a list GET /labels does not return, such as another user’s private list) stops the run with an ApolloSourceError that names the ids, before anything is emitted or forgotten — a filter that matched nothing would otherwise make every synced record look deleted.What Is Ingested
Rows are flat{id, title, content, url, _deleted, cognee_node_set} documents whose ids are prefixed by kind:Every text opens with one sentence that names its kind, and the rest is
Label: value lines:organization_name when that account is not synced or names nothing. An account with no name is titled by its domain, else “Unnamed account”, so accounts with neither a name nor a domain share one entity in the graph. Renaming an account changes its text and that of every one of its contacts, so each is extracted again. The stage lines say Contact stage and Account stage so that a stage with the same name on both does not merge into one entity. Ids and stages are written as names. Never rendered: emails, phone numbers, and social profile links (Apollo’s search returns them; the connector drops them before rendering), anything from Apollo’s enrichment data, the dates and steps of a contact’s sequence activity, a sequence’s open and reply rates, and who owns a record. The activity feed, attachments, notes, tasks, and calls are not read.Each row’s cognee_node_set is ["apollo:<team id>:<kind>"], with <kind> one of contacts, accounts, or sequences, so the record’s document, chunks, and entities belong to that node set. Scope a recall to Apollo, or to one kind, with node_name:The node set and the wording of the text are part of each document’s identity, and are fixed: changing either would give every record a new document and one more extraction on your LLM key. A tombstone carries no node set.
custom_field_ids, because teams keep phone numbers and personal emails in them. Do not list picklist or multi-select fields: Apollo returns option ids for them, not labels.How Sync and Forget-on-Delete Work
- Fingerprints: Apollo has no change feed and no deleted flag, so each run lists every included kind in full and emits only the records whose rendered text changed, using a hash kept in dlt’s per-resource state.
- Deleted records: a contact or account that stops appearing in a complete listing is read once more before it is forgotten. It is forgotten when Apollo answers 404 or its legacy “this contact has been deleted” text (HTTP 422), or when it still exists but left the selected stages or lists. Any other answer, a 403 or 5xx included, keeps it. A sequence gone from the sequence list is forgotten at once.
- Deselected kinds: leaving a kind out of
includeforgets its records on the next run. - Capped listings: Apollo search returns at most 50,000 records per listing. A bigger selection must be narrowed with stage or list filters; until then the run reports
failed_capand never detects deletions, because a capped listing is incomplete. - Back-off: a record whose deletion check keeps failing (no access, or an error Apollo does not call “deleted”) is left alone for ten cycles after five failed checks in a row, then tried again. It stays in memory the whole time and is counted in
held_back. - Rate limits: a run never waits out a rate limit. When Apollo answers 429, fewer than 10 calls are left in any minute, hour, or day window of the endpoint it is about to call, or
max_requestsis spent, the run stops cleanly, keeps its progress, and resumes at the same page next time. A key rejected after rows were emitted ends the run the same way (failed_auth); one rejected before any row raisesApolloAuthError, and dlt drops that run’s state. The windows are read from every answer that carries them, error answers included, and kept per endpoint (/contacts/searchand/contacts/{id}are two), so what another endpoint has left does not matter. An answer without them leaves the windows last seen for its endpoint; it is not confirmed that Apollo sends them on a 404 or 422, and if it does not, record reads that only get those answers are stopped bymax_requestsor a 429 alone. - Refused listings raise: an HTTP 403 on a search or lookup raises
ApolloAccessErrornaming the endpoint instead of cutting the run, so the next run lists again and nothing is forgotten. - Redirects are errors: a 3xx answer raises
ApolloAPIErrorand is never followed, because the API key travels in a headerrequestswould send to the new host. - Record ids are checked before a deletion check: an id with anything but letters and digits is never requested; the check counts as failed and the record is kept.
Sync Stats
After a run, thecognee_sync_stats dict on the returned resource holds counts only: scanned, skipped, deleted, failed, requests (API calls made; a retried call counts once), and held_back (records in back-off when the run started — not a failure and not part of failed), plus the reason a run or a record failed:failed_rate_limit,failed_budget: the run stopped early and resumes next time.failed_auth: Apollo rejected the key. After rows were emitted the run stops early and resumes next time; before any row it raises, and the next run starts the cycle over.failed_cap: a listing hit the 50,000-record limit, so deletions were not detected.failed_deletion_check: the check of one record failed (a 5xx, or an answer cognee cannot read).failed_access: the key or plan cannot call an endpoint (HTTP 403). On a record read, that one record is kept; on a listing or lookup, the run raised.
failed.Privacy and forget()
dlt state stores the Apollo team id, each record’s id with a fingerprint, and account_names — each synced account’s title and domain, which contacts use to name their account (about 72 bytes per account). It stores no other names or text. dlt’s staging database for the dataset (dlt_database_<dataset>) holds the full rendered text of every record. dlt’s load packages, with the rendered text of each row they load, live in its data directory (~/.dlt of the server process unless DLT_DATA_DIR moves it); cognee has dlt delete them once loaded unless you set LOAD__DELETE_COMPLETED_JOBS yourself (see Cleaning Up dlt’s Staging Data), but a failed package stays for the retry. Logs and errors carry counts, statuses, and endpoints; record ids are replaced by {id} and the key is never logged or stored.Limitations
- Needs API access to the search endpoints (a paid plan or trial).
- At most 50,000 records per kind and filter selection.
- Emails, phone numbers, and social profiles are never ingested; attachments, notes, tasks, and calls are not read.
- Only a 404 or Apollo’s legacy 422 “deleted” text counts as a deletion.
Asana connector
Asana connector
The Asana connector syncs the tasks of the Asana projects you select into cognee memory, incrementally, and forgets a task when it leaves those projects. A task is one document holding its comments (oldest first) and one level of subtasks. A task in two selected projects is one document that names both; projects outside the selection are never named. Nothing volatile is rendered (no Privacy and
The connector reads task names, descriptions, comments with their authors’ names, assignee names, due dates, section and project names, subtasks, custom field values, and project descriptions of the selected projects. That text goes to your configured LLM and embedding providers during cognify, like any document — including whatever people typed into comments and descriptions. Anyone with read access to the dataset can read all of it.The token lives in the client object only. Leading and trailing whitespace is stripped, and a token with whitespace, control, or non-ASCII characters inside it is refused without being echoed. Errors carry the HTTP status and an endpoint with ids replaced (
asana_source() returns a dlt resource you hand directly to cognee.remember(), so it takes the document-mode path (its source tag is asana): each task and each selected project becomes a document that goes through chunking and LLM entity extraction. One source is one access token and one selection of projects. It never changes anything in Asana.Setup
Nothing to install. The Asana connector is bundled with the Cognee SDK and needs no extra: its REST client usesrequests, which dlt (a core dependency) already requires.- Create a personal access token in the Asana developer console, or use an OAuth access token. The token needs read access to the projects and their tasks, comments, subtasks, and events; a personal access token has the access of the user who created it. The connector never refreshes a token.
- Collect the gids of the projects to sync (the number in a project’s URL). There is no “whole workspace” mode: a workspace-wide sync is a list of its project gids, so an empty selection can never mean everything.
Example
Parameters
asana_source() accepts these keyword-only parameters:The returned resource is preconfigured with
primary_key="id", write_disposition="merge", and a _deleted hard-delete column.What Is Ingested
Rows are flat{id, title, content, url, _deleted, cognee_node_set} documents whose ids are prefixed by kind:modified_at, no time of day), so an unchanged task keeps its content hash and is not extracted again. Completed on: is the UTC day of Asana’s completed_at; reopening the task removes the line. People are names, not entities, and no email address is requested.Every row carries a node set: a task gets asana:<gid> for every selected project it is in, sorted, and a project row gets asana:<its own gid>. Scope a recall to one project with node_name:Node sets use project gids, never names, so renaming a project changes no node set. The row ids, node set names, and rendered text are fixed: changing them would give every task a new document and one more extraction on your LLM key. A tombstone carries no node set.
How Sync and Forget-on-Delete Work
- Finding changes: every run lists each selected project’s tasks with their
modified_atand reads a task again when it is new or itsmodified_atchanged. Whatmodified_atdoes not show (a new or edited comment, a renamed or removed subtask, a renamed project or section) comes through the Events API, with one sync token per project. A renamed or removed subtask refreshes its parent, also when the subtask is in a selected project and is a document of its own. An expired sync token (HTTP 412) re-reads the whole project. - Forgetting: a task is forgotten only when a complete listing of the selected projects lacks it and a check of its memberships (
GET /tasks/{gid}, one request) confirms it is gone: a 403 or 404, or no selected project left. It was deleted in Asana, moved out of the selection, or its project was deselected. A run that fails or is cut inside the listing forgets nothing. - Unreadable tasks are kept: a task that is still listed but answers 403, 404, 5xx, nothing, or a body of the wrong shape keeps its old document, is counted in
failed, and is asked again on the next run (state["retry"]). It is never given up on. - Unresolved projects: a project that answers 403 or 404 is skipped for the run, the others sync, and its row and tasks are kept. It is asked again on every run and counted in
unresolved. A deleted project or a mistyped gid looks the same, so its documents stay until you remove it from the selection. - Changing the selection: a project you add is read in full. A project you remove forgets its project row and the tasks that were only in it; tasks also in a kept project are read again so the removed project’s line leaves their text.
- Runs that stop: a rate limit (HTTP 429), a spent
max_requests, three tasks in a row answering 5xx or nothing, or a token rejected (HTTP 401) once the listing is complete ends the run cleanly. It never sleeps and does not readRetry-After. Progress is kept: tasks not reached go tostate["pending"], and a listing cut partway resumes at the page it stopped at (state["listing"]), so a large selection finishes over several runs. - Expired page offsets: if Asana refuses the stored offset a cut listing resumes from (any 4xx on that first page other than 401, 403, or 429), that project is listed again from its first page, once per run. The tasks already listed for it are dropped, the other projects of the pass are kept, and the run keeps the fresh offset. An error on the restarted listing raises instead of restarting it again; a rate limit or a spent
max_requestscuts it cleanly like any listing. - Errors: a token rejected inside the listing raises
AsanaAuthError, and so does a token rejection that stops a run which kept nothing (for example a resumed pass whose first task read is the run’s first request), since the next run would stop at the same place. Any other failing answer outside a task read raisesAsanaAPIErrorwith its status; a missing-task check that answers 403 or 404 forgets the task instead, and one that answers 5xx or nothing keeps it, counted infailedlike a read that failed. An answer of the wrong shape in a listing, the events feed, a project read, or a missing-task check raisesAsanaResponseError, and so does a listing page withoutnext_page(nullmarks the last page) or an events page withouthas_more: neither is read as the end. A run whose budget is too small to make any progress raisesAsanaSourceError, giving the numbers. dlt drops the state of a run that raises, so the next run starts from the last good state and forgets nothing.
Sync Stats
After a run, thecognee_sync_stats dict on the returned resource holds counts only:A run that stopped carries exactly one of
failed_rate_limit, failed_budget, failed_unavailable, or failed_auth. A run that raises carries failed_auth for a rejected token or failed_cap for a budget too small to cover the selection (the next run would stop at the same place; Cognee 1.6.11 and earlier report failed_budget here), and no reason key otherwise.Limitations
- Budget: a listing costs about
projects × (1 + event pages + ceil(tasks / 100))requests, and a run reads about(max_requests - listing) / 3tasks. A first sync of 3,000 tasks in one project takes about seven runs at the default budget. Deselecting a big project costs one check per task. - Lock hold time: a run holds the dlt staging lock of its dataset and pipeline while it walks, for at most
max_requestsrequests plus the client’s retries (three attempts, backing off 1 s then 2 s). There is no wall-clock deadline. - Renaming a project or section changes the text of every task in it, so each is read and extracted again.
- Not read: subtasks of subtasks, attachments, task history other than comments, tags, followers, and dependencies.
- Offsets that keep expiring: a project whose stored offsets keep expiring, in a selection whose runs are always cut (by the budget or a 429) before that project lists to its end, never finishes its pass, so no task is read or forgotten until a run lists it in one go or Asana accepts an offset again; until then a changed selection is not applied either. The stats show only an ordinary
failed_budgetorfailed_rate_limitcut. - If the token loses access to every task but the listing still works, a run ends with no reason key; only
failedandkeptshow it.
Privacy and forget()
The connector reads task names, descriptions, comments with their authors’ names, assignee names, due dates, section and project names, subtasks, custom field values, and project descriptions of the selected projects. That text goes to your configured LLM and embedding providers during cognify, like any document — including whatever people typed into comments and descriptions. Anyone with read access to the dataset can read all of it.The token lives in the client object only. Leading and trailing whitespace is stripped, and a token with whitespace, control, or non-ASCII characters inside it is refused without being echoed. Errors carry the HTTP status and an endpoint with ids replaced (/tasks/{gid}); neither the token nor any task id is logged. dlt state holds ids, timestamps, and page offsets, never text.Dropbox connector
Dropbox connector
dropbox_source() syncs one Dropbox folder and its subfolders, or the whole Dropbox, into Cognee memory. Each text, Markdown, CSV or PDF file and each Paper doc becomes one document, keyed by its Dropbox file id. Files deleted or moved out of the folder are forgotten.Setup
There is no extra to install: the connector’s client ishttpx, a core dependency.- Create a Dropbox app at dropbox.com/developers/apps with the scopes
files.metadata.read,files.content.readandaccount_info.read. - Generate an access token for your account on the app’s settings page. It lasts about four hours.
- Set
DROPBOX_ACCESS_TOKENto that token. - Set
DROPBOX_FOLDER_IDto the folder’s id, theidthat Dropbox’s/2/files/get_metadatareturns for the folder’s path, likeid:a4ayc_80_OEAAAAAAAAAXw. Leave it empty to sync the whole Dropbox.
Example
This script syncs the folder into themy_dropbox dataset and asks a question about it.dropbox_account_id(token) looks up the token’s account so the sync state is tied to it, and another account can never reuse it. resource_name names the staging table and the cursor that make later runs incremental, so use one name per folder and account.Parameters
resource_name must start with dropbox_ and hold only lowercase letters, digits and single underscores (at most 63 characters), or dropbox_source() raises ValueError.Checking a Sync
A normal return alone does not prove the sync finished, so checksource.cognee_sync_stats: a run is complete when failed == 0 and complete == 1.Evernote connector
Evernote connector
evernote_source() reads the notes of one Evernote account. Each note becomes one document holding its notebook, its tags and its text, and a note is read again only when it changes. Documents carry the source tag evernote.Setup
-
Install the extra, which adds Evernote’s Thrift client (
evernote-plusandthrift):The extra is imported only when a sync makes its first call, so importingcognee.tasks.ingestion.connectorsloads nothing. Without it, that first call raises anImportErrorthat names the install command, whichremember()surfaces wrapped in aDLTIngestionError. -
Get a token: a developer token for your own account, or an OAuth 1.0a access token your application already obtained from Evernote. The connector runs no OAuth flow and never reads the token from the environment, so pass it as
token. The example reads it fromEVERNOTE_TOKEN:
Example
This script syncs one account into theevernote_demo dataset, asks a question, then syncs and asks again.notebook_names to sync only some notebooks. With nothing changed at Evernote, the second sync reads no note and extracts nothing. The script is also in the Cognee repository as examples/guides/evernote.py.Parameters
evernote_source() accepts these keyword-only parameters:A source is bound to one account and environment (
production:<user id> or sandbox:<user id>). A run whose stored state belongs to another account or environment raises.What Is Ingested
- One document per note. Rows are
{id, title, content, _deleted}, withidbeingnote:<guid>. There is nourlcolumn. - Content: a
Notebook: <name>line, aTags: <names>line (tags sorted case-insensitively), then the note’s ENML as text: headings as#, list items as-, to-dos as[x]/[ ], and table cells joined by|. - Attachments are not read. An attachment becomes
[attachment: <mime type>]and an encrypted section[encrypted content]; attachment bodies, resources, and note links are not fetched. - A note with no text uses its title, and a note with neither is not stored.
How Sync Works
Evernote numbers every change in an account with an update sequence number (USN). Each run first compares the account’s current USN with the stored one, and when they match it only reads the retry list (see Limits and Retries). Otherwise it reads the account in two passes: pass 1 lists the changed notes, notebooks, tags, and expunged notes 250 entries at a time, and pass 2 fetches the body of every changed note in the selection. Progress is saved after every chunk and every note, so a run cut by a rate limit, an outage, ormax_notes_per_run continues where it stopped.A full pass (reading the whole account) runs on the first sync, when the selection changes or its names resolve to other notebooks or tags, when a notebook was expunged, with full_resync=True, when the account’s current USN is below the stored one, and when Evernote’s fullSyncBefore is newer than the last sync.Deletions
Deletions are emitted as_deleted tombstones only for notes this resource emitted, and only on evidence: a complete pass 1, or a body read that finds the note gone or empty. A cut or failed pass 1 never deletes. A note is forgotten when it is trashed or expunged, moved out of the selected notebooks or tags, not found when its body is read, edited to have no text and no title, or (on a full pass) no longer live and selected. When a notebook is expunged, the run does a full pass and forgets every emitted note it no longer lists.cognee.forget() does not reach Evernote: a note forgotten by hand comes back on the next sync while it still exists at Evernote, because its staging row is kept.Sync Stats
After a run,source.cognee_sync_stats holds emitted (note documents), deleted (tombstones), failed, failed_rate_limit, failed_auth, and failed_unavailable; every key is present on every exit. A cut by max_notes_per_run is not a failure.Limits and Retries
- Rate limit: Evernote limits calls per API key and user per hour and does not publish the number. A
RATE_LIMIT_REACHEDis waited out while the waits of one call stay within 30 seconds; a longer one ends the run cleanly withfailed_rate_limit, and the next run continues. - Outages: transport errors are retried three times, after 1, 2 and 4 seconds. Transport errors that outlast the retries and Evernote system errors end the run cleanly with
failed_unavailable, and the next run continues. - Retry list: a note Evernote will not hand over, or that answers unavailable, is counted in
failedand kept on a retry list; the sync moves on and the note’s old document stays. Every run reads the retry list after the pass is stored, so failing notes never hold back new notes and edits. - Tokens and permissions: a rejected token (
INVALID_AUTH,AUTH_EXPIRED) setsfailedandfailed_auth, and aPERMISSION_DENIEDon any call but a note’s body setsfailedalone. Before any row is emitted they raise instead (EvernoteAuthError,EvernotePermissionError, whichremember()surfaces wrapped in aDLTIngestionError); after rows, the run ends cleanly and keeps what was emitted. - First sync cost: one listing call per 250 changed entries plus one call per note in the selection, then cognify of every note.
Known Limitations
- Selection by name. Renaming a selected notebook or tag fails the next run with a message that names the missing name; update
notebook_names/tag_names. - Renamed notebooks and tags stay in the text. The
Notebook:andTags:lines carry names, so after a rename a note keeps the old name until the note itself changes. - SDK only: there is no Cloud connect flow (see Setup).
Gmail connector
Gmail connector
gmail_source() syncs the messages in one Gmail mailbox, or the labels you select, into Cognee memory. Each message becomes one document with its subject, searchable headers and plain-text body. The connector is bundled with the Cognee SDK (from v1.6.1) and supersedes the standalone cognee-community-connector-gmail package.Setup
Install the extra:uv pip install "cognee[gmail]". The gmail extra pulls in google-api-python-client, google-auth, and google-auth-oauthlib. They are imported lazily: importing cognee.tasks.ingestion.connectors works without the extra, and the ImportError naming it is raised only when the Gmail client is built, during the remember() call.The connector authenticates through the OAuth2 installed-app (Desktop app) flow with the read-only scope https://www.googleapis.com/auth/gmail.readonly, so it never modifies your mailbox. Set it up once in the Google Cloud Console:- Create a project, or select an existing one.
- Open the Gmail API page and click Enable.
- Open Google Auth Platform and click Get started. Enter an app name and your email, choose External as the audience, and finish the wizard. Google Auth Platform isn’t in the left menu by default; you can also reach it through ☰ → APIs & Services → OAuth consent screen.
- Open Audience. If it shows User type: External and Publishing status: Testing, click Add users under Test users and add the Google account whose mailbox you want to sync. If the user type is Internal (a Google Workspace organization) or the app is In production, there is no Test users section and you can skip this step.
-
Under Data Access, click Add or remove scopes, filter for
gmail.readonly, tick.../auth/gmail.readonly, click Update, then Save. -
Under Clients, click Create client, choose Desktop app, and click Create. Click Download JSON in the dialog that follows. A Web application client, such as the one from the Gmail integration, fails at sign-in with
Error 400: redirect_uri_mismatch. -
Save the downloaded file as
credentials.jsonin the folder you run the script from (or passcredentials_path), or point the script at it in your shell or in your.env:Use absolute paths in.env, which doesn’t expand~.
token.json (token_path) with owner-only (0600) permissions. Later runs reuse and silently refresh that token. To let users connect their mailboxes through Cognee’s API instead of a local token file, see the Gmail integration.Example
This script loads the 25 newest messages inINBOX and asks a question about them.max_results=25 keeps the first run quick, but a capped run saves no cursor, so it never syncs only the changes; drop it for real syncs, as described in Loading the Whole Inbox below. If credentials.json is missing, the script prints a message and exits. Remove the prune calls before syncing a mailbox you want to keep: they don’t clear the saved cursor or dlt’s staged copy of your mail (the dlt_database_<dataset> staging database), so the next sync brings every previously synced message back through graph extraction.Parameters
gmail_source() accepts these keyword-only parameters:The
query and include_spam_trash parameters of the community package are gone. The returned resource (named resource_name) is preconfigured with primary_key="id", write_disposition="merge", and a _deleted hard-delete column, so it performs idempotent upserts by Gmail message id.What Gets Ingested
Each message becomes one document. The subject is its title, the headers worth searching are folded into the text, and the body follows after a blank line:Receivedis Gmail’sinternalDateas a UTC ISO timestamp, alongside the sender’s ownDateheader.- Empty fields are left out. A message with no
Cchas noCc:line; a message with no subject gets no#heading. - The body is the message’s first
text/plainpart, found anywhere in the MIME tree. HTML-only mail has none, so those messages fall back to Gmail’ssnippet, a short preview rather than the full text. That keeps raw markup out of entity extraction, but expect HTML newsletters to be represented thinly.
recall() searches and graph extraction runs on, so anything not in it (attachments, HTML bodies, other headers) can’t be asked about.How Incremental Sync Works
The connector decides how to sync from what it saved last time:- No saved cursor (the first sync): it lists the label from the newest message down and fetches each one. If the run wasn’t capped with
max_resultsand finished, it saves the mailboxhistoryIdas a cursor in dlt’s per-resource state. - Saved cursor: it calls
users.history.list(startHistoryId=...)and fetches only new or changed messages. If nothing changed, no messages are downloaded.
- the previous sync ran without
max_resultsand finished. An interrupted sync saves nothing, so the next one starts over. - later syncs use the same
dataset_nameandlabel_ids. Changing the set oflabel_idsmakes the next run do a full backfill of the new scope, so older messages that now match are picked up; reordering the same labels keeps the cursor. - you don’t delete the connector’s saved state. The cursor lives in dlt’s pipeline state under
~/.dlt/pipelines/. - you sync at least about once a week. Gmail expires history after roughly a week; on the resulting
404the connector loads every message in the label again instead of stalling.
max_results always starts from the newest message and stops after that many. It doesn’t remember where it stopped, so the next capped run starts from the top again instead of continuing to older mail. Messages you already have are requested from Gmail again and count against your quota, but they aren’t processed into the graph again.When Deletions Are Forgotten
- Messages the History API reports as deleted or trashed are emitted with the
_deletedhard-delete marker and forgotten. On incremental runs, a message that leaves the scope (for example, trashedINBOXmail) is forgotten the same way. - A backfill after a
label_idschange forgets every previously synced message outside the new scope, so narrowinglabel_idsremoves the mail that no longer matches. - A message fetch that returns
404or410means the message is gone: it counts underskippedand is forgotten like any other deletion. - A backfill capped by
max_results, or one that fails midway, forgets nothing.
Loading the Whole Inbox
Dropmax_results and let one sync run to completion:- It takes a while. Gmail allows 6,000 quota units per user per minute, and fetching one message costs 20. The connector paces itself to 5,000 units a minute by default, about 250 messages, so 10,000 messages take around 40 minutes to download. Lower the budget with
gmail_source(quota_units_per_minute=...)if other apps use the same account. - Sources for one mailbox share the budget. Sources with the same
resource_name(gmail_messagesunless you set one) in one process, such as twogmail_source()syncs of the same mailbox running at once, share one budget. The firstquota_units_per_minuteset for that name is the one used, and later values are ignored until the process restarts. Google’s per-user quota also counts traffic this process can’t see, like other syncs, tenants or apps on the same account and Cloud project. - Every message goes through graph extraction, so expect at least one LLM call per message. Try a smaller label first to estimate time and cost.
- Let it finish. An interrupted sync saves no cursor, so the next run starts from the beginning.
Errors and Retries
- Message fetches: only a
404/410from Gmail means the message is genuinely gone. Anything else (a rate limit, a 5xx, a dropped connection) is first retried up to six times by the Google client. If a quota rejection (a429, or a403with reasonrateLimitExceededoruserRateLimitExceeded) is still there after those retries, the connector logs a warning, waits one full 60-second quota window and tries again, up to five times, so it waits out a quota rejection for up to about five minutes before the sync fails. Any other error, or a quota rejection that outlasts the five windows, is raised, which ends the sync before the cursor advances. The next run picks up from the same point instead of mistaking a transient error for a deleted message. - History API calls: only a real
404(not410) means the cursor expired, which triggers the full reload described above. Quota rejections get the same five one-minute waits as message fetches. Anything else (a 5xx, a dropped connection, or a quota rejection that outlasts those waits, after the Google client’s retries) ends the sync with the saved cursor untouched, so the next run resumes from the same point instead of reloading the whole label.
source.cognee_sync_stats counts scanned messages fetched from Gmail, deleted messages forgotten, and skipped / failed fetches.Google Calendar connector
Google Calendar connector
google_calendar_source() syncs the calendars you select into Cognee memory. Each event becomes one document with its title, time, location, organizer, attendees and their responses, and description, so the same person is linked across meetings. The connector is bundled with the Cognee SDK and replaces the cognee-community Google Calendar package; it takes the document-mode path with the source tag google_calendar.Setup
Install the extra:google-calendar extra pulls in google-api-python-client, google-auth, and google-auth-oauthlib. They are imported lazily: importing cognee.tasks.ingestion.connectors works without the extra, and the ImportError naming it is raised only when the Calendar client is built.The connector uses the OAuth2 installed-app (Desktop app) flow with the read-only scope https://www.googleapis.com/auth/calendar.readonly only. It never creates, changes, or deletes anything in Google Calendar. Set it up once in the Google Cloud Console:- Create a project, or select an existing one.
- Open the Google Calendar API page and click Enable.
- Open Google Auth Platform and click Get started. Enter an app name and your email, choose External as the audience, and finish the wizard. Google Auth Platform isn’t in the left menu by default; you can also reach it through ☰ → APIs & Services → OAuth consent screen.
- Open Audience. If it shows User type: External and Publishing status: Testing, click Add users under Test users and add the Google account whose calendar you want to sync. If the user type is Internal (a Google Workspace organization) or the app is In production, there is no Test users section and you can skip this step.
-
Under Data Access, click Add or remove scopes, filter for
calendar.readonly, tick.../auth/calendar.readonly, click Update, then Save. -
Under Clients, click Create client, choose Desktop app, and click Create. Click Download JSON in the dialog that follows. A Web application client, such as the one from the Google Calendar integration, fails at sign-in with
Error 400: redirect_uri_mismatch. -
Point the connector at the downloaded file, in your shell or in your
.env:RemoveGOOGLE_CALENDAR_ACCESS_TOKENandGOOGLE_CALENDAR_REFRESH_TOKENfrom your shell and your.envif they are set. Either one takes precedence over the file above, and values in.envoverride the shell.
0600; later runs reuse and refresh it. To sign in once ahead of a sync and see which calendar ids you can sync:GOOGLE_CALENDAR_REFRESH_TOKEN with GOOGLE_CALENDAR_CLIENT_ID and GOOGLE_CALENDAR_CLIENT_SECRET, or pass a ready-made access token (access_token= or GOOGLE_CALENDAR_ACCESS_TOKEN), which is never refreshed. build_calendar_service_from_access_token(token) builds a client from a token you already hold. When several are set, an access token wins, then the refresh token, then the installed-app flow. A source built with no credentials at all raises a ValueError right away, before any pipeline work starts. To let users connect their calendars through Cognee’s API instead of a local token file, see the Google Calendar integration.Example
This script syncs your primary calendar, asks a question about it, and syncs again.Parameters
All parameters except
calendar_ids are keyword-only. The returned resource is preconfigured with primary_key="id", write_disposition="merge", and a _deleted hard-delete column.What Is Read
- From the selected calendars only: title, calendar name, start and end with time zone, location, organizer, attendees with name, email, and response, the recurrence rule, status, event type, the Google Meet link, the description, and the event link.
- Not read: attachments, conference details beyond the Meet link, reminders, colors, and other calendars.
workingLocationevents are skipped. - Recurring events: a series is one document with its
RRULE, and a changed single occurrence is its own document. - All-day events show their last day: a one-day event reads
all day, 2026-11-08, a three-day oneall day, 2026-11-08 to 2026-11-10. - dlt state stores each calendar’s id, its sync token, and its event ids, not titles or descriptions. Logs and errors carry counts and HTTP statuses only; calendar ids and request URLs are left out.
How Incremental Sync Works
- Sync tokens: the first run lists every event of each calendar; the sync-token API allows no date window, so the full history is read. Later runs pass that calendar’s
nextSyncTokenand get only what changed. The token is saved in dlt state once the whole round has finished. - Expired sync token: a
410 Gonelists that calendar again and reconciles it like a snapshot, so events deleted in the meantime are still forgotten.
When Deletions Are Forgotten
- Deleted events come back as cancelled and are forgotten if they ever reached memory. A cancelled single occurrence forgets only that occurrence; deleting a whole series also forgets its changed occurrences. An event created and deleted between two syncs is neither stored nor counted.
- Removed calendars: removing a calendar from
calendar_idsforgets its events. A calendar is also forgotten when it was synced before and has left the account’s calendar list. A404for a calendar that is still listed, or that was never synced (most likely a typo), is a failure, not a deletion.
Failures
A calendar that fails keeps its old state and forgets nothing; it is retried on the next run, while the other calendars finish and save theirs. The run raises only when no calendar finished. A401, a 429, or a 403 with a rate-limit reason ends the run early, since the remaining calendars would fail the same way; any other 403 (lost access) fails only its own calendar. This holds for HTTP responses only: a transport error, or an auth error raised by the Google client library before any HTTP call (such as google-auth’s RefreshError), ends the whole run.source.cognee_sync_stats holds counts only, never titles or content: scanned, skipped, deleted, calendars, and failed, plus failed_auth (HTTP 401), failed_rate_limit (HTTP 429, or 403 with a rate-limit reason), or failed_calendar_sync (anything else) for the reason a calendar failed.Google Drive connector
Google Drive connector
google_drive_source() syncs one Google Drive folder and, by default, its subfolders into Cognee memory. Each supported file becomes one document, keyed by its Drive file ID: Google Docs, Sheets and Slides, PDFs, text files (any text/* type, plus JSON and XML), and Office and document files (.docx, .xlsx, .pptx, .odt, .ods, .odp, .rtf, .html, .epub, and the legacy .doc, .xls, .ppt).Setup
Install the extra:.rtf and .epub need a document loader: install cognee[docling] (or cognee[docs], which brings the unstructured loader) alongside the connector extra. Legacy .doc, .xls and .ppt files also need LibreOffice (soffice on PATH, or the macOS app in /Applications); without it they are counted as failed_loader_unavailable.Called with no arguments, google_drive_source() takes the auth mode, credentials, token path, and folder ID from GOOGLE_DRIVE_* environment variables. Set GOOGLE_DRIVE_FOLDER_ID to the folder’s Drive ID, taken from its URL. Then, once in the Google Cloud Console:- Create a project, or select an existing one.
- Open the Google Drive API page and click Enable.
.env. Use absolute paths in .env, which doesn’t expand ~.Service account (recommended, no browser step):- Open Service Accounts and click Create service account. Enter a name, skip the optional permission steps, and click Done. The account needs no roles.
- Click the new account, open the Keys tab, click Add key → Create new key, choose JSON, and click Create. The key file downloads. If your organization blocks key creation, use OAuth instead.
-
Copy the account’s email (
...@....iam.gserviceaccount.com). In Google Drive, share the folder with that address as Viewer. -
Point the script at the key:
- Open Google Auth Platform and click Get started. Enter an app name and your email, choose External as the audience, and finish the wizard. Google Auth Platform isn’t in the left menu by default; you can also reach it through ☰ → APIs & Services → OAuth consent screen.
- Open Audience. If it shows User type: External and Publishing status: Testing, click Add users under Test users and add the Google account whose Drive folder you want to sync. If the user type is Internal (a Google Workspace organization) or the app is In production, there is no Test users section and you can skip this step.
-
Under Data Access, click Add or remove scopes, filter for
drive.readonly, tick.../auth/drive.readonly, click Update, then Save. -
Under Clients, click Create client, choose Desktop app, and click Create. Click Download JSON in the dialog that follows. A Web application client, such as the one from the Google Drive integration, fails at sign-in with
Error 400: redirect_uri_mismatch. -
Point the script at the downloaded file:
The first run opens a browser for one-time consent; later runs reuse the cached, auto-refreshed token. For headless or CI use, authorize the token file once on a machine with a browser.
GOOGLE_DRIVE_* variables (GOOGLE_DRIVE_CLIENT_ID, GOOGLE_DRIVE_REDIRECT_URI, and so on) and syncs over its own REST endpoints.Example
This script syncs the folder, asks a question about it, and syncs again.remember() call uses a fresh source with the same dataset, key, and write disposition, and processes only files added or changed since the first run. The script’s comment about a 50-row default is out of date. Google Drive is a document source, so Cognee always reads its whole staging table, whatever max_rows_per_table or DLT_MAX_ROWS_PER_TABLE says; the argument is harmless but changes nothing.What Gets Synced
- Drawings, Forms, images, audio, video and archives are skipped.
- A Google Sheet contributes its first sheet only, which is all Drive’s export returns.
- There is no file size limit by default, because downloads are streamed to a temporary file. Set one with
GOOGLE_DRIVE_MAX_FILE_SIZE_MB. - File content is fetched on 8 threads in parallel, with rate-limit and server errors retried.
GOOGLE_DRIVE_MAX_WORKERSchanges the thread count.
Syncing Again
A re-sync processes only files that were added or changed since the previous run, and files deleted or trashed in Drive, or removed from the folder, are forgotten.After a Cognee upgrade that adds supported formats, the next run lists the folder in full once to pick up unchanged files the older version skipped. Files it already read are not downloaded again (an upgrade from Cognee 1.6.5 or earlier downloads them once, since those versions recorded no file versions). No reset is needed.Granola connector
Granola connector
The Granola connector syncs the meeting notes a Granola API key can see in one scope (all notes, one folder, or one space) into cognee memory, incrementally, and forgets notes Granola confirms are deleted or moved out of the scope. Pass the same Privacy and
The note text goes to your configured LLM and embedding providers during cognify. The key is never stored in the dlt state, a row, an error, or a log line, and logs never name a note, folder, or URL.
granola_source() returns a dlt resource you hand directly to cognee.remember(), so it takes the document-mode path: each note becomes a text document that goes through normal chunking and LLM graph extraction.Setup
The Granola connector is bundled with the Cognee SDK. It needs no extra: the client usesrequests, which dlt already brings. It needs a core with DOCUMENT_SYNC_VERSION 3 or later and raises a RuntimeError on an older one.Auth is a Granola API key (grn_..., created in Granola under Settings, Connectors, API keys). Granola’s REST API is available on Business and Enterprise plans, and has no OAuth. A personal key and a workspace key both work. The key is sent as Authorization: Bearer through a requests auth object, so a ~/.netrc entry for public-api.granola.ai never replaces it. Proxy and CA bundle settings (HTTPS_PROXY, REQUESTS_CA_BUNDLE) still apply. The key is never read from the environment: pass it as api_key.Example
scope, resource_name, and remember() arguments on every sync. To sync several scopes into one dataset, build one source with its own resource_name per scope.Parameters
granola_source() accepts these keyword-only parameters:Pass
api_key or service; without either the source raises ValueError when built.Hosts. The connector is registered as the granola provider in _PROVIDERS (cognee.modules.integrations.ingestion), with the table prefix granola. Row ids, rendered text, and node sets match the Cognee Cloud pod’s Granola source, but the table names differ, so a host moving from the pod source syncs each connection once more from the start.What Is Ingested
- One document per note. Rows are
{id, title, content, url, cognee_node_set}. idis the note id (not_...).titleis the note’s title, orUntitled meeting.urlis the note’sweb_url, only when it starts withhttps://notes.granola.ai/.contentis the title,Meeting date: <created_at>, the summary (Markdown, else text), and, withinclude_transcript=True, aTranscript:block with one<speaker>: <text>line per transcript part.- Node set: each row carries
cognee_node_set["granola:<scope>"], so arecall()can be scoped to one scope withnode_name=["granola:fol_..."]. - Private scratch notes, attachments, owners, and attendee emails are never read into a row.
How It Works
- Incremental walk: each run lists notes changed since the last completed walk (with a 5-minute overlap) and reads each one. A run cut by a bound or an error resumes at the unread note. A note that fails on its own gets 3 attempts before it is given up (
skipped_unavailable) until an edit lists it again. - Deletions: a note listed with
deleted_atis tombstoned at once. At most once every 24 hours, after a complete walk, the connector lists the whole scope. Each known note missing from that listing is read by id and tombstoned only when Granola confirms it: a 404,deleted_at, or a membership that places it outside the scope. A note whose membership cannot place it either way stays in memory (reconcile_unconfirmed). A note whose read fails is kept too (counted inskipped) and asked again at the next reconcile. The same listing imports notes that were shared or moved into the scope without an edit. - Errors: no Granola API failure during a sync raises. The run stops, keeps what it emitted and its state, and the next run resumes.
Sync Stats
After a run,cognee_sync_stats holds counts, with every key present: scanned, skipped, deleted, failed, skipped_unavailable, transcript_too_large (notes imported with their summary but without a transcript over the 2,000,000-character cap), reconcile_unconfirmed, retry_after_seconds, requests, and one reason key per stop: failed_auth (401), failed_rate_limit (429), failed_access (a 403 on every request, such as an inactive subscription or an IP allowlist, or a complete reconcile listing that came back empty while notes are known; nothing is deleted), failed_unavailable (5xx or no answer, twice), failed_budget (a run bound was reached), and failed_listing (a listing Granola refused or answered malformed).Privacy and forget()
The note text goes to your configured LLM and embedding providers during cognify. The key is never stored in the dlt state, a row, an error, or a log line, and logs never name a note, folder, or URL. forget() removes memory but not the staging copy or the state, so the next sync brings back what Granola still lists. To erase a note, delete it in Granola or narrow the scope.Limitations
- Overlapping scopes (a folder and its space, or two folders sharing a note) import a note once per table.
- A note moved to Granola’s trash may stay listed, and in memory, until Granola purges it (up to 30 days).
- This connector has not been run against a live Granola account; its tests use a fake API.
Linear connector
Linear connector
linear_source() reads one Linear team’s issues, comments and projects. An issue, with its comments, becomes one document, and so does a project; documents carry the source tag linear. The connector does not forget deletions yet (see Deletions).This is the connector you drive from your own code with a token you already hold. It is not the Linear integration, which installs Cognee into a workspace as an OAuth agent.Setup
Nothing to install: the Linear connector needs no extra, since dlt is a core Cognee dependency, socognee.tasks.ingestion.connectors carries it out of the box. All you need is an access token: an OAuth access token or a personal lin_api_... API key.The source takes a plain access token and never refreshes it; a host that owns the OAuth flow passes a fresh token per run. OAuth tokens are sent as Bearer, personal API keys (lin_api_...) are sent as is. Surrounding whitespace is stripped, and a token that is empty or contains spaces, non-ASCII, or non-printable characters is refused when the source is built, without echoing the value.Example
This syncs one team into thelinear dataset.linear_source() call. The resource declares merge, so leaving write_disposition out keeps it. Don’t pass "replace": the second sync would drop and reload the table instead of upserting into it.Parameters
linear_source() accepts these keyword-only parameters:The returned resource is preconfigured with
primary_key="id", write_disposition="merge", and a _deleted hard-delete column.What Is Ingested
Rows are flat{id, title, content, url, _deleted} documents whose ids are prefixed by kind:A comment is part of its issue’s document rather than a row of its own, so asking about a discussion finds the issue it belongs to.
- Sub-teams are not included. Select the sub-team itself to ingest its issues.
- An issue moved to another team stays in the old team’s table.
- A project shared by several teams is ingested once per selected team.
Deletions
Deletions are not propagated yet. Trashed issues are skipped, but anything already ingested stays in memory: the_deleted column is declared and always False. A comment deleted in Linear is hard-deleted there, so it is never seen again and stays in the issue’s document until the issue changes next.How It Works
- Incremental by
updatedAt: Linear sorts newest first and has no change feed, so each of the three streams — issues, comments, projects — keeps its own floor, plus the ids seen exactly at that floor, in dlt’s per-resource state. A run with no changes yields nothing. - Comments are their own stream: an edited comment does not reliably bump its issue’s
updatedAt, so changed comments are read separately and their parent issues are re-rendered. - A run is bounded:
max_requests(1,500 by default) caps one run. Linear allows 5,000 requests and 2,000,000 complexity points per hour for an OAuth app user (2,500 and 3,000,000 for a personal API key), shared with everything else that user does. - It stops cleanly rather than raising or sleeping: on a Linear rate limit (a gateway HTTP 429 counts as one), remaining quota below a reserve, a spent request budget, or a token that expires after progress was made, the source stops where it is, keeps the state it reached, and records it in
cognee_sync_stats:failed, plusfailed_rate_limit,failed_budget, orfailed_auth. Raising would make dlt roll the run’s state back, so a team too big for one hour of quota would never finish; sleeping would hold the dlt staging lock of its dataset and pipeline. - The next run resumes from the cut point, down to the page cursor it stopped at, so even a large group of rows sharing one timestamp is read across several runs.
- Errors that do raise: a token rejected before any progress was made, a team that cannot be found, a pagination response that does not advance, and other API failures raise
LinearAuthError,LinearTeamNotFoundError, orLinearAPIError. Their messages carry codes only — never the token, the query variables, or a response body.
Notion connector
Notion connector
The Notion connector syncs the Notion pages and database rows you choose into cognee memory, incrementally and with forget-on-delete. A database (or one of its data sources) works the same way:
notion_source() returns a dlt resource you hand directly to cognee.remember(), so it takes the document-mode path (its source tag is notion): each page becomes a text document that goes through normal chunking and LLM graph extraction. On a self-hosted Cognee backend, users can connect a workspace over OAuth and pick pages in a picker instead of calling notion_source() by hand. See the Notion integration, which runs this connector for each selected root.Setup
Nothing to install. The Notion connector talks to the Notion REST API overhttpx, a core cognee dependency, so like Linear it needs no extra and ships in cognee.tasks.ingestion.connectors with a plain cognee install.- Create a Notion internal integration and copy its token.
- Share every page or database you want synced with that integration (
... > Connections > Add connection). - Set
NOTION_API_KEY, or passtoken=directly, plus yourLLM_API_KEYas for any other cognee run.
Example
Parameters
notion_source() accepts these parameters:The returned resource is preconfigured with
primary_key="id", write_disposition="merge", and a _deleted hard-delete column. Counts-only diagnostics (never titles or content) are exposed in the cognee_sync_stats dict on the returned resource, including pages_incomplete and deletions_withheld (see Blocks the API cannot read below).What Is Ingested
- One document per page. Rows are
{id, title, content, url, _deleted}. A database row is a page too: its properties (rich_text, select, multi_select, status, date, people, number, checkbox, url, email, relation ids) are rendered asName: valuelines at the top of its content. Relation and people values stay raw ids/names in that text; they are not resolved into graph edges. - Nested content is followed: sub-pages, databases embedded in pages, and content inside columns, toggles, callouts, lists, and synced blocks, at any depth. A synced block that copies another page’s original is not searched; its sub-pages are only synced when the original’s page is under a selected root. Archived and trashed pages are skipped.
- Node sets: each row carries
cognee_node_set = ["notion:<workspace_id>:<root_id>"]— always ids, never titles — so the page’s document and chunks belong to the root you configured it under. When a page is reachable from two selected roots, the nearest root wins. - Structure: each row also carries
cognee_structure(see Connector Modes). A sub-page lists its parent page, even when it sits inside a column or toggle: the parent is the page that holds it, not the block. A database row lists its data source, its database, and the page the database sits on; under a root you passed as a database or data source id, the page is not listed. A root has an empty list. After each cognify, these becomechild_ofedges: page to parent page, database row to data source, data source to database, and database to its page. Databases and data sources becomeStructureContainernodes, and the graph visualization treatschild_ofas a structural edge. A parent outside the selected roots, or one that was forgotten, gets no edge. Deleting a page leaves its children where they are, and a database disappears with its last row (on a graph that does not store its own provenance, at the next cognify). - Attachments (file, image, PDF, video blocks) become a name/caption reference line only; the binary is not downloaded.
How It Works
- Re-walk every run: Notion has no delete feed, so each run walks the selected trees again to rediscover what still exists. A page’s content is only re-rendered when its
last_edited_time, its root, its position in the tree, or whether it was read completely changed since the previous run; unchanged pages are not re-ingested. - Forget-on-delete: pages that vanished (unshared, trashed, or moved out of the selected roots) are emitted as
_deletedtombstones; dlt drops them onmergeand cognee’sorphan_cleanupforgets them from the graph, vector, and relational stores (not whenadd()runs in the background, see Deletions Are Forgotten). A page that vanished from below a page the API could not read completely is withheld instead. - Moving a page between two selected roots, or changing roots so that another one reaches it, changes its node set (part of the row’s identity), so it is re-ingested once under the new root. Moving a page inside its root keeps its document id and does not run extraction again; only its
child_ofedge changes. Renaming a database re-reads its rows once, because its title is part of their structure. - Upgrading: the first sync after upgrading to a Cognee with
DOCUMENT_SYNC_VERSION3re-reads every page once to record its position. That costs Notion API requests, not extraction, except for pages whose rendered text changed in the meantime. - Cost: a run makes at least one request per page even when nothing changed — a 20,000-page tree is tens of thousands of requests, hours at Notion’s rate limit of about 3 requests per second. The connector does not throttle itself; HTTP 429 and 5xx responses are retried (up to 5 attempts) using
Retry-Afteror exponential backoff.
Errors
A run aborts before any tombstone is written — so a partial walk can never look like a mass deletion — when:- a transient error (network failure, or a 429/5xx that exhausts the retries) occurs;
- listing a readable page’s blocks or querying a data source fails, or Notion reports more results without a
next_cursor(unsupported block children are the one exception, see below); - Notion’s answer omits a field it must carry (a listing’s
resultsorhas_more, a block’stypeorhas_children, a database’sdata_sources) or is not a JSON object — a missing field is never read as empty; - one of your explicit roots returns 403/404 (a configuration problem, not a deletion);
- a data source has more than 10,000 rows (see limitations).
Blocks the API cannot read
If Notion refuses a block’s children with400 validation_error and the message Block type <type> is not supported via the API. (or the same message ending for your bot type.), the connector skips those children instead of aborting. The block’s own text and the rest of the page are kept, and a warning logs the block id and type, never content. This only applies to the first request of a block’s children listing. Any other wording, any other error, a failed page or table listing, or an error on a later page of a listing still aborts the run.- Incomplete pages: a page stored without such children is counted in
pages_incompleteofcognee_sync_stats. The marker lives in the sync state, not in the row or its content hash, so the page is re-rendered when it turns incomplete or complete, not on every run. Nested text that was ingested before a block became unreadable is dropped in that run: the document holds what the API returns. A block skipped inside a synced copy is logged but does not mark the page. - Withheld deletions: a page that disappears from below an incompletely read page may only be hidden behind the unreadable block, so it is not tombstoned. It and everything below it are kept as stored and counted in
deletions_withheld, with a warning naming the ids. The run continues and its state advances. Once the tree reads completely, pages that are really gone are forgotten. Items the run itself proved gone (403/404, archived or trashed, or a row missing from a data source it queried to the end) are never withheld.
Limitations
- Data sources over 10,000 rows abort every run: Notion cuts a query off there, and syncing only the first 10,000 would forget the rest.
- The walk holds the dlt staging lock of its dataset and pipeline, so while a large tree syncs, every other dlt ingestion into the same dataset waits.
- Teamspaces are not exposed by Notion’s public REST API, so pages are grouped by selected root, never by teamspace.
- Text shown from other objects goes stale: a page is only re-rendered when it changes itself, so sub-page and database titles, synced copies, and mentions stay as they were until the page is edited.
- Pinned to Notion API version
2025-09-03, the first with data sources as first-class objects.
Obsidian connector
Obsidian connector
obsidian_source() syncs a local Obsidian vault (a folder of Markdown notes) into Cognee memory. Each *.md note becomes one document whose id is its path in the vault, and it takes the document-mode path with the source tag obsidian. Unlike cognee.remember("<vault folder>"), which stores each note once, an edited note replaces its old document and a deleted or renamed note is forgotten on the next sync.Setup
Nothing to install. The connector is bundled with the Cognee SDK and needs no extra, no account, no token, and no network access: it reads files from a folder on the machine that runs it. It is SDK only: there is no hosted integration for it, because nothing hosted can reach a vault on your disk.Pass your vault’s folder asvault_path, and folders=[...] to read only some folders.Example
This script builds a small vault in a temporary folder, syncs it, edits two notes and deletes another, then syncs again and asks the same question after each sync.title names the note and its tags become node sets (obsidian:tag:engineering). On the second sync only the two edited notes are extracted again, and the deleted note is forgotten, so the old answer (Ada Lovelace leads Project Atlas) does not come back. prune_data() and prune_system(metadata=True) wipe the whole Cognee instance, every dataset, not just this one: run the script against a throwaway instance (a scratch SYSTEM_ROOT_DIRECTORY and DATA_ROOT_DIRECTORY), and remove those two calls before pointing it at memory you want to keep.Parameters
obsidian_source() accepts these keyword-only parameters:The returned resource is preconfigured with
primary_key="id", write_disposition="merge", and a _deleted hard-delete column.folders is a non-empty list or tuple such as ["Projects/Work", "Journal"], sorted and deduplicated. A bare string, an empty list, an absolute path, a folder name starting with a dot, a backslash, or surrounding spaces is a ValueError when the source is built, because each would select nothing and the next run would forget every note.The default resource_name follows the vault path. Moving or renaming the vault folder changes it, so the next sync ingests every note again under the new name, while documents synced under the old name stay until you forget them. Pass a resource_name to pin it. Two sources over the same vault with different folders share the default name, one table, and one state, so each run forgets the notes the other selected: put them in two datasets, or give each its own resource_name.What Is Ingested
Only regular*.md files under the vault, or under the selected folders. Not read: anything whose name starts with a dot (.obsidian, .trash, .git, hidden files such as ._note.md), other file types (attachments such as images and PDFs are ignored; an embed of one stays as the text you wrote), symbolic links (a linked folder is not entered), FIFOs, and device files. A note becomes one row:- Tags come from the frontmatter
tagskey, or the oldertag, as a list or a single string (one tag, not split on commas). A leading#is dropped; non-string entries are skipped. Inline#tagsin the body,aliases, and other properties are not read, and[[wikilinks]]stay text rather than becoming edges. Scope a recall to tagged notes withnode_name=["obsidian:tag:work"]. Adding, removing, or renaming a tag re-ingests the note. - Frontmatter that cannot be parsed, is not a YAML mapping, or is not closed costs the note only its title and tags; it still syncs with its text unchanged.
- Structure: each folder is
{"kind": "folder", "id": "<folder path>", "name": "<folder name>"}(see Connector Modes). After each cognify, each note gets achild_ofedge to its folder and each folder to its parent; folders becomeStructureContainernodes.
How Sync and Forget-on-Delete Work
- No cursor: every run walks the whole selection and reads every note. A note whose text did not change makes the same row, Cognee recognises its content hash, and nothing is extracted again, so a quiet sync costs file reads and no LLM calls. File times are never used.
- Forgotten notes: a note an earlier run published that a complete listing no longer contains is emitted as a
_deletedtombstone. That covers deleted notes, renamed or moved notes (the new path is a new document; renaming a folder does this to every note in it), and notes outside a narrowedfoldersselection. - State: dlt resource state holds the ids of the notes the last complete run published. It is written after the last row, so a run that raises keeps the old state.
Errors
The listing is complete before the first row is published, so a run aborts before anything is synced or forgotten when:vault_pathis no longer a directory when the run starts:ObsidianVaultUnavailableError;- the vault root has no entries at all (not even
.obsidian) although an earlier run published notes. A drive or mount that did not come up looks exactly like this:ObsidianVaultUnavailableError. To forget everything on purpose, leave one file or folder in the vault; - a folder inside the vault cannot be listed:
ObsidianListingError, naming the folder relative to the vault; - a selected folder is a file, or exists on disk only under another spelling (letter case, Unicode form, a symbolic link):
ObsidianListingError.
failed and failed_read.source.cognee_sync_stats holds counts only: synced (notes read and published), deleted (tombstones), and failed / failed_read (unreadable notes; equal today). A normal return can still have skipped notes, so check failed after each run. An empty dict means dlt resumed a pending load without extracting this resource: build a fresh source and run again.Limitations
- A vault with entries but no notes forgets everything it published before, and so does a
foldersselection whose folders are all gone from disk. A selected folder that does not exist forgets its notes without an error, because a folder deleted on purpose must forget them; once it has no notes left, every run logs a warning naming it until you remove it fromfolders. - The Unicode form (NFC or NFD) of a file name is part of the note id, so a sync tool that changes it re-ingests every note and forgets the old ones.
- Only one active sync per vault and dataset is supported. A large vault is read in full on every run, one note at a time.
- To erase a note for good, delete it in the vault (or move its folder out of
folders) and sync:cognee.forget()alone leaves dlt’s staged copy (dlt_database_<dataset>) and the dlt state, and the next sync under the same dataset andresource_namerebuilds it. dlt deletes each load package once it has loaded, but a failed package, under~/.dltof the process, keeps its text until the retry.
OneNote connector
OneNote connector
The OneNote connector syncs one selected OneNote notebook (its sections, nested section groups, and pages) into cognee memory through Microsoft Graph, incrementally, and forgets a page when Graph gives proof that it was deleted. One source is one notebook: to sync several notebooks, build one source per notebook id. Privacy and
dlt state stores a hash of the account and notebook, page ids, and a fingerprint per page, never page text. Older releases kept the parsed text of pages a cut-short run had fetched in a
onenote_source() returns a dlt resource you hand directly to cognee.remember(), so it takes the document-mode path (its source tag is onenote): each page becomes a text document that goes through normal chunking and LLM graph extraction.Setup
The OneNote connector is bundled with the Cognee SDK. It useshttpx, which a plain cognee install already brings, and beautifulsoup4, which it does not: install it with pip install beautifulsoup4 (the cognee[scraping] extra also includes it). Without it, the first page the connector fetches fails with an ImportError, which remember() surfaces wrapped in a DLTIngestionError. It needs a core with DOCUMENT_SYNC_VERSION 3 or later and raises a RuntimeError on an older one.Bring a delegated Microsoft Graph access token with the Notes.Read permission. OneNote’s API does not support app-only access. The connector never signs in and never refreshes a token: pass a token string, or a zero-argument callable that returns a valid token for the same account on every call. Only the public-cloud graph.microsoft.com endpoint is supported.Example
list_onenote_notebooks(token, *, http_client=None) reads only notebook metadata, never page content. Any write_disposition other than merge stops the sync before any request: the connector raises a ValueError, which remember() surfaces wrapped in a DLTIngestionError.Parameters
onenote_source() accepts these parameters:What Is Ingested
- One document per page. Rows are
{id, title, content, url, cognee_structure}: the Graph page id (the primary key), the page title (Untitledwhen empty), the page’soneNoteWebUrl, and the page’s HTML body as plain text. - Images and attachments are not downloaded. Images become
Image: <alt text> (<reference>)and attachmentsAttachment: <name> (<reference>)lines; links keep their target in parentheses. Handwriting and text inside images are not read. - Structure: each row carries
cognee_structure(see Connector Modes), nearest parent first: the section, its section groups from the innermost out, then the notebook, each with its Graph id and name. After each cognify these becomechild_ofedges, Notebook ← Section ← Page, with the containers asStructureContainernodes. Renaming a notebook, section, or section group, or moving a page to another section, keeps every page’s document id and runs no extraction again; only thechild_ofedges change. - No node set: rows carry no
cognee_node_set. People named in a note are text, not typed entities.
How It Works
- Fingerprints: Graph has no delta feed for OneNote, so every run lists the whole notebook (metadata only) and compares each page with what the last complete run published. A page is fetched and published only when it is new or its fingerprint changed: its
lastModifiedDateTime, title, link, or the notebook, section groups, and section above it. Unchanged pages are neither fetched nor published again, so a quiet sync extracts nothing. Renaming or moving a container costs one HTML request per page below it, but no re-extraction. - All or nothing for deletions: deletions are published only after the complete notebook was read and validated. An expected failure (a Graph error, a rate limit, a spent
max_requestsbudget, malformed metadata, or an unreadable page) returns normally withfailed > 0andcomplete == 0, deletes nothing, and checkpoints progress, so the next run resumes without repeating it. A run cut by an interruption (themax_requestsbudget, a rate limit, or a 5xx or transport error that used up its retries) still publishes the pages whose bodies it fetched and records their fingerprints, so the next run skips them and a notebook larger than the budget finishes over a few runs. Page bodies are never kept in state, so a run cut by anything else (for example, malformed metadata) publishes no pages and fetches them again next time. A failure ofcheck_activeor of a token callable raises unchanged. - A malformed page blocks its notebook: a page whose
idorlastModifiedDateTimeis missing or blank, or whosetitleis missing or not a string, fails the run before anything is published. Fix or remove the page and the next run recovers.
Deletions
A page that was synced and is missing from a complete listing is read once more. It is forgotten only when:- Graph answers 404 or 410 with code 20113 (“the resource specified in the request was deleted”), or
- the page still exists but now belongs to another notebook (a positive move).
unresolved stat; the rest of the notebook syncs normally, and the run still reports complete == 1 and failed == 0. Such pages are asked about again in later runs with whatever request budget is left over. A page stops being unresolved once it is listed again or Graph answers 20113 for it. A host that must notice these pages should watch unresolved, because nothing else in the stats changes.Deletions are emitted as _deleted tombstones. A notebook you stop syncing keeps its memory.Which of the two codes Graph returns for a page deleted inside a notebook that still exists has not been checked against a live account; the connector has not been run against a live Microsoft account. If Graph answers 20102 for such a page, it stays in memory (counted in
unresolved) until Graph answers 20113 for it. cognee.forget() only removes it until the next sync; see Privacy and forget() below.Sync Stats
After a run, thecognee_sync_stats dict on the returned resource holds counts only: scanned (pages seen), skipped (pages unchanged since the last sync), deleted, failed, failed_rate_limit, failed_budget, unresolved, requests, and complete (1 only when the whole notebook was read and published). An empty dict means dlt resumed a pending load without extracting this resource: build a fresh source and run again.Limits and Retries
- Request budget: Microsoft Graph throttles OneNote at 120 requests per minute and 400 per hour per app and user. The connector makes one request at a time, and the default
max_requests=300keeps one run under the hourly allowance. It counts every attempt, retries included, and is not an hourly limiter, so several notebooks or other apps of the same user share the 400. A very large notebook can need several runs; if listing alone spends the budget, raisemax_requests. - Retries: a 429, 500, 502, 503, or 504 is retried up to five attempts in total with a 1, 2, 4, 8 second fallback; a
Retry-Afterheader is honoured when present. The total sleep of one sync is capped at 60 seconds (RETRY_WAIT_BUDGET_SECONDS), because the walk holds the dlt staging lock of its dataset and pipeline; once it is spent, the run stops cleanly (failed_rate_limitfor a 429) and resumes next time. - Redirects are never followed, and every URL, paging links included, must be under
https://graph.microsoft.com/v1.0/me/onenote/. - Tokens: a 401 stops the run with
failed > 0; refresh the token and run again. Surrounding whitespace is stripped from the token, and a token with whitespace inside is refused before any request. The token is never logged, stored, or put in an error; errors carry a status and a Graph code, never a response body.
Privacy and forget()
dlt state stores a hash of the account and notebook, page ids, and a fingerprint per page, never page text. Older releases kept the parsed text of pages a cut-short run had fetched in a pending state entry; the first run after upgrading drops it, so those pages are fetched once more. If the staging table is deleted while the dlt state is kept, unchanged pages are not published again and stay missing until they change; forgetting the table through empty_resource deletes both together (see Cleaning Up dlt’s Staging Data). dlt’s staging database for the dataset (dlt_database_<dataset>) holds the rendered text of every page. dlt’s load packages, with the rendered text of each row, live under ~/.dlt of the process; dlt deletes each one once it has loaded, but keeps a failed one for the retry.Limitations
- One notebook per source, and one active sync per account and dataset.
- Paging uses
$skip, so a page created while another is deleted mid-walk can be missed for one run; the next run picks it up. - Images, attachments, and handwriting are not read.
- Not yet verified against a live Microsoft account.
Slack connector
Slack connector
slack_source() reads one channel of one Slack workspace with a bot token. A thread (a message with replies) becomes one document, and the messages without replies of one UTC day become one document for that day.This is the connector you drive from your own code with a bot token you hold. To ask, save and recall Cognee memory from Slack itself, see the Slack integration.Setup
The connector is part of the Cognee SDK (Cognee 1.6.8 or newer) and needs no extra.- Create a Slack app at api.slack.com/apps with the bot scopes
channels:history,channels:readandusers:read(groups:historyandgroups:readfor a private channel), install it into your workspace, and copy the bot token (xoxb-...). - Invite the app to the channel (
/invite @YourApp). - Export
SLACK_BOT_TOKEN,SLACK_TEAM_ID(T...) andSLACK_CHANNEL_ID(C...).
Example
This script syncs one channel into theslack_channel dataset and asks it a question.prune calls so the demo is reproducible: remove them before you run it again, or every document synced so far goes through graph extraction again. recall() is scoped to the channel’s node set, slack:channel:<channel id>.What a Sync Reads Again
Later syncs render again only the threads and days that changed: a new message or reply, or an edited top-level message. An edited reply is read again only when the host passes its thread inchanged_roots, a slack_source() argument, which the Slack integration does from Slack’s message events.Run Budget
A large channel finishes its first sync over several runs. Each run stops aftermax_requests Slack API requests (1500 by default, a slack_source() argument) or 600 seconds, and the next run resumes where it stopped. A run cut short by the request budget or a rate limit reports failed_budget or failed_rate_limit in cognee_sync_stats.Deletions
A message deleted in Slack is forgotten on the sync that next walks the whole channel. Deletion happens only on a complete walk: a run cut short forgets nothing.Telegram connector
Telegram connector
telegram_source() reads the messages a bot sees in the groups, supergroups and channels it is in. One source is one bot token, and each message with text or a caption becomes one document.Setup
The connector is part of the Cognee SDK (Cognee 1.6.9 or newer) and needs no extra and no separate package: the Bot API client uses the standard library’surllib. It needs a core with DOCUMENT_SYNC_VERSION 3 or later and raises a RuntimeError on an older one.Auth is a bot token from @BotFather. Telegram has no OAuth for bots, so there is no authorize step and no token to refresh; a token does not expire, and a revoked one surfaces as failed_auth. The connector never reads the token from the environment: pass it as token.- Create a dedicated bot with @BotFather and copy its token. Updates are read with
getUpdates, which fails with HTTP 409 while the bot has a webhook or while another process polls it. The connector never deletes a webhook. - In @BotFather run
/setprivacyand choose “Disable”, or make the bot an admin of the chat. In groups a bot only sees what privacy mode allows: commands and replies to it. The connector logs a warning when privacy mode is on and reports it asprivacy_mode=1in the sync stats. - Add the bot to your group, then send a few messages. A bot only sees messages sent after it joined: there is no history backfill.
- Export the token:
export TELEGRAM_BOT_TOKEN="123456789:AA..."
Example
This script syncs one page of updates into thetelegram_chat dataset and asks the chat a question.prune calls before syncing for real. Each run reads the next page of updates. The script is also in the Cognee repository as examples/guides/telegram.py.Parameters
write_disposition="merge" is the resource’s own default. Never pass "replace": Telegram never sends an old update again, so it would wipe every message of earlier syncs.telegram_source() accepts these keyword-only parameters:Pass
token or service, not both. A bare string for chats, an empty list, a blank entry, a t.me/ link, or a token of the wrong shape raises ValueError when the source is built (the token is never echoed). Building the source makes no request.A @username names a chat, not a name: the first time it is seen (or looked up with getChat at the start of the run), it is bound to that chat and keeps selecting it through renames, and another chat that later takes the freed username is not selected by it. A private chat is selected by id only. For the full binding and rename rules, see the connector README.Hosts. The connector is registered as the telegram provider in _PROVIDERS (cognee.modules.integrations.ingestion), an API-key-style provider whose service builder wraps the token the user pasted and whose error classifier (classify_sync_error) maps a raised run to its stats key. Key each connection by telegram_account_id(service, check_active=...), the bot’s id from getMe: a connection whose stored state belongs to another bot is refused with failed_bot_mismatch on every run.What Is Ingested
- One document per message that has text or a caption. Rows are
{id, title, content, url, cognee_node_set, cognee_structure}. idis<chat id>:<message id>(message ids are only unique inside a chat).titleis<first line> (<chat> #<message id>), the first line shortened to 80 characters.urlishttps://t.me/<username>/<id>for a public chat,https://t.me/c/<id>/<id>for a private supergroup or channel, and none for a basic group or a private chat.contentis a header block (Chat:,From:, thenHandle:,Date:,Forwarded from:,Edited:,In reply towhen they apply), a fixed--- message ---line, then the text. No numeric user id or phone number is rendered. A quoted reply is cut at 200 characters.- Media is not downloaded. A media message is its caption, prefixed with its kind (
[photo] ...). Service messages (joins, pins) and media without a caption are skipped. - Node set and structure: each row carries
cognee_node_set["telegram:chat:<root chat id>"], so arecall()can be scoped to one chat withnode_name=["telegram:chat:-1001234567890"], andcognee_structurewith the chat as its container, so each message gets achild_ofedge to a chatStructureContainer. Both use the root of the chat’s upgrade chain, so a group upgraded to a supergroup stays one chat.
How It Works
- One page per run: a run calls
getMe,getChatonce per selected@usernamenot bound yet, and thengetUpdatesonce, for up to 100 updates (the Bot API maximum). Asking for the next page confirms the previous one, so a run never asks for a second page: its updates are confirmed by the next run, whose offset comes from the state dlt saved with this run’s rows. A run that stops or raises saves no state, and the next run reads the same page, so nothing is lost. - Edits arrive with the same message id and replace the row. An edit that removes the text (a caption deleted from a photo) tombstones the message.
Deletions
Forget-on-delete is per chat. Only three things forget data: the bot being removed from a group, supergroup, or channel; an edit that takes the text away; and a chat leaving your selection (chats narrowed, or include_private turned off). A user blocking the bot in a private chat forgets nothing.Deleted messages and deleted chats stay in memory. The Bot API sends a bot no event when a message is deleted, and none is known for a deleted chat. Remove such data yourself: take the chat out of chats, remove the bot from the chat, or forget it.cognee.forget(data_id=...) removes one message from memory, but its staging row stays and the next sync builds it again; remove the chat from the selection, or the bot from the chat, instead. For Telegram the staging table is the only copy of the corpus, since Telegram never delivers an update twice, so forget(dataset=...) followed by a sync rebuilds every message as of the last sync. To erase a whole dataset, call drop_dlt_dataset after forget(dataset=...).Sync Stats
After a run,source.cognee_sync_stats holds counts only, with every key present:scanned(message rows emitted),deleted(tombstones), andskipped(updates that became no row, always the sum of the four reason keys that follow).skipped_unselected(messages of a chat outside the selection),skipped_unsupported_type(a message of a kind other than text with no caption),skipped_empty_content(a service message or a blank text),skipped_unread_update(an update of a type the connector does not ask for).privacy_mode:1whengetMereturnscan_read_all_group_messagesas JSONfalse. It is meaningful only on a run withfailed0, since a run that fails before or atgetMe, or withfailed_bot_mismatch, leaves it 0.backlog:1when the run read a full page and more updates may be waiting.gap: update ids that may have been lost, counted only when the last update the connection saw is more than 24 hours old.failed, and one reason key per failure:failed_auth(token rejected),failed_conflict(HTTP 409: a webhook or another poller),failed_rate_limit,failed_unavailable(5xx or no answer after retries),failed_provider(any other Telegram-side failure; the run raises),failed_unexpected(a defect of the source, raised asTelegramUnexpectedError), andfailed_bot_mismatch(the state belongs to another bot).
Limits and Retries
- Throughput: one page per run means at most 100 updates per run per bot, and Telegram drops undelivered updates after about 24 hours. Sync at least hourly for chats with more than 100 messages a day; a daily sync keeps up with 100. A run that read a full page reports
backlog=1and logs a warning; when it repeats, sync more often or updates will be lost. A nonzerogapis a possible loss, not proof. - Retries: each request makes up to 5 attempts, with Telegram’s
retry_afteron a 429 and a 1, 2, 4, 8 second backoff on a 5xx, no answer, or a 429 without a usableretry_after(NaN, a negative value, or anything that is not a number). Aretry_afterbeyond the largest float (Infinity included) fits no budget, so the run stops withfailed_rate_limit. The total sleep of one run is capped at 60 seconds, because the walk holds the dlt staging lock of its dataset and pipeline; a wait that does not fit stops the run withfailed_rate_limit(failed_unavailablefor a 5xx) and delays the sync without dropping anything. Each request has a 30 second socket timeout. - One bot, one connection: two connections polling the same bot steal each other’s updates. Several bots in one chat each need their own
resource_name(the default already differs per bot), and synced into one dataset they give one document per message per bot.
Limitations
- No history backfill: a bot sees only messages sent after it joined.
- Deleted messages and chats are not forgotten (Bot API limit).
- Media files are never downloaded.
- This port has not been run against a live bot; the community connector it was ported from was.
Vercel connector
Vercel connector
vercel_source() reads one Vercel project: the project, each of its deployments and, if you ask for it, the build output of its failed deployments. Each one becomes a document, with a deployment’s environment, state, branch, commit sha, commit message, author login and error code in its first lines. It never changes anything in Vercel.Setup
The connector is bundled in the Cognee SDK (Cognee 1.6.9 or newer) asfrom cognee.tasks.ingestion.connectors import vercel_source and needs no extra.It is also its own package on PyPI, cognee-connector-vercel. The base install has no Cognee runtime, and the cognee extra adds Cognee (cognee>=1.6.5,<2) to ingest into it. It supports Python 3.10 to 3.14:from cognee_connector_vercel import vercel_source. It needs a Cognee host with DOCUMENT_SYNC_VERSION 3 or later (Cognee 1.6.6rc1 or newer). The cognee extra still accepts Cognee 1.6.5, so upgrade an existing 1.6.5 install. On an older host it raises a RuntimeError before it contacts Vercel. The package exports vercel_source, build_vercel_service, and CONNECTOR. Hosts discover CONNECTOR through the cognee.connectors entry point and vercel_source through cognee.sources. CONNECTOR describes an API-key connector: there is no OAuth flow, no credential store, and no cognee.integrations entry point, and it does not list projects. You supply the token and name the project and its team or account yourself.To run the example:- Create a Vercel access token at vercel.com/account/tokens, scoped to the team, with an expiry.
-
Find the project id (
prj_...) under the project’s Settings → General. -
Export the credentials the script reads:
Example
This script syncs one project into thevercel_demo dataset, asks which deploy failed and why, then syncs and asks again. Run it after a failed deploy to see the error in the answer.team_id for a team project, or account_id with your user id for a personal (Hobby) account. Because the state, error code and commit are in each deployment’s text, the answer can name the failed deploy and the commit behind it. On the second run nothing changed at Vercel, so every row is skipped and nothing is extracted again.Parameters
write_disposition="merge" is the resource’s own default; passing it is harmless (with the standalone package on Cognee before 1.6.8, pass it). To sync several projects of one team into the same dataset, use one source per project, each with its own resource_name, and keep one dataset per team (or personal account).vercel_source() accepts these keyword-only parameters:Sync and Deletions
A re-sync extracts only the deployments whose text changed, so an unchanged project costs no LLM calls. A deployment Vercel deletes leaves memory on the next sync; it is never forgotten just for being old.For the documents and fields it reads, how a sync resumes, deletion handling, sync stats, and error handling, see the package README.dlt (Data Load Tool)
How dlt sources, write dispositions and document-mode rows work
Integrations
Connect accounts to a running Cognee server through OAuth
Remember
All
remember() parameters, including the dlt optionsForget
Remove a synced dataset when you are done