I play Chess.com. Four months of rapid games, a Bronze-league rating, openings I keep losing, blunders I keep repeating — and all of it locked inside the Chess.com app. I can't ask it "which openings do I lose most as Black?" without clicking through archive pages like an archaeologist. So for Mergetober I built a data-source connector that feeds a public Chess.com profile straight into Cognee's memory layer. Personal AI chess coach: unlocked.
The wall: Cloudflare
Honest version of how this started: my first API call returned literally nothing — empty response, json.tool choking on char 0. The status code told the story: 403, Cloudflare's "Just a moment..." challenge, hitting every default request. The docs said the public API is open; the edge said prove you're a browser.
One header fixed it:
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
403 → 200. That single header is now baked into every request the connector makes (and the retry loop honors 429 Retry-After, because politeness scales better than speed). Lesson one of this build: the API that answers is the API you can build on — and "open" sometimes means "open to browsers."
How the connector works
It mirrors the dlt-based pattern from my GitHub (PR #228) and AniList (PR #279) connectors: six files under packages/connector/chesscom/, no auth (public profiles only, username param or CHESSCOM_USERNAME), and a two-level fetch — archives list, then the last N months of games (months_back, default 12, with ~1s spacing between requests).
Each game becomes one markdown document with a stable ID chesscom:<game-uuid> so unchanged games are never re-ingested:
- Title:
Rapid vs goodboyrip (loss)— time class, opponent, result from my perspective (computed by matching my username against white/black — both colors' result codes mapped to win/loss/draw, including the draws people forget:agreed,repetition,stalemate,50move,insufficient) - Content: result, both ratings, date from
end_time, opening parsed from the ECO URL (Kings-Pawn-Opening→ "Kings Pawn Opening"), accuracy when the API has it, and the full PGN
Two defensive details a reviewer will check: accuracies can be null (the connector skips the section instead of crashing), and an account with zero archives yields zero rows instead of returning None and blowing up dlt. The test suite proves the rest: 6 tests green, including test_pipeline_sync_edit_forget — play a new game, re-sync, and it shows up.
The real-world use: my agent knows my chess now
The live smoke test ran against my own account (manthan267): 200 OK, my archives, real games with real PGN flowing through. Once that's in Cognee, the questions get interesting:
- "What openings do I lose most as Black?"
- "Show my worst rapid losses this month with the PGN."
- "How has my rating trended over my last 50 games?"
Chess.com can show me a game. It can't reason about all of them. Now my agent can — and it remembers everything else it knows about me, too.
What's next
PR is open: topoteretes/cognee-community#359 (proposal #5641). Same as the others — waiting on maintainer review in a repo with ~287 open PRs at the time of writing, no pressure. If you play Chess.com and want your agent to remember your games, the connector's there. Same series as my GitHub connector post: https://dev.to/one_piece/i-built-a-github-connector-for-cognee-so-my-ai-agent-remembers-all-my-repos-14h2
Repo: topoteretes/cognee-community · PR #359 · proposal #5641
Top comments (0)