Sunday, August 9, 2026

Movie Genere association and movie recommendation

 

Movie → Genre Association

Now, let's assume the recommendation engine has analyzed the movies in its catalog and determined how strongly each movie is associated with different genres.

For example, consider the following genres:

  • Action
  • Comedy
  • Drama
  • Sci-Fi
  • Romance

The association can be represented using a numerical value between 0 and 1, where:

  • 0 → The movie has no association with the genre
  • 1 → The movie is very strongly associated with the genre
  • Values between 0 and 1 → The movie has some degree of association with the genre

For example, consider three movies:

MovieActionComedyDramaSci-FiRomance
Movie A0.90.10.20.80.0
Movie B0.10.90.60.00.5
Movie C0.20.10.90.10.8

This tells us that:

  • Movie A is primarily an Action + Sci-Fi movie.
  • Movie B is primarily a Comedy + Drama + Romance movie.
  • Movie C is primarily a Drama + Romance movie.

These numbers could be generated by the recommendation system using information such as movie metadata, descriptions, user ratings, viewing behavior, actors, directors, or even embeddings generated by a machine learning model.


Representing the User and Movie as Vectors

Now we have two different vectors.

The user preference vector represents how much the user likes each genre.

For example:

User=[0.9, 0.2, 0.7, 1.0, 0.1]User = [0.9,\ 0.2,\ 0.7,\ 1.0,\ 0.1]

The positions correspond to:

[Action, Comedy, Drama, Sci−Fi, Romance][Action,\ Comedy,\ Drama,\ Sci-Fi,\ Romance]

So this user:

  • Likes Action strongly → 0.9
  • Has low interest in Comedy → 0.2
  • Likes Drama → 0.7
  • Likes Sci-Fi very strongly → 1.0
  • Has little interest in Romance → 0.1

Similarly, Movie A can be represented as:

MovieA=[0.9, 0.1, 0.2, 0.8, 0.0]Movie_A = [0.9,\ 0.1,\ 0.2,\ 0.8,\ 0.0]

Now the recommendation engine has converted both the user's preferences and the movie's characteristics into vectors.

The important question is:

How can we mathematically determine how well these two vectors match?

This is where the dot product becomes useful.


Calculating the Dot Product

The dot product of two vectors is calculated by multiplying corresponding elements and then adding all the results.

For our user and Movie A:

User⋅MovieAUser \cdot Movie_A =(0.9×0.9)+(0.2×0.1)+(0.7×0.2)+(1.0×0.8)+(0.1×0.0)= (0.9 \times 0.9) + (0.2 \times 0.1) + (0.7 \times 0.2) + (1.0 \times 0.8) + (0.1 \times 0.0)

Calculating each contribution:

=0.81+0.02+0.14+0.80+0= 0.81 + 0.02 + 0.14 + 0.80 + 0

Therefore:

User⋅MovieA=1.77\boxed{User \cdot Movie_A = 1.77}

This 1.77 is the compatibility score between the user and Movie A.


What Does Each Number Contribute?

This is where the mathematics becomes particularly interesting.

We can see exactly how much each genre contributes to the final recommendation score:

GenreUser PreferenceMovie AssociationContribution
Action0.90.90.81
Comedy0.20.10.02
Drama0.70.20.14
Sci-Fi1.00.80.80
Romance0.10.00.00
Total1.77

This gives us an intuitive interpretation of the dot product.

Action contributes 0.81

The user strongly likes Action:

0.90.9

and Movie A is strongly associated with Action:

0.90.9

Therefore:

0.9×0.9=0.810.9 \times 0.9 = 0.81

Action makes a large contribution to the recommendation score.

Sci-Fi contributes 0.80

The user has an extremely high preference for Sci-Fi:

1.01.0

and Movie A has a strong Sci-Fi association:

0.80.8

Therefore:

1.0×0.8=0.801.0 \times 0.8 = 0.80

Again, this genre contributes significantly to the overall score.

Comedy contributes only 0.02

The user has very little preference for Comedy:

0.20.2

and Movie A has only a small Comedy association:

0.10.1

Therefore:

0.2×0.1=0.020.2 \times 0.1 = 0.02

Comedy has almost no influence on the final recommendation score.

Romance contributes 0

The user has very little interest in Romance:

0.10.1

and Movie A has no Romance association:

0.00.0

Therefore:

0.1×0=00.1 \times 0 = 0

Romance contributes nothing to the score.


Now Calculate the Score for Every Movie

The recommendation engine doesn't stop with Movie A.

It performs the same calculation for every movie in the catalog.

For Movie B:

MovieB=[0.1, 0.9, 0.6, 0.0, 0.5]Movie_B = [0.1,\ 0.9,\ 0.6,\ 0.0,\ 0.5]

Therefore:

User⋅MovieBUser \cdot Movie_B =(0.9×0.1)+(0.2×0.9)+(0.7×0.6)+(1.0×0.0)+(0.1×0.5)= (0.9 \times 0.1) + (0.2 \times 0.9) + (0.7 \times 0.6) + (1.0 \times 0.0) + (0.1 \times 0.5) =0.09+0.18+0.42+0+0.05= 0.09 + 0.18 + 0.42 + 0 + 0.05 =0.74\boxed{= 0.74}

