ai newsSo., 25. Okt.
EilmeldungStudie von Anthropic: KI-unterstuetztes Lernen brachte Devs 17 Punkte weniger ein, Junioren sollten zuerst solo coden

I built a Chess.com connector for Cognee so my AI agent remembers my games

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 Merg

dev.toSonntag 12:30 · 25.10.2 Min. Lesezeit
Bild: dev.to

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.

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.

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Enter fullscreen mode Exit fullscreen mode 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."

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:

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 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:

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.

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

Quelle: dev.to (dev.to). Original öffnen