Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Zero Code Execution: Building a Safe Jupyter Notebook Connector for Cognee GraphRAG

Описание и применение

Коннектор безопасно парсит ноутбуки Jupyter, удаляя исполняемый код, шумные выводы и секреты, и автоматически очищает устаревшие узлы графа.

Задача

Ingesting Jupyter notebooks into enterprise knowledge graphs risks code execution, noise bloat, and stale entities.

Результат

The connector enables secure, noise‑free ingestion of notebooks into Cognee’s GraphRAG, preserving data integrity and privacy while automatically cleaning stale graph entities.

Рабочий процесс

  • 1. Read .ipynb as raw JSON with json.load (no kernel).
  • 2. Extract cells: markdown, code, outputs.
  • 3. Strip Base64 images and ANSI escape codes; truncate long outputs.
  • 4. Apply regex redaction for API keys, PATs, AWS keys, bearer tokens.
  • 5. Generate dlt document with cognee_document_source='jupyter'.
  • 6. Ingest into Cognee; entity extraction via LLM; store in graph and vector DB.
  • 7. On notebook deletion, use write_disposition='replace' to trigger forget-on-delete cleanup.

Доказательства

Ingesting external notebooks that contain untrusted Python or shell magics risks accidental code execution

Источник

Base64-encoded PNG/JPEG plots are stripped entirely from outputs

Источник

The connector runs a compiled regex redaction pipeline over all Markdown prose, code blocks, and output buffers

Источник

  • Дата записи: 2026-11-02T06:13:45.259Z