For Movie C:

MovieC=[0.2, 0.1, 0.9, 0.1, 0.8]Movie_C = [0.2,\ 0.1,\ 0.9,\ 0.1,\ 0.8]

Therefore:

User⋅MovieCUser \cdot Movie_C =(0.9×0.2)+(0.2×0.1)+(0.7×0.9)+(1.0×0.1)+(0.1×0.8)= (0.9 \times 0.2) + (0.2 \times 0.1) + (0.7 \times 0.9) + (1.0 \times 0.1) + (0.1 \times 0.8) =0.18+0.02+0.63+0.10+0.08= 0.18 + 0.02 + 0.63 + 0.10 + 0.08 =1.01\boxed{= 1.01}

We now have:

MovieCompatibility Score
Movie A1.77
Movie B0.74
Movie C1.01

So the recommendation engine would rank:

Movie A>Movie C>Movie B\boxed{Movie\ A > Movie\ C > Movie\ B}

Based purely on these genre preferences, Movie A would be the strongest recommendation for this user.


The Key Mathematical Insight

The important thing to understand is that the dot product isn't simply asking:

"Does the user like this movie?"

Instead, it is calculating:

"How strongly do the user's preferences overlap with the characteristics of this movie?"

Mathematically:

Score(User,Movie)=∑i=1nUseri×Moviei\boxed{ Score(User,Movie) = \sum_{i=1}^{n} User_i \times Movie_i }

Each genre creates a small contribution to the final score.

The recommendation score is simply the sum of all these contributions:

Score=Actioncontribution+Comedycontribution+Dramacontribution+SciFicontribution+RomancecontributionScore = Action_{contribution} + Comedy_{contribution} + Drama_{contribution} + SciFi_{contribution} + Romance_{contribution}

This is why the dot product is so important in machine learning.

It allows us to convert multiple dimensions of information into a single numerical compatibility score.


Taking This One Step Further

In a real recommendation system, we wouldn't have just 5 genres and 3 movies.

We might have:

  • millions of users
  • millions of movies
  • hundreds or thousands of latent features
  • billions of user-movie interactions

Instead of explicitly storing genres, machine-learning algorithms can learn hidden or latent features such as:

  • preference for fast-paced content
  • preference for complex storylines
  • preference for specific actors
  • preference for particular directors
  • preference for dark themes
  • preference for family-oriented content
  • preference for older movies
  • preference for short/long movies

The user and movie can then be represented as high-dimensional vectors:

User=[u1,u2,u3,…,un]User = [u_1,u_2,u_3,\ldots,u_n] Movie=[m1,m2,m3,…,mn]Movie = [m_1,m_2,m_3,\ldots,m_n]

and the predicted preference becomes:

r^user,movie=User⋅Movie=∑i=1nuimi\boxed{ \hat{r}_{user,movie} = User \cdot Movie = \sum_{i=1}^{n}u_i m_i }

This is the fundamental mathematical idea behind latent-factor recommendation models such as matrix factorization.

And this is where our simple five-dimensional example connects directly to much larger machine-learning systems used by real-world recommendation engines.

In Claude code, what is local routines and cloud routines

In Claude Code, the term Local Routines (often contrasted with Cloud Routines) refers to scheduled tasks or automated workflows configured to run directly on your local machine rather than on Anthropic's cloud infrastructure.



While standard Claude Code routines typically run server-side on Anthropic's cloud (allowing them to execute even when your laptop is closed), opting for Local execution creates a desktop-managed task tied specifically to your local environment.


Key Characteristics of Local Routines

Local Execution: Unlike cloud routines that clone your repository into a temporary remote container, a local routine executes directly using your machine's environment, local file paths, and locally installed tools.


Access to Local Tooling: They are ideal for tasks that require access to your local workspace, running development servers, local databases, or custom environment-specific tooling that isn't present in a generic cloud sandbox.


Desktop App Integration: They can be set up through the Claude Code Desktop app by selecting Local instead of Cloud when creating a new routine, which configures it as a native desktop scheduled task.


When to Use Local vs. Cloud Routines

Feature Cloud Routines Local Routines

Where it runs Anthropic's Cloud Infrastructure Your local machine

Laptop requirement Can run while laptop is closed Requires your machine to be on and active

Environment access Isolated container (requires setup scripts/connectors) Direct access to local files, CLI tools, and dev environments

Best used for Automated PR reviews, nightly dependency checks, webhook triggers Tasks tightly coupled to your local dev setup or local file state

What is hermes agent

 Hermes Agent is an open-source, self-improving, autonomous AI agent developed by Nous Research. Unlike traditional AI chatbots or coding copilots that start fresh with every conversation, Hermes Agent runs persistently on your infrastructure (local machine, VPS, or cloud server) and accumulates knowledge and capabilities over time.  

​Key Features

