Skip to main content
A call rarely says which team owns each task, when it is due, or which issue already tracks it. This agent fills those in from what it remembers: the team from an earlier call, the deadline from an email, the issue from Linear.

What You’ll Build

Your Granola calls, your Linear issues and your Gmail inbox go into one cognee memory. After your latest call, an agent lists the next steps everyone agreed to and fills in what the call left out from everything else it remembers. It posts the list to a Slack channel, or prints it when Slack is not set up. Building the memory takes three cognee.remember calls, one per source, and working out the next steps takes three cognee.recall calls. The complete cookbook is examples/cookbooks/company_brain/follow_up_agent/.

Try It on Sample Data

Two days ago, on a launch-readiness call, Omar agreed to move card payments to 3DS2, Sam to load-test the checkout API, and Lena to write the announcement. The call names no team and no deadline. An earlier call says which team each person is on, Linear already tracks Omar’s step as PAY-104, and an email from the bank sets the 3DS2 deadline. You need only an LLM key, no Granola, Linear, Gmail or Slack account. A sample run never posts to Slack.
LLM_API_KEY alone is enough for OpenAI, cognee’s default for both the LLM and the embeddings. Other providers, such as Anthropic, Gemini, Azure OpenAI, AWS Bedrock or a local model through Ollama, need a few more lines in the same .env: LLM Providers and Embedding Providers list them for each provider. Set both, because embeddings you leave at the default still need an OpenAI key.
None of the teams, dates or issues were said on the call. Payments and Platform come from the earlier call, PAY-104 and PLAT-88 from Linear, Sam’s due date from PLAT-88, and Omar’s from the bank’s email, because PAY-104 has none. The agent also kept Lena’s step after the other two, as she said, and gave it no issue because Linear tracks none. The first run has nothing to forget; a later sample run prints [clear] Forgot the dataset follow_up_agent instead. The sample is dated relative to today, so your dates and wording will differ.

Run It on Your Data

Granola is required. Linear and Gmail are optional sources: without one, its step is skipped. Slack is optional too: without it, the steps are printed instead of posted. Set up each one you use:
The cookbook reads your calls through Granola’s API with a personal API key. Creating one needs a Granola Business plan; on Enterprise, a workspace admin enables it first.
  1. In the Granola desktop app, open Settings → Connectors → API keys and click Create new key.
  2. Choose the Personal notes scope and click Generate API Key. Copy the key now; Granola shows it only once.
  3. Add it to .env at the repo root: GRANOLA_API_KEY="grn_...".
The API returns only notes that already have an AI summary and a transcript. Granola’s API docs list the other scopes.
  • credentials.json and token.json are git-ignored. Never commit them.
--check reports what is missing and which optional sources are skipped, without doing any work. The first Gmail run opens a browser so you can let it read your mail. Running it again skips content cognee already holds; add --clear to forget the dataset first and start over from your sources as they are now. Each script also runs alone, for example uv run python examples/cookbooks/company_brain/follow_up_agent/scripts/follow_up.py.

How It Works

Step 1: Start From an Empty Memory

Source: scripts/clear.py This step forgets what an earlier run remembered, so old copies never mix with new ones. It runs only with --clear, which a sample run turns on by default; --no-clear keeps the dataset.
The sample is dated relative to today, so each day’s sample differs from yesterday’s. Without this step, a second run would add today’s calls next to yesterday’s, and the agent could pick yesterday’s deadline. cognee’s part is one call: cognee.forget(dataset="follow_up_agent"), which deletes the dataset and everything extracted from it. On your own data, use --clear only to start over.

Step 2: Remember Your Calls

Source: scripts/ingest_granola.py This step saves your recent calls so the agent knows who works on what. It reads the calls from the last 30 days; pass --days N to change that.
The script reads each call from Granola’s API, with its attendees and transcript. With args.sample, it reads the sample calls instead; every ingest step works this way. cognee’s part is one call: cognee.remember, into the dataset follow_up_agent with node_set=["calls"]. remember turns text into a knowledge graph of people, teams and decisions. A dataset is the named memory everything goes into. A node set is a tag on what you remember, so you can later recall from that part alone.

Step 3: Remember Your Linear Issues

Source: scripts/ingest_linear.py This step saves the work your team already tracks, so the agent can say a step has an issue. It runs only when Linear is set up and you don’t pass --no-linear. It reads the issues changed in the last 30 days, not your whole workspace; --days N changes that too.
The script fetches the issues from Linear’s API and writes each one as a short text: identifier, title, status, team, assignee and due date. Then it calls cognee.remember with node_set=["linear"]. Writing the identifier into the text is what lets the agent copy PAY-104 exactly.

Step 4: Remember Your Inbox

Source: scripts/ingest_email.py This step saves your newest emails, because deadlines often arrive by email, not on a call. It runs only when Gmail is set up and you don’t pass --no-email. It takes the newest 50 inbox emails, not your whole mailbox; pass --emails N to change how many.
The script calls cognee.remember with cognee’s Gmail connector, gmail_source, as the input and node_set=["email"]. write_disposition="merge" with primary_key="id" merges emails by message id, so a rerun does not store the same email twice.

Step 5: Work Out the Next Steps

Source: scripts/follow_up.py This step reads your newest call from the last 30 days and lists its next steps, then posts them to Slack or prints them.
The agent is three cognee.recall calls. The first two use query_type=SearchType.CHUNKS with the call as the query: one with node_name=["linear"], one with node_name=["email"]. Each returns the three closest issues or emails as raw text, because they rarely rank in a search over the whole graph, and raw text keeps identifiers and dates exact. The third uses HYBRID_COMPLETION, which answers from the matching passages and the graph across all sources. It gets the call, those issues and emails, and NEXT_STEPS_PROMPT: take teams from earlier calls and issues, deadlines from emails, and never invent a date, a team or an issue.

Step 6: Browse the Graph

Source: scripts/ui.py This step opens the cognee UI so you can see the memory behind the answer. It runs only when you pass --ui.
The script starts cognee’s API server inside the same process, next to the databases the earlier steps opened, and then the UI with cognee.start_ui. Open http://localhost:3000 to browse the people, teams, issues and deadlines in the graph. Ctrl+C stops both. See Run the UI Locally for what the UI can do.

Make It Yours

  • Ask for more in each step. Edit NEXT_STEPS_PROMPT in scripts/follow_up.py to add a priority or the customer a step is for. Keep its last rule, so the agent still never invents a fact.
  • Post where your team works. The Slack post is one HTTP request at the end of follow_up in scripts/follow_up.py. Swap it for your chat tool’s API, or for a comment on the Linear issue.
  • Add another source. Write one more ingest script that calls cognee.remember with its own node set, such as a folder of specs or postmortems, and add it to run(). See Remember for the inputs it accepts.
  • Build a weekly team digest. Keep steps 2 to 4 and replace the agent with one HYBRID_COMPLETION recall with node_name=["calls", "linear"]: “What did the Payments team commit to this month, and what is still open?” Same memory, a different application. NodeSet Grouping shows how scoping works.

Clean Up

To start over completely, also delete sample/ and token.json in the cookbook folder.

Company Brain Q&A

Build another one: answer questions across your database, tickets and docs.

Personalized Email

Build another one: email replies that know what you promised.

Self-Hosted AI Companion

Build another one: a chat companion that remembers your notes.

NodeSet Grouping

Tag memories by source and recall from one part at a time.