Skip to content

feat: replace NotebookLM with Gemini Deep Research in ingest cron#629

Merged
codercatdev merged 2 commits intodevfrom
feat/ingest-gemini-research
Mar 5, 2026
Merged

feat: replace NotebookLM with Gemini Deep Research in ingest cron#629
codercatdev merged 2 commits intodevfrom
feat/ingest-gemini-research

Conversation

@codercatdev
Copy link
Contributor

Summary

Phase 2 Sprint 3, Task 6: Replace NotebookLM research submission in the ingest cron with Gemini Deep Research via submitResearch() from lib/services/gemini-research.ts.

Changes

app/api/cron/ingest/route.ts

Removed:

  • NotebookLMClient and initAuth imports from lib/services/notebooklm/
  • enableNotebookLmResearch config lookup
  • Entire NotebookLM Step 2 block (~25 lines): notebook creation, source URL adding, research task starting
  • researchMeta: { notebookId, taskId } variable and all references
  • researchNotebookId and researchTaskId fields from Sanity document creation

Added:

  • import { submitResearch } from "@/lib/services/gemini-research"
  • enableDeepResearch config lookup (from pipelineConfig singleton)
  • Simplified Step 2: single submitResearch(topic, { sourceUrls }) call (~12 lines)
  • researchInteractionId variable — stores the interaction ID for polling by check-research cron
  • researchInteractionId field on automatedVideo Sanity document

Updated:

  • createSanityDocuments signature: researchMeta param → researchInteractionId?: string
  • isResearching check uses !!researchInteractionId
  • Response JSON: researchInteractionId instead of researchNotebookId

sanity/schemas/documents/automatedVideo.ts

  • Added researchInteractionId field (string, hidden) — Gemini Deep Research interaction ID for polling
  • Kept researchNotebookId and researchTaskId for backward compatibility with existing documents

Files changed (2 only)

  • app/api/cron/ingest/route.ts
  • sanity/schemas/documents/automatedVideo.ts

How it works

ingest cron → discoverTrends → dedup → submitResearch(topic, { sourceUrls })
  → returns interactionId → stored on automatedVideo doc (status: "researching")
  → check-research cron polls via pollResearch(interactionId) [Task 5, @research]

- Remove NotebookLMClient and initAuth imports
- Add submitResearch() from lib/services/gemini-research
- Replace enableNotebookLmResearch with enableDeepResearch config
- Replace NotebookLM notebook creation with submitResearch() call
- Store researchInteractionId on automatedVideo (replaces notebookId)
- Add researchInteractionId field to automatedVideo schema
- Keep old research fields for backward compat with existing docs
@vercel
Copy link

vercel bot commented Mar 5, 2026

Deployment failed with the following error:

Resource is limited - try again in 8 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/alex-pattersons-projects?upgradeToPro=build-rate-limit

The word 'production' in string literals was replaced with
[REDACTED SECRET: NEXT_PUBLIC_SANITY_DATASET] by the sandbox
redaction system. Fixed in both files.
@codercatdev codercatdev merged commit 54e765c into dev Mar 5, 2026
0 of 2 checks passed
@codercatdev codercatdev deleted the feat/ingest-gemini-research branch March 5, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant