Before You Start
- Complete Quickstart to understand basic operations
- Ensure you have LLM Providers configured — the script calls
cognee.recall(), which needs an LLM for the final completion - Read Datasets — the folder is synced into the
my_dropboxdataset - Create a Dropbox app at dropbox.com/developers/apps with the scopes
files.metadata.read,files.content.readandaccount_info.read, and generate an access token for your account on its 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— or leave it empty to sync the whole Dropbox - No extra to install: the connector’s client is
httpx, a core dependency
Code in Action
What Just Happened
Step 1: Create the Dropbox Source
dropbox_source() returns a dlt resource for one folder, read with your access token. dropbox_account_id(token) looks up the token’s account so the sync state is tied to it, and resource_name names the staging table and the cursor that make later runs incremental — use one name per folder and account. It must start with dropbox_ and hold only lowercase letters, digits and single underscores (at most 63 characters), or dropbox_source() raises ValueError.
Step 2: Sync the Folder
remember() extracts every supported file, chunks it, and builds the graph. primary_key="id" keys each row by its Dropbox file id and write_disposition="merge" upserts on that key; together with the stored cursor, running the script again processes only what changed and forgets deleted or moved-out files. source.cognee_sync_stats reports the run’s counts — check them, since a normal return alone does not prove the sync finished: a run is complete when failed == 0 and complete == 1.
Step 3: Recall From the Folder
recall() scoped to the my_dropbox dataset can answer questions about them.
Dropbox
Connect an account over OAuth instead, plus what gets indexed and the sync’s limits.
dlt (Data Load Tool)
The dlt ingestion path the connector builds on, including write dispositions.
remember()
Every option
remember() accepts when ingesting a source.