Inspiration

Cognee gives AI agents memory by turning your data into a knowledge graph. Its Google Calendar connector lets an agent answer questions like "what did I agree to in last week's design review?". While reading the connector for Mergetober, I noticed it keyed everything on the calendar id string you configure.

What it does

In Google Calendar your main calendar has two names: the alias "primary" and its real id, your email address. The connector's own helper script lists calendars by real id, so GOOGLE_CALENDAR_IDS=primary,[email protected] is an easy setup to end up with, and the connector then stored every event twice (gcal:primary:<id> and gcal:[email protected]:<id>). That meant double the LLM calls during cognify and duplicate facts in memory.

The fix treats both names as one calendar and keeps the first spelling configured, so existing ["primary"] setups don't change at all, and duplicates left by earlier syncs are forgotten on the next run.

How we built it

Challenges we ran into

With ~500 connector proposals already filed this month, a new connector wasn't realistic, and the first bug I reported (all-day events stored one day too long, cognee#6470) was fixed by someone else within hours. So I opened the PR and the issue together for this one.

What we learned

Aliases are identity bugs waiting to happen: whenever an API gives one thing two names, anything keyed on the raw string can split it in two.

What's next

Respond to maintainer review on #587 and get it merged.

Blog post: https://dev.to/shermaineyap/one-calendar-two-names-fixing-duplicate-memories-in-cognees-google-calendar-connector-3593

Built With

Share this project:

Updates

Submission history