​Persistent Memory: Stores general context, facts, and user-specific preferences across sessions using full-text search and dedicated Markdown memory stores (MEMORY.md and USER.md).  

​Self-Improving Skill System: Automatically creates, refines, and executes procedural skills from experience, saving repeated multi-step workflows as reusable tools.  

​Multi-Platform Access: Operates through a terminal UI (CLI) or bridges directly to messaging channels like Telegram, Discord, Slack, and WhatsApp.  

​40+ Built-in Tools & Integrations: Supports local command execution, browser automation (via accessibility trees), file operations, sub-agent delegation, and Model Context Protocol (MCP) integrations.  

​Model Agnostic: Connects to any AI provider, including OpenAI, Anthropic, OpenRouter, Nous Portal, or local models via Ollama.  

​Automations & Cron Jobs: Includes a built-in scheduler to perform unattended routine tasks, daily summaries, or system monitoring in natural language.

Saturday, August 8, 2026

What is google OKF

 OKF is designed to consolidate (compile) scattered knowledge into Markdown files that can be managed with Git and then maintained. The advantage is that instead of having to search for the information every time a question index.mdis asked, agents and people read the source code and translate it into OKF bundles, so you can just follow along from there.

Furthermore, OKF v0.1 is not a finished standard, but rather an initial specification that will evolve through future implementations and use cases. In the age of AI, one key issue will be organising internal documents and metadata in a way that is easily accessible to AI agents. OKF can be referenced as a candidate format for this purpose

In short, OKF is responsible for “knowledge that is written in advance,” while MCP and RAG are responsible for “mechanisms for retrieving and connecting data on the spot .” For example, the “definition of weekly active users” can be written in OKF, and the actual query to BigQuery can be done via MCP. RAG is not mutually exclusive, and it is possible to use OKF bundles as search targets in RAG as well.



Sunday, August 2, 2026

What is 3LO authentication?

 3LO (Three-Legged OAuth) flow is a secure authorization process—also known as the Authorization Code Flow—that lets a third-party application access user data without seeing the user's password. The three distinct parties involved are the end-user (resource owner), the client app, and the authorization server.How the Flow WorksUser Redirection: Your app sends the user to the server's login and consent page.Consent Grant: The user logs in and approves the requested permissions.Authorization Code: The server sends a temporary code back to your app.Token Exchange: Your app trades this code directly with the server for an access token.API Access: Use that token to fetch protected data on the user's behalf.If you want to implement this, tell me:Which platform or service (like Google, GitHub, or Atlassian) are you connecting to?Is your app a mobile app, single-page web app, or server-side app?I can give you the exact integration steps or code examples

Saturday, August 1, 2026

Multimodal content chunking in AWS

For multimodal content (audio, video, images), chunking behavior differs from text documents:

Nova multimodal embeddings: Chunking occurs at the embedding model level. You can configure audio and video chunk duration from 1-30 seconds (default: 5 seconds). For video files, only the video chunk duration applies, even if the video contains audio. Audio chunk duration only applies to standalone audio files.

Bedrock Data Automation (BDA) parser: Content is first converted to text (transcripts and scene summaries), then standard text chunking strategies are applied to the converted text.


Monday, July 13, 2026

What is AgentCore Harness

 Every harness session is stateful by default and runs in a secure, isolated microVM per session (backed by AgentCore runtime). The agent has its own filesystem and shell, so it can write code, execute it, and can persist short-term and long-term memories and files across sessions, even when the underlying microVM session has expired and is replaced by a new one. Agents can use any model provided by Amazon Bedrock, OpenAI, Google Gemini, or any LiteLLM-compatible provider, and can switch providers mid-session without losing context, so you can plan with one model and execute with another, or swap providers for a price-performance test without rebuilding the conversation. Agents can connect to tools through AgentCore gateway, MCP servers, or use the built-in browser or code interpreter . You can attach AWS skills from Git, S3, or the curated AWS skills catalog with a single toggle, so the agent picks up domain expertise on demand instead of improvising. When you need a custom environment with your own dependencies, you can bring your own container. You can also mount S3 Files or EFS to share data across sessions and harnesses with full S3 durability and history. Every action is traced automatically through AgentCore observability, with a unified view that surfaces what the agent did across every capability in one place, so you stop hopping between log groups to piece together what happened.


You can iterate on real traffic with AgentCore evaluations and optimization to score behavior, get prompt and tool-description recommendations, and run A/B tests with statistical significance reporting per session. Then, roll out changes safely with immutable versions and named endpoints, and roll back instantly by pointing an endpoint at an earlier version. You can drop a harness into a larger pipeline through the AgentCore InvokeHarness state in AWS Step Functions, or export to Strands code (Claude Agent SDK coming soon) and run it on AgentCore runtime when configuration isn’t enough. Everything you need to build, run, and operate production agents, without managing infrastructure. The harness is powered by Strands Agents, the open-source agent framework from AWS.


There is no separate harness charge. You pay only for the underlying AgentCore capabilities you use. For details, see the AgentCore pricing page.