Samyama: A Unified Graph-Vector Database with In-Database Optimization, Agentic Enrichment, and Hardware Acceleration

This paper introduces Samyama, a high-performance, unified graph-vector database written in Rust that integrates persistent storage, vector indexing, native optimization solvers, and agentic LLM enrichment into a single engine, achieving competitive throughput and latency on commodity hardware while offering GPU-accelerated enterprise features.

Madhulatha Mandarapu, Sandeep Kunkunuru

Published Tue, 10 Ma
📖 5 min read🧠 Deep dive

Imagine you are running a massive, bustling city. In this city, you have three distinct departments that usually don't talk to each other:

  1. The Map Makers (Graphs): They track how everything connects (roads, friendships, supply chains).
  2. The Librarians (Vectors): They understand the meaning of things, finding books or ideas that are similar even if they use different words.
  3. The Planners (Optimization): They solve complex puzzles, like how to deliver 1,000 packages in the shortest time or how to schedule a factory to save money.

The Problem:
In most modern cities (data systems), these three departments live in separate buildings. If the Map Makers need to talk to the Planners, they have to print out their maps, drive them to the Planning Department, wait for the planners to do their math, and then drive the results back. This is slow, expensive, and prone to errors. This is what data engineers call "ETL" (Extract, Transform, Load), and it's a huge bottleneck.

The Solution: Samyama
The paper introduces Samyama (a Sanskrit word meaning "Integration"). Think of Samyama not as three separate buildings, but as a super-efficient, all-in-one skyscraper where the Map Makers, Librarians, and Planners all work in the same room.

Here is how it works, broken down into simple concepts:

1. The "Lazy" Delivery Service (Late Materialization)

Imagine you order a pizza. Usually, the kitchen makes the whole pizza, boxes it, and then you eat it.
Samyama uses a technique called Late Materialization. Instead of making the whole pizza immediately, the kitchen just sends you a ticket (a reference) saying, "We have a pizza ready." You only ask for the specific toppings you want right before you take a bite.

  • Why it matters: In data terms, this means the system doesn't waste time copying huge amounts of information it doesn't need yet. The paper shows this makes the system 4 to 5 times faster when navigating complex connections (like finding a friend of a friend of a friend).

2. The "Self-Driving" Librarian (Agentic Enrichment)

Usually, a database is like a passive library: you have to go there and ask for a book. If the book isn't there, it stays empty.
Samyama introduces Agentic Enrichment. Imagine a librarian who, when you ask a question and the answer isn't in the library, automatically goes out, finds the information on the internet, reads it, and adds it to the library shelves for you.

  • The Catch: It uses AI (Large Language Models) to do this. It's like having a research assistant that never sleeps, constantly updating the city's knowledge base with new facts it discovers on its own.

3. The "In-House" Math Wizards (In-Database Optimization)

Normally, if you want to solve a complex logistics problem, you have to take your data out of the database, send it to a super-computer math solver, and wait for the answer.
Samyama puts the math wizards inside the database. You can ask a question in the database language (Cypher), and it will instantly solve the optimization problem right there.

  • The Benefit: No more moving data back and forth. It's like asking your bank teller to not only check your balance but also instantly calculate the best investment strategy for you, all in one conversation.

4. The "Super-Speed" Engine (Hardware Acceleration)

Samyama is built with Rust, a programming language known for being incredibly fast and safe (it prevents the computer from crashing due to memory errors).
It also has a special mode for GPUs (the powerful chips in graphics cards). Imagine the CPU is a single chef cooking a meal, while the GPU is a team of 1,000 chefs chopping vegetables simultaneously. For massive calculations (like analyzing millions of connections), Samyama can switch to "Team Chef Mode," making it 8 times faster for certain tasks.

5. The "Universal Translator" (RDF & SPARQL)

Samyama speaks many languages. It understands standard graph queries, but it also speaks RDF (a standard for the "Semantic Web"). It's like a diplomat who can talk to any other database system without needing a translator, ensuring your data can be shared easily with the rest of the world.

The Results: How Fast is it?

The authors tested this on a standard, off-the-shelf computer (a Mac Mini).

  • Ingestion: It can add 255,000 new connections per second. That's like adding a new road to a map every 4 milliseconds.
  • Speed: It handles over 100,000 questions per second.
  • Accuracy: It passed 100% of the industry-standard tests (LDBC Graphalytics), proving it doesn't just look fast; it gets the math right.

The Trade-off

The paper is honest about one weakness: The "brain" that plans how to answer a question (the query planner) is still learning. For the very first time you ask a complex question, it takes a little longer to figure out the best route compared to older, more established systems. However, once it learns the route (caching), it becomes incredibly fast.

Summary

Samyama is a new kind of database that stops forcing you to move data between different tools. It combines maps, meaning, and math into one powerful, safe, and fast engine. It's like upgrading from a city with separate, disconnected departments to a smart, self-updating, all-in-one command center that can solve problems as fast as you can ask them.