I built a Chess.com connector for Cognee so my AI agent remembers my games
说明与用途
为 Cognee 构建了 Chess.com 连接器,使 AI 能够分析用户的棋局数据。
问题
I couldn’t query my Chess.com game history for insights without manually browsing archive pages.
结果
The connector successfully ingests Chess.com game data into Cognee, allowing AI queries about openings, losses, and rating trends.
工作流
- 1. Identify public Chess.com API endpoints for archives and games.
- 2. Handle Cloudflare 403 by adding a realistic User-Agent header.
- 3. Implement two‑level fetch: list archives, then fetch last N months of games (default 12).
- 4. Convert each game to a markdown document with stable ID "chesscom:
<game-uuid>". - 5. Extract title, result, ratings, date, opening, accuracy, and PGN.
- 6. Handle null accuracies and zero‑archive accounts gracefully.
- 7. Run test suite (6 tests) to verify ingestion and sync.
- 8. Deploy connector in Cognee community repo and sync user data.
证据
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
Each game becomes one markdown document with a stable ID chesscom:<game-uuid> so unchanged games are never re-ingested
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.
- 记录日期: 2026-10-25T12:11:32.952Z