Sainma
A library cut at its scene boundaries, every scene measured, indexed and searchable.
What it does
Scenes, not timestamps
A person searches for scenes, so the library is cut where the scenes change and each scene gets its own row.
Three measurements a scene
Motion, audio level and brightness are measured once per scene and stored. The index is built once, and queries are cached.
Search by profile
A question is matched against named scene profiles, each a band of the three measurements, and gets back the scenes that fit.
What runs today
The orange path is the code that runs today. The clip director is the next stage, already designed.
Core responsibilities
Find the scene boundaries
The library is cut at its scene boundaries first; every scene is indexed on its own.
Measure each scene
Sainma measures motion, sound and light for each scene and keeps the three values as one row in the index.
Answer with scenes
A question is matched against named profiles and returns the matching scenes with their boundaries.
Measure once
The index is built once and queries are cached, so a repeated question is answered from the cache.
Always return something
A question that fits no named profile falls back to the generic profile, so the answer is never empty.
Sainma in figures
- 3measurements per scene: motion, sound, lightthe scene index
- 20test functions in the repositorycounted in the repository
- 5agents in the design, one job eachthe architecture notes
- 16functions already laid out for the next stagecounted in the repository
Counted in the repository, read from a run or set in the code. No figure is estimated.
SainmaBuilding
Why it is built this way
The decisions in the design, and what each one makes possible.
Apply for a seatFive agents, one job each
In the design, a coordinator reads the question and hands out the parts. A visual analyst, a dialogue expert, a film expert and a clip director each answer one.
Picture, sound and speech in one index
In the design, what is seen, heard and said in a scene is fused into one vector. A question can land on any of the three.
Any video library
Films are the test library. The same index is designed for training videos, recorded sessions and archives.
The code behind Sainma
Three files from the repository, shown in turn. Select one to read it.
01@dataclass02class SceneIndex:03 start_time: float04 end_time: float05 avg_brightness: float06 motion_score: float07 audio_level: float08 keyframe_path: str09 features: Dict[str, float]01self.intent_keywords = {02 'action_sequence': ['fight', 'chase', 'battle', 'action', 'fight scene'],03 'dialogue': ['conversation', 'talk', 'say', 'discuss', 'speaking'],04 'emotional': ['happy', 'sad', 'angry', 'emotional', 'crying', 'laughing'],05 'location': ['at', 'in', 'where', 'location', 'place'],06 'character_focused': ['character', 'who', 'person', 'appears']07}01all_results = []02for video_id in video_ids:03 scenes = self.indexer.search_scenes(04 video_id=video_id,05 criteria=criteria,06 limit=limit_per_video07 )08 if scenes:09 all_results.append((video_id, scenes))10 11 if sum(len(scenes) for _, scenes in all_results) >= max_total_clips:12 break13 14return all_resultsBring the workflow that keeps breaking.
Our engineers work through it with you in a free 45-minute briefing.