# Extending Cognee with Native Video Understanding for Persistent AI Memory

Large Language Models have become remarkably good at understanding text, images, audio, and more recently, videos. Models such as Gemini can now watch a video and understand what is happening, who is speaking, what appears on screen, and even summarize the entire recording. However, understanding a video once is only part of the problem.

For AI agents to become truly useful in production, they need **persistent memory**. If an AI watches a meeting today, it should not need to watch the same meeting again tomorrow. Instead, it should remember important decisions, connect them with previous meetings, and continuously improve its understanding as new information arrives.

This is exactly the problem that [**Cognee**](https://www.cognee.ai/) is designed to solve. Cognee already supports persistent memory for documents, images, and audio by transforming them into knowledge graphs that agents can efficiently retrieve later. During the Cognee Hackathon, I wanted to explore whether the same architecture could be extended to support **videos** without redesigning the existing memory pipeline.

The result is a native video ingestion pipeline that converts videos into structured chronological knowledge, allowing them to become first-class citizens inside Cognee's persistent memory.

### Why Video?

A large portion of an organization's knowledge never becomes documentation.

It lives inside sprint planning meetings, architecture discussions, bug triage sessions, product reviews, technical presentations, screen recordings. These meetings contain valuable information like spoken discussions, visual presentations, shared screens, charts,participant names, decisions, action items. Most Retrieval-Augmented Generation (RAG) systems either ignore this information entirely or analyze the video once and discard the result.

I wanted to solve a different problem:

> **How can meeting videos become permanent memory for AI agents?**

### Existing Cognee Architecture

One thing I really like about Cognee is that its architecture is centered around **persistent memory**, not simply retrieval. Different data types are first converted into structured textual representations before entering the existing memory pipeline. That pipeline already performs chunking, entity extraction, relationship discovery, knowledge graph construction.

Instead of introducing an entirely new video subsystem, I wanted video ingestion to behave exactly like every other supported data type.To accomplish this, I extended Cognee's existing `GenericAPIAdapter` by implementing a new `transcribe_video()` method. This keeps video ingestion aligned with the current image and audio architecture while minimizing changes throughout the rest of the codebase.

### Video Ingestion Pipeline

The complete ingestion pipeline looks like this:

![](https://cdn.hashnode.com/uploads/covers/676b888ae437370deefa17c0/4c289bbf-28de-45c2-87ea-d8c162ac7926.png align="center")

Rather than building a custom computer vision pipeline, the implementation reuses Cognee's existing LiteLLM integration. This means any multimodal provider supported by LiteLLM can be used to generate the textual representation. During development I primarily validated the implementation using Gemini because it currently provides native video understanding.

### Why Chronological Text?

One of the biggest improvements during development was changing **how the video is represented**. My initial implementation generated four independent sections dialogue, visual description, OCR, summary. Although this worked, retrieval quality was inconsistent because information describing the same event became separated into different chunks. Instead, I changed the representation into a single chronological timeline where each timestamp contains everything happening at that moment.

For example:

```plaintext
00:30

Audio:
The speaker explains why the current taxonomy is difficult to maintain.

Visual:
Eric Johnson presents during the engineering review meeting.

On-screen text:
Eric Johnson
Engineering Review

```

This representation keeps audio, visuals, and OCR together, producing semantically richer chunks that naturally lead to a stronger knowledge graph.

### Cognne's `self_improvement=True` option

The most interesting part of this project is how memory evolves over time.

Imagine an AI employee that never forgets. Instead of treating meetings as one-time conversations, each recording becomes part of a growing knowledge graph. As new meetings are ingested over time from engineering reviews to product discussions and bug triage the AI continuously connects new information with past decisions, giving agents up to date context without reprocessing previous meetings.

![](https://cdn.hashnode.com/uploads/covers/676b888ae437370deefa17c0/6cadbc2b-15a4-4b98-b738-669226146522.png align="center")

Cognee not only ingests the **new meeting** but also rebuild the knowledge graph automatically expands by discovering new entities and relationships while preserving everything it already knows.

Now the agent can answer questions like:

*   What changed since the previous meetings?
    
*   What decisions were made?
    
*   Which team owns this work?
    
*   What security issues were discussed recently?
    

### Evaluation

Adding video support is only valuable if retrieval quality actually improves. To measure this objectively, I built an automated evaluation pipeline using [**LLM-as-a-Judge**](https://github.com/ShubhamOulkar/video-learning-brain/tree/main/multimedia_processing/evaluation). The benchmark uses `cognee.recall()` to execute retrieval queries across multiple categories, including factual, timestamp, visual OCR, audio, and reasoning.

Each retrieved response is compared against a reference answer and scored by another language model. This evaluation workflow made it much easier to iterate on prompt design and verify that changes to the chronological representation actually improved downstream retrieval performance. [See results here](https://github.com/ShubhamOulkar/video-learning-brain/blob/main/multimedia_processing/evaluation/evaluation_results.json)

### Current Limitations

The current implementation intentionally focuses on validating Cognee's memory architecture using Base64 Data URIs. This works well for small videos and provides a simple, provider-independent baseline for testing persistent video memory. However, Base64 encoding is not the long term solution.

The next step is integrating provider-native File APIs so larger videos can be processed efficiently while preserving the same ingestion pipeline. After that, the architecture should be evaluated across different providers because not every multimodal model currently supports native video understanding.

If native support is unavailable, I believe the long-term direction should move toward dedicated video embedding models instead of frame extraction pipelines using FFmpeg.

Rather than generating thousands of images with FFmpeg and managing separate OCR, vision, and audio pipelines, Cognee could eventually integrate modern video embedding models such as **Marengo** or similar architectures. This would keep the implementation aligned with Cognee's existing philosophy of building persistent context through embeddings and knowledge graphs while reducing engineering complexity.

### Results

One of the most surprising outcomes of this project was how few architectural changes were required. By simply extending the existing multimodal ingestion layer, Cognee immediately gained the ability to understand videos using the same memory pipeline already powering documents, images, and audio.

The result is a unified multimodal memory capable of building knowledge graphs from videos, remembering information across sessions, updating memory as new videos arrive, reducing repeated processing, providing richer retrieval context for AI agents. 🎇

### Demo

To demonstrate the implementation, I built two examples.

1.  **Multimedia Processing** : A benchmark that evaluates retrieval over videos, images, and audio using an automated evaluation pipeline.
    
2.  **Sober AI Employee** : A practical demonstration where an AI employee continuously learns from engineering meeting recordings. As new meetings are uploaded, Cognee updates its knowledge graph and the agent immediately answers questions using the latest organizational knowledge without reprocessing previous meetings.
    

🎥 **Watch the Demo:** [YouTube demo](https://www.youtube.com/watch?v=iI3C5pXqNf8)

📦 **GitHub:** [Project video learning brain](https://github.com/ShubhamOulkar/video-learning-brain)

* * *

## Conclusion

This project started with a simple question:

> **Can Cognee's existing persistent memory architecture support videos without being redesigned?**

The answer turned out to be **yes**.

By extending Cognee's existing multimodal ingestion layer and representing videos as structured chronological text, videos naturally fit into the same pipeline already used for documents, images, and audio.

The existing chunking, entity extraction, relationship discovery, and knowledge graph construction components required almost no architectural changes. More importantly, this project demonstrates that persistent video memory can be built by extending Cognee's existing strengths instead of replacing them.

I hope this implementation serves as a useful foundation for future multimodal memory capabilities in Cognee, including provider native large video support and dedicated video embedding models.
