# RushDB — Full Published Content > Full text of the product pages and the current published CMS content. Canonical URLs identify the authoritative public pages. # Product Pages > RushDB is an open-source database for AI. It records fields, types and values on every write, so agents can read the schema before they query. ## Features: a database that describes itself Canonical URL: https://rushdb.com/features RushDB stores records, relationships and search indexes in one Rust process. As data is written it keeps an exact catalog of every label, field, type, value and relationship shape, so an agent or a developer can read what exists before writing a query. ### Records: write JSON, get linked records Send documents in the shape your apps, pipelines or agents produce them. Each nested object becomes its own record, linked to its parent in the same commit; the key a child appears under becomes its label, and every value is typed as it is written. Records that arrive separately can be linked on matching keys afterwards (for example message.session_id = session.id) with one linkRecords command. JSON and CSV import, and inserts from SQL, Cypher, Gremlin or Mongo-style statements, all land in the same records. ### Schema catalog: the schema is a query, not a guess Every commit updates a catalog: each label with its record count, each property per type, value dictionaries with counts, and every relationship shape. Reading it never scans records, and the counts are exact. The same call takes a filter: scoped to the records a predicate matches, it returns the fields, values and links inside that slice, which gives an app faceted navigation and lets an agent look before it narrows. ### Query languages The same records answer every language below, read from one snapshot per query. - SearchQuery (native JSON): Stable, Engine + Cloud. Always on. Filters reach across relationships by naming related labels. - SQL: Stable, Engine. Labels are tables. Over PostgreSQL wire: reads and single-statement writes in autocommit; BEGIN/COMMIT are refused. - Gremlin: Stable, Engine. Text traversals. - Mongo-style documents: Stable, Engine. Multi-document commands are not one atomic commit. - SQL/PGQ GRAPH_TABLE: Stable, Engine. Read-only. - openCypher: Release candidate, Engine + Cloud. Opt-in on the engine; raw openCypher through the SDKs on Cloud. The openCypher TCK does not pass in full yet. - ISO GQL: Release candidate, Engine. Opt-in. ISO/IEC 39075 Graph Query Language (not GraphQL). The public GQL corpus does not pass in full yet. How clients connect: - HTTP native protocol: Stable, Engine. POST /protocol/v1/execute on :3000. - PostgreSQL wire: Stable, Engine. On :5432 with SQL enabled. Checked with the clients listed, not every client or ORM. - Bolt 5.0: Release candidate, Engine. Serves Cypher; opt-in with --bolt-port. - gRPC: Stable, Engine. rushdb.v1.Database/Execute; opt-in with --grpc-port. - REST API: Stable, Cloud only. https://api.rushdb.com/api/v1. On a self-hosted engine use the native HTTP protocol. Client libraries: - TypeScript SDK: Stable, Engine + Cloud. Cloud API key, or direct mode against your engine. Cloud-only features throw CloudOnlyError in direct mode. - Python SDK: Stable, Engine + Cloud. Cloud API key, or direct mode against your engine. - MCP server: Stable, Engine + Cloud. Hosted with OAuth on Cloud (mcp.rushdb.com); local over stdio in direct mode for a self-hosted engine. - Agent skills: Stable, Engine + Cloud ### Search: filter, traverse and rank in one request Vector indexes (exact and HNSW) and BM25 full-text indexes attach to ordinary records with typed fields and relationships. Hybrid search fuses both rankings (RRF or DBSF) under the same filter, including filters on related records. The indexes live inside the database and the engine keeps them current as records change, so there is no separate search store to sync. The self-hosted engine searches vectors you supply; RushDB Cloud can embed them for you. ### Transactions - Atomic writes: Records, relationships, index entries and catalog updates from one statement publish as one commit. Multi-statement transactions over HTTP and the SDKs. - Snapshot reads: Every query reads one pinned MVCC snapshot, whichever language it is written in. Readers never block writers. - Recoverable: A write-ahead log is the durable truth. Base backups plus archived WAL restore to a chosen log position; derived state is on disk, so restart rebuilds nothing. ### Architecture: one process, from the wire to the disk The Labeled Meta-Property Graph (LMPG) stores every property value of every record as its own ordered key instead of one blob per record. Updating one property writes one key, and counters, value dictionaries and index entries are derived from each commit, which is why the catalog is exact and cheap to read. - Transports: HTTP, PostgreSQL wire, gRPC and Bolt are thin adapters. They authenticate, bind the tenant and hand one Protocol v1 operation to the executor. - Engines: The native engine (SearchQuery, Mongo-style), Apache DataFusion for SQL, one graph planner for Cypher, GQL, Gremlin and SQL/PGQ, plus vector and text search. - LMPG layer: Plans mutations, expands them into keys, derives counters and the schema catalog, and reconstructs records from their occurrences. - Storage: A segmented write-ahead log is the durable truth. Commits are materialized into an embedded ordered store; reads run on pinned MVCC snapshots. ### Status - Stable: Native protocol and SearchQuery, SQL, Gremlin text traversals, Mongo-style documents, SQL/PGQ (read-only), the schema catalog, vector, BM25 and hybrid search, transactions, backups with point-in-time restore. - Release candidate: openCypher, ISO GQL and Bolt are opt-in; their external conformance suites do not pass in full yet. Replication is asynchronous with manual promotion. PostgreSQL wire runs in autocommit. ### Coming soon (preview or release candidate, not production-ready) - Multi-shard storage: Preview behind --shards N --experimental-sharding: one tenant split across up to 256 store files. Multi-shard commits are not crash-atomic yet. Tracked at https://github.com/rush-db/rushdb/issues/396 - Consensus replication (Raft): Preview in one process: commits go through an elected leader, but the Raft log lives in memory and there is no network transport between nodes yet. Tracked at https://github.com/rush-db/rushdb/issues/397 - Automatic failover: Today followers replicate asynchronously and a follower is promoted by hand. Tracked at https://github.com/rush-db/rushdb/issues/398 - Full openCypher and ISO GQL conformance: Both, and Bolt, are release candidates: reads and writes work, but the openCypher TCK and the public GQL corpus do not pass in full yet. Tracked at https://github.com/rush-db/rushdb/issues/399 ### FAQ Q: Is RushDB a graph database, a vector database or a document store? A: All three views of one store. Data is a property graph: records with labels and typed properties, joined by typed relationships. Vector and BM25 indexes attach to those records, and JSON documents go in and come out as they are. There is one copy of the data and one snapshot per query. Q: Do I define a schema before writing data? A: No. There is no CREATE TABLE. Types are inferred per value, nested objects become linked records, and every commit updates the schema catalog. You can still add indexes for fields you filter by often. Q: How does an agent use the schema catalog? A: Before it writes a query, the agent reads describe.schema (labels, properties with types and counts, relationship shapes) and propertyValues for the fields it filters on. Scoped with a predicate, the same call describes only the records a filter matches, so the agent sees which values exist in that slice before narrowing further. Q: Which query language should I use? A: The one your tools or your model already know. SQL works with any PostgreSQL client and BI tool. Cypher works with Neo4j drivers over Bolt. SearchQuery is the native JSON format the SDKs and MCP server use. All of them read and write the same records. Q: Does the engine generate embeddings? A: No. The self-hosted engine indexes and searches vectors you supply from your own model. RushDB Cloud adds managed embeddings: it embeds writes, backfills existing records and embeds text queries. Engine manual: https://docs.rushdb.com/engine --- ## Use cases Canonical URL: https://rushdb.com/use-cases Each use case is the same engine used a different way: records and links written as data arrives, a catalog an agent can read before it queries, and search, traversal and aggregation in one request. ### Agent memory URL: https://rushdb.com/use-cases#memory Agents that remember, and can show where a memory came from. Each memory is a record linked to the chat turn that produced it, and recall returns that turn with the memory. Plain fields for user, agent and session keep one user’s memories out of another’s results. An agent that forgets between sessions repeats questions; one that remembers in an opaque store can’t say where a memory came from. Memory needs to be data: scoped, queryable and traceable to the turn that produced it. How it works: - Store turns, facts and decisions as records, scoped by user, agent or session with ordinary fields. - Link each fact to the message it came from, so recall can return its source. - Recall with hybrid search under a filter, then follow links for context. - The agent reads the catalog first, so it queries labels and fields that exist. Tutorials: - Agent memory overview: https://docs.rushdb.com/learn/agent-memory - RushDB as a memory layer: facts, episodes, references: https://docs.rushdb.com/learn/tutorials/agent-memory/memory-layer - Episodic memory for multi-step agents: https://docs.rushdb.com/learn/tutorials/agent-memory/episodic-memory - Building team memory: https://docs.rushdb.com/learn/tutorials/agent-memory/building-team-memory ### Company brain & RAG URL: https://rushdb.com/use-cases#company Answers that span your docs, CRM, support, billing and code, with the record behind every fact. Each source lands in its own shape and is linked on keys it already shares, like an email or a Stripe customer ID. The agent reads the catalog first, so it knows which source holds what before it asks. The answer to “why did this account churn?” is spread across docs, CRM, support, billing and code. Each source has its own shape and IDs, and vector-only retrieval returns similar text from the wrong version or tenant without showing what surrounds it. How it works: - Ingest each source as it comes: docs, webhooks, exports, events. No shared schema up front. - Link records across sources on matching keys (email, account ID) with one command. - Filter to the right version, product or account first, then rank by vector and BM25 together. - The catalog shows what each source contributed, so an agent can plan a cross-source query. - Every fact in the answer cites the record it came from. Tutorials: - Multi-source RAG: https://docs.rushdb.com/learn/tutorials/ai-and-rag/rag-multi-source - GraphRAG: https://docs.rushdb.com/learn/tutorials/ai-and-rag/graphrag - Hybrid retrieval: filters plus semantic search: https://docs.rushdb.com/learn/tutorials/ai-and-rag/hybrid-retrieval - Webhook ingestion from Clay, Supabase, Superglue: https://docs.rushdb.com/learn/tutorials/working-with-data/third-party-webhook-ingestion - Customer 360: https://docs.rushdb.com/learn/tutorials/graph-modeling/customer-360 ### AI search & assistants URL: https://rushdb.com/use-cases#apps Search and assistants on the records your app already writes. Declare text and vector indexes once and the database keeps them current as your app writes, so there is no separate search engine to sync. Filters, facets and ranking run in one query. Search, filters and an assistant usually mean a second datastore and a sync job. Facet counts drift, and the assistant can’t see what the filters see. How it works: - Search the records your app writes. Text and vector indexes live in the database and stay current, so there is no external index to sync. - Facet counts come from the catalog scoped to the current filter, and they are exact. - Hybrid search ranks results under the same filter the facets use. - The SDKs, the MCP server and SQL clients all read the same data. Tutorials: - Search UX patterns: https://docs.rushdb.com/learn/tutorials/search-and-queries/search-ux-patterns - Discovery queries: https://docs.rushdb.com/learn/tutorials/search-and-queries/discovery-queries - Semantic search for multi-tenant products: https://docs.rushdb.com/learn/tutorials/ai-and-rag/semantic-search-multitenant - Building a graph-backed API layer: https://docs.rushdb.com/learn/tutorials/working-with-data/graph-backed-api ### Analytics URL: https://rushdb.com/use-cases#analytics Questions about your data, answered by a read-only query you can inspect. Before writing SQL, the agent reads which labels and fields exist and how each value is spelled in the data. Every answer ships with its read-only query, which anyone can rerun to check the number. Text-to-SQL fails on invented column names and on values that don’t exist. And an answer is only useful if someone can check the query that produced it. How it works: - The agent reads labels, fields, types and value counts before writing a query. - It writes SQL, Cypher or a SearchQuery aggregation against fields that exist. - Read-only credentials keep it to SELECTs; every answer shows its query. - BI tools connect over the PostgreSQL wire protocol for the same numbers. Tutorials: - Agent-safe query planning: https://docs.rushdb.com/learn/tutorials/agent-memory/agent-safe-query-planning - Detecting fraud rings: https://docs.rushdb.com/learn/tutorials/graph-modeling/fraud-rings - Supply chain traceability: https://docs.rushdb.com/learn/tutorials/use-cases/supply-chain-traceability - Temporal graphs: https://docs.rushdb.com/learn/tutorials/graph-modeling/temporal-graphs ### Where RushDB is the wrong tool - Pure transactional workloads (ledgers, inventory): use PostgreSQL, CockroachDB - Time series at very high write rates: use InfluxDB, TimescaleDB - Blob and file storage: use S3 plus a metadata index - Flat, stable CRUD with no search: use Any relational database - Warehouse analytics over hundreds of millions of rows: use BigQuery, Redshift, DuckDB --- ## Pricing and RushDB Cloud Canonical URL: https://rushdb.com/pricing The RushDB engine is open source under Apache-2.0 and free to self-host with the install script, Docker, Homebrew or Helm. RushDB Cloud runs the same engine as a managed service. On Cloud, storage (GB stored) is the only database meter: reads, writes, imports and re-syncs are free. Compute is a limit (concurrent queries and requests per second), not a meter, and AI actions (Smart Search and managed embeddings) have monthly allowances; bring-your-own model key, with no AI overage, is coming soon on Pro, Team and Enterprise. The plans are Free (1 GB, never deleted for being idle), Pro and Team (more storage, projects, seats, AI allowance and backups, with a spend cap on by default), and Enterprise (annual contract, dedicated or BYOC deployment, private networking). At a limit or the spend cap, writes pause and AI actions stop; reads keep working and nothing is deleted. Payments, invoices and tax are handled by Paddle as merchant of record. Every plan with its price and limits is in plain Markdown at https://rushdb.com/pricing.md. ### What Cloud adds over the self-hosted engine - Managed embeddings. Cloud: Create a managed index on a property; Cloud embeds every write, backfills existing records, and embeds text queries. Self-hosted: Create an external index and supply vectors from your own model. - Smart Search (natural-language search). Cloud: ai.search(prompt) turns a request into a SearchQuery over your schema and runs it. Self-hosted: Build the SearchQuery yourself, or let an agent build it from the schema. - Relationship-pattern suggestions. Cloud: Cloud analyzes your schema and proposes relationships to materialize, for your review. Self-hosted: Create relationships with attach, linkRecords or relationships.createMany. - Dashboard. Cloud: Browse and edit records, explore the graph, build queries, manage embedding and text indexes. Self-hosted: Use the SDKs, the native protocol, or SQL tools over the PostgreSQL wire protocol. - Projects and team access. Cloud: Separate projects, invite teammates, full-access and read-only API keys. Self-hosted: One engine per deployment; tenants and tokens are yours to manage. - Hosted MCP with OAuth. Cloud: mcp.rushdb.com for ChatGPT, Claude.ai, and other web clients. Self-hosted: The local MCP server in direct mode, over stdio. - Operations. Cloud: RushDB runs, upgrades, and backs up the engine. Self-hosted: You do, with the engine’s backup, PITR, and replication tooling. ### The same on Cloud and self-hosted - Records, relationships, and nested JSON import - SearchQuery filters across relationships, aggregations, group-by - The exact schema catalog (labels, properties, values, relationship shapes) - Keyword (BM25), vector, and hybrid search with vectors you supply - Raw openCypher - Transactions Full capability list: https://docs.rushdb.com/rushdb-cloud/capabilities Self-host the engine: https://docs.rushdb.com/deploy --- # Blog Posts ## Vector RAG vs GraphRAG vs Agentic RAG: Why There Is No Winner Canonical URL: https://rushdb.com/blog/vector-rag-graphrag-agentic-rag-comparison-c203b6 Published: 2026-08-19T10:01:00.000Z Updated: 2026-08-21T13:44:48.873Z Author: RushDB Category: Engineering Tags: GraphRAG, Vector Search, RAG Architecture, Hybrid Retrieval, RushDB, Neo4j, Agentic RAG # Vector RAG vs GraphRAG vs Agentic RAG: Why There Is No Winner > Not everything you need can be reached through connections. Not everything you need can be preserved as a semantic vector. And not every question deserves an agent loop. The sweet spot is one application that can use the right retrieval mode for each part of the problem. Ask five AI engineers whether GraphRAG replaces vector RAG and you will get five different answers, usually shaped by whichever system they built most recently. The common story is a maturity ladder: ```mermaid flowchart LR V["Vector RAG"] --> G["GraphRAG"] --> A["Agentic RAG"] ``` It implies a simple progression: start with embeddings, graduate to graphs, then graduate again to agents. That is the wrong mental model. **Vector RAG, GraphRAG, and Agentic RAG are not three generations competing for the same job. They preserve and recover different kinds of context.** - **Vector RAG** is strongest when relevance is semantic: *what means something similar to this?* - **GraphRAG** is strongest when relevance is relational: *what is connected to this, and how?* - **Agentic RAG** is strongest when retrieval itself must be planned: *which operations do I need, in what order, to answer this?* Each has a blind spot. A graph cannot traverse a relationship that does not exist. A vector cannot guarantee that ownership, causality, provenance, sequence, or identity survived the embedding. An agent adds latency, cost, nondeterminism, and more ways to fail. So the practical goal is not to find a winner. It is to build an application where **the retrieval mode follows the information need**. That is exactly the boundary [RushDB](https://rushdb.com/) draws in one API surface. Its [Semantic Search](https://docs.rushdb.com/learn/semantic-search/) (`db.records.vectorSearch`) handles meaning-based retrieval over an indexed property. Its [Smart Search](https://docs.rushdb.com/learn/search-query/smart-search/) (`db.ai.search`) turns a natural-language request into an inspectable, schema-aware `SearchQuery` for structured and relational retrieval. Its normal [records search](https://docs.rushdb.com/learn/records-and-queries/find-and-query/) handles exact filters, aggregations, and graph traversal. None pretends to solve the others' problem. ## TL;DR The useful comparison is not `RAG < GraphRAG < Agentic RAG`. It is: ```mermaid flowchart TD Q["What does this query depend on?"] Q -->|"Meaning / similarity"| V["Vector RAG"] Q -->|"Explicit relationships / topology"| G["GraphRAG"] Q -->|"Multiple dependent retrieval steps"| A["Agentic RAG"] A --> V A --> G V --> C["Shared application context"] G --> C A --> C ``` The sweet spot is a **shared context layer with multiple retrieval modes**: 1. use vector retrieval for fuzzy semantic recall; 2. use graph retrieval when the answer depends on identity, ownership, dependency, provenance, or hierarchy; 3. combine semantic ranking and graph scope when the query needs both; 4. use agentic orchestration only when the sequence of retrieval steps cannot be determined cheaply in advance. > **Do not force topology into embeddings, and do not force fuzzy meaning into topology. Preserve both representations when your application needs both.** The architectural test for any system is whether it can do this over the *same* records — whether the vector path and the relational path observe the same data, labels, relationships, and permissions. RushDB keeps those paths on one data model and one [Labeled Meta Property Graph](https://docs.rushdb.com/learn/records-and-queries/labeled-meta-property-graph/), so an application can pick a retrieval mode per query without ever being forced to standardize on a single paradigm. ```mermaid flowchart LR U["One app / one search box"] --> Q{"What does the request need?"} Q -->|"Meaning"| V["RushDB Semantic Search"] Q -->|"Known structure / relationships"| S["RushDB Smart Search / SearchQuery"] Q -->|"Both"| H["Compose semantic + structural retrieval"] V --> C["Shared RushDB context"] S --> C H --> C ``` --- ## The problem with the maturity ladder Vector retrieval, graph retrieval, and agentic orchestration do not optimize the same thing. Vector RAG compresses content into an embedding space where semantic proximity is queryable. GraphRAG preserves explicit entities and relationships so topology is queryable. Agentic RAG gives a model control over retrieval operations so a plan can be adapted as evidence arrives. None strictly contains the other two. The ecosystem is converging on a more realistic architecture: **one application, several retrieval operators, selected or composed according to query shape.** Microsoft's GraphRAG still exposes vector search alongside local, global, and DRIFT modes;[^ms-query] Neo4j's GraphRAG tooling exposes vector, text-to-Cypher, hybrid, and tool-selecting retrievers.[^neo4j-rag] That is not a compromise between competing paradigms. It is the natural consequence of applications containing different kinds of information. RushDB takes this to its logical endpoint: rather than bolting several stores together and synchronizing them, it exposes the vector, relational, and natural-language-planning paths over one graph data model. You still select the retrieval operator per query — but all operators read the same records, schema, and permissions, removing a whole class of drift and ACL bugs. --- ## Three capabilities, three blind spots | Approach | What it preserves best | Best-shaped question | What it does not guarantee | |---|---|---|---| | Vector RAG | Semantic similarity in embedding space | “What content means something like this?” | Explicit identity, topology, causality, ownership, sequence | | GraphRAG | Entities and explicit relationships | “What is connected to this, and how?” | Fuzzy semantic similarity when no useful edge/path exists | | Agentic RAG | Adaptive retrieval procedure | “What sequence of tools should I use to answer this?” | Better evidence by itself; only as good as its tools and planning | ### Not everything is reachable through connections Graphs are powerful only where meaningful structure exists. “Find postmortems that describe failures similar to a cascading timeout” has no `SIMILAR_TO` edge to traverse: ```mermaid flowchart LR Q["cascading timeout"] -. semantic proximity .-> D1["Postmortem A"] Q -. semantic proximity .-> D2["Incident B"] Q -. semantic proximity .-> D3["Runbook note C"] ``` Their similarity exists in language and meaning — a vector question, not a graph traversal. In RushDB terms, this is Semantic Search over an indexed property. ### Not everything can be preserved as a semantic vector “Which team owns the service affected by INC-204, and which deployment immediately preceded it?” depends on explicit facts: ```mermaid flowchart LR I["INC-204"] -->|AFFECTS| S["Checkout Service"] S -->|OWNED_BY| T["Payments Team"] D["Deployment 8841"] -->|DEPLOYED_TO| S D -->|PRECEDED| I ``` You can serialize these facts and embed them, but nearest-neighbor similarity does not guarantee preservation of relationship semantics, direction, identity, or temporal ordering. The information may be *present* in the corpus while still awkward to *query as a relationship*. Here the correct primitive is structured retrieval: an exact `SearchQuery`, or [Smart Search](https://docs.rushdb.com/learn/search-query/smart-search/) if the user expresses the request in natural language. ### Not every query needs an agent An exact-ID ownership lookup is cheaper and more predictable as a deterministic graph query than as an LLM plan. A semantic-similarity question needs one vector search. Agentic RAG earns its complexity only when the retrieval plan itself is dynamic. --- ## 1. Vector RAG, and the boundary of embeddings Vector RAG turns query and content into embeddings and ranks stored vectors by similarity. This is powerful because human questions rarely use the same vocabulary as the source: “How do we stop customers from getting charged twice?” maps to “Duplicate payment capture caused by retry behavior after gateway timeout.” Vector retrieval is especially strong when the answer is concentrated in one or a few passages, the user's wording differs from the source, and there are no reliable explicit relationships. That describes much documentation search and knowledge-base retrieval. But embeddings do not magically preserve relational truth. Two nearly identical tickets can belong to different projects and owners; their embeddings may be almost identical, yet “Who owns the checkout timeout affecting Atlas?” is answered by a chain of identity and relationships, not by vector distance. > **Embeddings encode similarity. They do not guarantee preservation of explicit topology.** --- ## 2. GraphRAG is broader than “use a graph database” At least four distinct architectures hide under the label: **Pattern A — graph-enriched local retrieval.** Retrieve something semantically, then expand into connected context (provenance, neighbors, dependencies). Microsoft's local search and RushDB's [GraphRAG tutorial](https://docs.rushdb.com/learn/tutorials/ai-and-rag/graphrag/) both follow this shape: vector-seed for relevant chunks, then traverse `HAS_CHUNK`/`COVERS`-style relationships to enrich context. **Pattern B — graph-native structured retrieval.** The user asks a relational question directly: ```mermaid flowchart LR C["CUSTOMER"] -->|HAS_INCIDENT| I["INCIDENT
status = open"] I -->|AFFECTS| S["SERVICE"] S -->|OWNED_BY| T["TEAM
name = Platform"] ``` There is no reason to run vector search. In RushDB this maps to a structured `SearchQuery` via `db.records.find`, or to Smart Search when the request is in natural language. **Pattern C — graph-generated corpus summaries.** Microsoft's GraphRAG extracts an entity graph, runs community detection, and pre-generates community summaries so global search can reason at corpus level — useful for “what are the major recurring themes?”-style questions, and a structurally different evaluation class than local retrieval.[^ms-paper][^ms-global] **Pattern D — graph-guided search over operational data.** The graph already exists because the application data is relational (`ACCOUNT → SUBSCRIPTION → INVOICE`, `SERVICE → DEPENDS_ON → SERVICE`). Retrieval is less about document search and more about preserving state, provenance, and causality across an agent's world. This is precisely the class RushDB is built for: nested JSON becomes connected records on import,[^rush-import] so an agent's world model is already a graph rather than a pile of denormalized chunks. --- ## 3. The four most useful hybrid retrieval patterns ### Pattern 1: structured prefilter → vector ranking Restrict candidates with exact constraints, then rank by similarity. This is frequently the best production pattern because it couples relevance with correctness boundaries such as tenancy, permissions, dates, and lifecycle state. ```mermaid flowchart TD A["All records"] --> F["Structured / graph prefilter"] F --> C["Eligible candidates"] C --> V["Vector similarity ranking"] V --> K["Top-k"] ``` RushDB's `records.vectorSearch()` implements this natively: labels and a `where` clause narrow the candidate set *before* similarity ranking, and `where` supports relationship traversal. Because `where` runs as a graph filter first, a highly selective filter makes semantic search *faster* — fewer records are ranked, not just more correct.[^rush-hybrid] ```sdk results = db.records.vector_search({ "labels": ["INCIDENT"], "propertyName": "description", "query": "authentication failures after a gateway change", "where": { "customerTier": "enterprise", "country": "Germany", "createdAt": {"$gte": "2025-07-01"} }, "limit": 10 }) for incident in results.data: print(incident.score, incident.data) ___SPLIT___ import RushDB from '@rushdb/javascript-sdk' const apiKey = process.env.RUSHDB_API_KEY if (!apiKey) throw new Error('RUSHDB_API_KEY is required') const db = new RushDB(apiKey) const results = await db.records.vectorSearch({ labels: ['INCIDENT'], propertyName: 'description', query: 'authentication failures after a gateway change', where: { customerTier: 'enterprise', country: 'Germany', createdAt: { $gte: '2025-07-01' } }, limit: 10 }) for (const incident of results.data) { console.log(incident.score, incident.data) } ``` ### Pattern 2: vector seed → graph expansion Use vector retrieval to find semantic entry points, then traverse outward to collect context that should not be embedded into every chunk. This is ideal when relevance is fuzzy but context is relational, and it is the pattern behind RushDB's GraphRAG tutorial as well as Neo4j's `VectorCypherRetriever` and LlamaIndex's `VectorContextRetriever`.[^neo4j-rag][^llama-property-graph] ```mermaid flowchart TD Q["Query"] --> V["Vector top-k CHUNK"] V --> S["SOURCE"] V --> A["AUTHOR"] V --> T["TOPIC"] V --> I["INCIDENT"] S --> C["Context assembly"] A --> C T --> C I --> C ``` ### Pattern 3: graph scope → semantic search inside the subgraph Sometimes you know where in the graph the answer must live, but not which text inside that neighborhood is relevant. Define the relational scope first, then rank semantically only inside it: ```mermaid flowchart LR A["ACCOUNT
name = Acme"] --> P["PROJECT
status = active"] P --> N["NOTE candidates"] N --> V["Semantic ranking inside scope"] ``` This is stronger than vector search plus metadata when scope depends on relationships that change over time, and safer for authorization-sensitive systems: the candidate universe is structurally bounded *before* semantic relevance is considered. In RushDB it is a relationship traversal inside the `where` of one `vectorSearch` call: ```sdk results = db.records.vector_search({ "labels": ["NOTE"], "propertyName": "body", "query": "migration risk during the move to the new platform", "where": { "PROJECT": { "$relation": {"type": "BELONGS_TO", "direction": "out"}, "status": "active", "ACCOUNT": { "$relation": {"type": "OWNS", "direction": "in"}, "name": "Acme" } } }, "limit": 10 }) ___SPLIT___ const results = await db.records.vectorSearch({ labels: ['NOTE'], propertyName: 'body', query: 'migration risk during the move to the new platform', where: { PROJECT: { $relation: { type: 'BELONGS_TO', direction: 'out' }, status: 'active', ACCOUNT: { $relation: { type: 'OWNS', direction: 'in' }, name: 'Acme' } } }, limit: 10 }) ``` That is the difference between “hybrid retrieval” and “vector search plus an application-side join.” ### Pattern 4: parallel retrieval → rank/fuse Run multiple retrievers independently and merge the results (reciprocal-rank fusion or a learned reranker). Useful when no single retriever dominates, but it executes several paths per query — a good fit when recall matters more than latency, a poor default otherwise. Because RushDB exposes all paths through one client, fusion needs no separate vector, graph, and keyword services. --- ## 4. Agentic RAG is a router and planner, not a better vector index > **Agentic RAG turns retrieval strategies into tools and gives a model control over which tools to call.** That is useful when the sequence of steps genuinely cannot be known in advance. But every agentic step carries a tax: another model decision, another round trip, more tokens, another place for tool arguments to be wrong. > **Do not use an agent to decide something a deterministic router can decide reliably.** The bigger architectural win for most systems is classifying query shape *before* retrieval. A useful router distinguishes exact lookups, filtered lookups, semantic similarity, relational, hybrid, and multi-step shapes — and a simple deterministic router is enough: ```sdk def route(query: str, has_ui_filters: bool, has_exact_id: bool, asks_relationships: bool, needs_semantics: bool, needs_multistep: bool) -> str: if has_exact_id: return "structured" if has_ui_filters and not needs_semantics: return "structured" if asks_relationships: return "hybrid" if needs_semantics else "graph" if needs_multistep: return "agentic" return "vector" ___SPLIT___ function route(signals: RouteSignals): string { if (signals.hasExactId) return 'structured' if (signals.hasUiFilters && !signals.needsSemantics) { return 'structured' } if (signals.asksRelationships) { return signals.needsSemantics ? 'hybrid' : 'graph' } if (signals.needsMultistep) return 'agentic' return 'vector' } ``` This is also where a schema-aware [Smart Search](https://docs.rushdb.com/learn/search-query/smart-search/) fits: instead of handing an agent free rein over arbitrary database operations, RushDB constrains natural-language requests to a bounded, inspectable `SearchQuery` that runs through the normal records path. You get planning where it helps without unbounded tool access. --- ## 5. Cost is more than query latency **Indexing cost.** A graph extracted from unstructured text requires entity extraction, entity resolution, relationship extraction, and optional community summarization — far more expensive than vector indexing.[^ms-index] LazyGraphRAG explores deferring that cost, but the numbers are implementation-specific, not universal.[^lazy-graphrag] When the source data is already structured (JSON, CSV, a database export), you can model the graph directly: RushDB's JSON import decomposes nested payloads into typed records and creates parent-child relationships during ingestion,[^rush-import] collapsing most graph-construction cost for operational data. **Query compute.** A vector query is one embedding plus ANN. A graph query is seed identification plus traversal plus filter plus ranking. Global and agentic queries multiply the LLM work. **Context-window cost.** Retrieval cost is not only database work. An uncontrolled graph expansion turns 5 seeds into ~1,000 candidate facts; the LLM should not receive all of them. GraphRAG needs context budgeting — hop limits, relationship allowlists, per-relation caps, deduplication, reranking, token-budget-aware assembly — just as vector RAG needs top-k tuning. **Operational complexity.** The hidden cost of hybrid stacks is running a vector database, a graph database, indexing pipelines, synchronization jobs, separate ACL logic, and duplicate deletion paths. The fewer places the vector view and the relational view can disagree, the cheaper the system is to operate — the operational argument for one data model over multiple retrieval operators.[^rush-lmpg] --- ## 6. Freshness and graph quality **Freshness.** GraphRAG demos assume the graph is correct; production must keep it correct. If ownership is duplicated into dozens of chunks and embeddings, those chunks go stale when the service changes owner. If ownership is a first-class relationship, update it once: ```mermaid flowchart LR S["SERVICE: Checkout"] -->|OWNED_BY| T["TEAM: Commerce Platform"] ``` Separate *semantic evidence* (embeddings) from *operational truth* (explicit records and relationships), and resolve mutable facts — permissions, incident state, account status, active contracts, policy versions — at query time. This is why RushDB's hybrid retrieval keeps `where` as a graph filter executed at query time: tenancy and ownership come from the current graph state, not stale embeddings.[^rush-hybrid] **Graph quality.** A bad graph makes retrieval worse: duplicated entities fragment traversals, generic `RELATED_TO` edges preserve little queryable meaning, and overconnected neighborhoods stop being selective. Graph construction needs discipline — stable identity, typed relationships, direction, provenance, and explicit separation of observed vs inferred edges. RushDB's relationship-suggestion flow keeps inferred patterns reviewable before approval rather than silently materializing them as truth.[^rush-patterns] --- ## 7. How RushDB removes the need to choose [RushDB](https://rushdb.com/) is relevant here precisely because its thesis does **not** require every query to become GraphRAG. It puts structured records, relationships, live schema metadata, and semantic indexes behind one data model and API surface, so one application can choose different retrieval paths over the same context. The value is not “graph beats vector”; it is avoiding separate, drifting representations when the application genuinely needs both. ### 7.1 Nested data becomes connected records Import nested JSON and it becomes a connected shape rather than an opaque blob:[^rush-import] ```sdk db.records.import_json({ "label": "PROJECT", "data": [{ "name": "Atlas", "ISSUE": [{"title": "Checkout timeout", "status": "open"}], "TEAM": [{"name": "Payments"}] }] }) ___SPLIT___ await db.records.importJson({ label: 'PROJECT', data: [{ name: 'Atlas', ISSUE: [{ title: 'Checkout timeout', status: 'open' }], TEAM: [{ name: 'Payments' }] }] }) ``` That topology can later be refined with explicitly typed relationships. ### 7.2 The schema is queryable at runtime RushDB's [Labeled Meta Property Graph (LMPG)](https://docs.rushdb.com/learn/records-and-queries/labeled-meta-property-graph/) represents property definitions as first-class metadata in the graph, exposing labels, property names, inferred types, value domains, relationship structure, and vector-index metadata as runtime schema.[^rush-lmpg] Query planning is much safer when the model can inspect the actual schema — and application code can discover facets at runtime: ```sdk properties = db.properties.find({}) facet = next(prop for prop in properties["data"] if prop["name"] == "importance") values = db.properties.values(facet["id"]) print(json.dumps(values["data"], indent=2)) ___SPLIT___ const properties = await db.properties.find({}) const facet = properties.data.find((item) => item.name === "importance") if (!facet) throw new Error("Property importance is missing") const values = await db.properties.values(facet.id) console.log(JSON.stringify(values.data, null, 2)) ``` That same runtime schema grounds Smart Search in a real vocabulary — labels, properties, relationships, and semantic indexes from the project, not a static prompt template. ### 7.3 Two senses of “hybrid” It is useful to separate them, because “one database” does not mean “one query plan”: **Native hybrid filtering** — relationship + structured constraints, then vector ranking, in one call: ```mermaid flowchart LR R["Relationship + structured constraints"] --> V["Vector ranking"] --> K["Top-k eligible records"] ``` **Multi-stage graph enrichment** — still requires orchestration: ```mermaid flowchart LR V["Vector top-k"] --> T["Traverse from matched records"] --> N["Assemble graph neighborhood"] ``` A real vector-seed → graph-expansion retrieval in RushDB mirrors the [GraphRAG tutorial](https://docs.rushdb.com/learn/tutorials/ai-and-rag/graphrag/): ```sdk from concurrent.futures import ThreadPoolExecutor from rushdb import RushDB import os db = RushDB(os.environ["RUSHDB_API_KEY"], base_url="https://api.rushdb.com/api/v1") def graph_rag_retrieve(user_query: str, k: int = 5) -> list[dict]: semantic_matches = db.records.vector_search({ "query": user_query, "propertyName": "text", "labels": ["CHUNK"], "limit": k }) def enrich(chunk): source_result = db.records.find({ "labels": ["SOURCE"], "where": { "CHUNK": {"$relation": {"type": "HAS_CHUNK", "direction": "out"}, "$id": chunk.id} } }) topic_result = db.records.find({ "labels": ["TOPIC"], "where": { "CHUNK": {"$relation": {"type": "COVERS", "direction": "out"}, "$id": chunk.id} } }) source = source_result.data[0] if source_result.data else None return { "text": chunk.get("text"), "score": chunk.score, "source": source.get("filename") if source else "unknown", "topics": [topic.get("name") for topic in topic_result.data] } with ThreadPoolExecutor(max_workers=5) as pool: return list(pool.map(enrich, semantic_matches.data)) context = graph_rag_retrieve("How does the caching layer handle invalidation?") ___SPLIT___ import RushDB from '@rushdb/javascript-sdk' const apiKey = process.env.RUSHDB_API_KEY if (!apiKey) throw new Error('RUSHDB_API_KEY is required') const db = new RushDB(apiKey) async function graphRagRetrieve(userQuery: string, k = 5) { const semanticMatches = await db.records.vectorSearch({ query: userQuery, propertyName: 'text', labels: ['CHUNK'], limit: k }) return Promise.all( semanticMatches.data.map(async (chunk) => { const [sourceResult, topicResult] = await Promise.all([ db.records.find({ labels: ['SOURCE'], where: { CHUNK: { $relation: { type: 'HAS_CHUNK', direction: 'out' }, $id: chunk.id } } }), db.records.find({ labels: ['TOPIC'], where: { CHUNK: { $relation: { type: 'COVERS', direction: 'out' }, $id: chunk.id } } }) ]) return { text: chunk.text, score: chunk.score, source: sourceResult.data[0]?.filename ?? 'unknown', topics: topicResult.data.map((topic) => topic.name) } }) ) } const context = await graphRagRetrieve( 'How does the caching layer handle invalidation?' ) ``` **Graph-aware filtering can be one retrieval call; graph enrichment is usually a retrieval workflow.** ### 7.4 Smart Search is query planning, not vector ranking [Smart Search](https://docs.rushdb.com/learn/search-query/smart-search/) translates natural language into an inspectable `SearchQuery`, executes it through the normal records path, and returns the records plus the generated query and warnings. The LLM does not invent arbitrary operations; it produces a constrained query you can inspect, validate, and refine. The docs are explicit: Smart Search is for schema-aware structured, relational, and filtered retrieval — not a substitute for similarity ranking. The same application uses `db.ai.search` when structure or relationships matter and `db.records.vectorSearch` when meaning matters: ```sdk # Relational / structured intent: let RushDB plan against the live schema. relational = db.ai.search( "Find active enterprise customers connected to overdue invoices" ) print(relational.search_query) print(relational.warnings) for record in relational: print(record.data) # Semantic intent: rank a known indexed property by meaning. semantic = db.records.vector_search({ "labels": ["NOTE"], "propertyName": "body", "query": "customer may cancel because onboarding is going badly", "limit": 10 }) for record in semantic.data: print(record.score, record.data) ___SPLIT___ // Relational / structured intent: let RushDB plan against the live schema. const relational = await db.ai.search( 'Find active enterprise customers connected to overdue invoices' ) console.dir(relational.searchQuery, { depth: null }) console.log(relational.warnings) for (const record of relational.data) { console.log(record.data) } // Semantic intent: rank a known indexed property by meaning. const semantic = await db.records.vectorSearch({ labels: ['NOTE'], propertyName: 'body', query: 'customer may cancel because onboarding is going badly', limit: 10 }) for (const record of semantic.data) { console.log(record.score, record.data) } ``` That is the article's core point implemented literally: **the natural-language interface does not force every request through the same retrieval mechanism.** Smart Search also lets natural language refine an existing query object via `current_query`/`currentQuery`, turning the generated `SearchQuery` into conversational query-builder state rather than replacing it with an opaque prose-only plan: ```sdk initial = db.ai.search("Find active enterprise customers created last quarter") refined = db.ai.search( "Only show records from Germany", current_query=initial.search_query ) print(refined.search_query) print(refined.warnings) ___SPLIT___ const initial = await db.ai.search('Find active enterprise customers created last quarter') const refined = await db.ai.search('Only show records from Germany', { currentQuery: initial.searchQuery }) console.dir(refined.searchQuery, { depth: null }) console.log(refined.warnings) ``` Raw Cypher remains an escape hatch for projects on a user-owned Neo4j instance,[^rush-raw] but for agent-facing workloads the safer default is the constrained, inspectable query surface. --- ## 8. A worked example: support incident retrieval A support model with `CUSTOMER → PROJECT → INCIDENT → SERVICE → TEAM`, plus `RUNBOOK` and `DEPLOYMENT`, does not need one universal retrieval endpoint. One search experience can route by intent: ```mermaid flowchart TD U["Support search box"] --> R{"Intent"} R -->|"similar failure"| V["vectorSearch(INCIDENT.description)"] R -->|"exact ID / relationship"| Q["SearchQuery / Smart Search"] R -->|"similar + customer/service scope"| H["where prefilter + vector ranking"] R -->|"multi-step evidence"| A["agent/application orchestration"] A --> V A --> Q ``` - **“Find incidents like this one.”** Vector search over `INCIDENT.description` — no traversal needed. - **“Find incidents like this one for Acme.”** Acme's structural scope as a prefilter, then semantic ranking: *structure defines eligibility; embeddings rank meaning inside the eligible set.* - **“Who owns the service affected by INC-204?”** Skip vectors. A deterministic `SearchQuery` — or Smart Search for a natural-language UI — answers directly; adding similarity would not make it more correct. - **“What runbook should we use for incidents similar to INC-204?”** Get INC-204 → vector-search similar incidents → traverse `INCIDENT → SERVICE → RUNBOOK` → rank/dedupe runbooks. - **“What failure patterns recur across all incidents this quarter?”** A corpus-level problem: aggregate structured categories, cluster embeddings, or use global/community summaries, depending on whether the patterns exist as explicit data or must be inferred from text. --- ## 9. Evaluate, then migrate **Evaluate fairly.** A misleading benchmark evaluates every retriever on the same undifferentiated question set. Label queries by information need (semantic-local, exact/structured, relational single/multi-hop, hybrid, global) and report per query class, not just overall. Measure retrieval (Recall@k, MRR/nDCG, path recall), answers (correctness, attribution, unsupported-claim rate), the system (latency, LLM calls, tokens, stale-answer rate), and operational complexity (number of stores, sync pipelines, ACL implementations).[^benchmarkqed] **Run an ablation, not a migration.** Compare vector-only, vector+filter, vector→graph-expansion, direct-graph, routed hybrid, and agentic hybrid against your query distribution. You may discover vector-only remains best for 60% of traffic, graph traversal improves 20%, hybrid matters for 15%, and only 5% genuinely needs agentic planning. If so, forcing every query through the most expensive pipeline is a regression. **Migrate incrementally.** Classify failures (semantic miss vs wrong scope vs missing relationship vs global vs multi-step vs stale source), improve vector retrieval first, model only the relationships that matter, add graph scoping (a `where` relationship constraint inside `vectorSearch` — no new infrastructure, because RushDB data is already relational on import),[^rush-import] add graph expansion, add routing, and only then add agentic orchestration where needed. --- ## 10. Decision matrix: where each approach earns its place | Situation | Vector RAG | GraphRAG | Agentic RAG | |---|---:|---:|---:| | Similar-document or semantic search | **Best fit** | Usually unnecessary | Rarely needed | | Fuzzy question with structured scope | **Best semantic operator**, combined with filters/graph | Useful for scope | Sometimes | | Exact operational lookup | Weak alone | **Best fit** when relationships matter | Usually unnecessary | | Multi-hop ownership / dependency / provenance | Weak alone | **Best fit** | Useful if the path must be discovered dynamically | | Semantic seed + connected evidence | **Needed for fuzzy seed** | **Needed for enrichment** | Optional orchestration | | Corpus-wide themes | Local vector baseline is weak | Global/community GraphRAG can help | Useful for decomposition | | Dynamic multi-tool investigation | Useful tool | Useful tool | **Best fit** when the plan changes as evidence arrives | | Lowest possible latency | Often strongest | Depends on traversal | Usually weakest | | Rich explicit provenance | Limited unless denormalized | **Strongest** | Depends on tool evidence | The table is intentionally not a leaderboard. Each bold cell marks a different query shape, not a globally superior architecture. --- ## 11. The sweet spot: one app, multiple retrieval modes The architecture I would default to is a **shared context layer with multiple retrieval modes**: ```mermaid flowchart TD APP["One application"] --> R["Schema-aware router"] R --> V["Vector RAG
semantic similarity"] R --> G["GraphRAG
relationships / topology"] R --> A["Agentic RAG
adaptive planning"] A --> V A --> G V --> B["Evidence budget"] G --> B A --> B B --> RR["Rerank / validate"] RR --> OUT["Answer or action"] ``` The point is not that every request is hybrid. It is that the same application can be vector-only for one query, graph-only for another, and genuinely hybrid for a third. The design principle: 1. preserve semantic information where semantic retrieval is useful; 2. preserve explicit relationships where correctness depends on structure; 3. keep hard filters and permissions deterministic; 4. route simple queries directly; 5. compose retrieval modes only when the query genuinely crosses information types; 6. use an agent only when the sequence cannot be predetermined reliably. Underneath this is the reason hybrid retrieval exists: applications contain at least two irreducible information spaces. ```mermaid flowchart LR M["Semantic space
meaning, paraphrase, similarity"] --> APP["Application context"] T["Topological space
identity, links, provenance, dependency"] --> APP ``` Embedding space excels at the left side; graph structure at the right. Neither is a lossless encoding of the other. Agentic orchestration becomes useful when a task must cross between them — coordination across capabilities, not replacement of them. The goal is not the most sophisticated retrieval pipeline. It is the least complicated pipeline that still preserves the evidence needed for the answer. --- ## The short decision rule | The answer depends mainly on... | Start with... | |---|---| | semantic similarity, paraphrase, fuzzy meaning | Vector RAG | | explicit entities, relationships, hierarchy, provenance, ownership | GraphRAG | | both semantic relevance and structural context | Combine vector + graph | | an unknown or changing sequence of retrieval steps | Agentic RAG | And remember the two failure conditions that make a single-paradigm architecture brittle: > **Not everything is reachable through connections.** > > **Not everything can be preserved as a semantic vector.** The strongest system is not the one that pushes everything into a graph, everything into vectors, or everything through an agent. It is the one that refuses to destroy useful information just to standardize on one retrieval paradigm — and that is the architectural role [RushDB](https://rushdb.com/) occupies: a shared context layer where structured data, relationships, semantic retrieval, and agent-driven querying coexist over the same records. [Semantic Search](https://docs.rushdb.com/learn/semantic-search/) handles meaning; [Smart Search](https://docs.rushdb.com/learn/search-query/smart-search/) plans schema-aware natural-language queries; [Hybrid Retrieval](https://docs.rushdb.com/learn/tutorials/ai-and-rag/hybrid-retrieval/) combines structural constraints with semantic ranking; and [GraphRAG](https://docs.rushdb.com/learn/tutorials/ai-and-rag/graphrag/) shows the multi-stage vector-seed → graph-expansion pattern. **Right tool. Right query. Same application.** --- ## Sources [RushDB Features](https://rushdb.com/features) [^ms-paper]: Darren Edge et al., **From Local to Global: A Graph RAG Approach to Query-Focused Summarization** — https://arxiv.org/abs/2404.16130 [^ms-query]: Microsoft GraphRAG, **Query Engine Overview** — https://microsoft.github.io/graphrag/query/overview/ [^ms-local]: Microsoft GraphRAG, **Local Search** — https://microsoft.github.io/graphrag/query/local_search/ [^ms-global]: Microsoft GraphRAG, **Global Search** — https://microsoft.github.io/graphrag/query/global_search/ [^ms-index]: Microsoft GraphRAG, **Indexing Overview / Methods** — https://microsoft.github.io/graphrag/index/overview/ and https://microsoft.github.io/graphrag/index/methods/ [^lazy-graphrag]: Microsoft Research, **LazyGraphRAG: Setting a new standard for quality and cost** — https://www.microsoft.com/en-us/research/blog/lazygraphrag-setting-a-new-standard-for-quality-and-cost/ [^benchmarkqed]: Microsoft Research, **BenchmarkQED: Automated benchmarking of RAG systems** — https://www.microsoft.com/en-us/research/blog/benchmarkqed-automated-benchmarking-of-rag-systems/ [^neo4j-rag]: Neo4j, **GraphRAG Python User Guide: RAG / Retrievers** — https://neo4j.com/docs/neo4j-graphrag-python/current/user_guide_rag.html [^llama-property-graph]: LlamaIndex, **Using a Property Graph Index** — https://developers.llamaindex.ai/python/framework/module_guides/indexing/lpg_index_guide/ [^rush-semantic]: RushDB, **Semantic Search** — https://docs.rushdb.com/learn/semantic-search/ [^rush-hybrid]: RushDB, **Hybrid Retrieval: Filters Plus Semantic Search** — https://docs.rushdb.com/learn/tutorials/ai-and-rag/hybrid-retrieval/ [^rush-graphrag]: RushDB, **GraphRAG — Graph-Enriched Retrieval Augmented Generation** — https://docs.rushdb.com/learn/tutorials/ai-and-rag/graphrag/ [^rush-smart]: RushDB, **Smart Search** — https://docs.rushdb.com/learn/search-query/smart-search/ [^rush-lmpg]: RushDB, **Labeled Meta Property Graph** — https://docs.rushdb.com/learn/records-and-queries/labeled-meta-property-graph/ [^rush-import]: RushDB, **Import Data** — https://docs.rushdb.com/learn/records-and-queries/import-data/ [^rush-patterns]: RushDB, **Suggested Relationship Patterns** — https://docs.rushdb.com/learn/relationships/suggested-patterns [^rush-raw]: RushDB, **Raw Queries** — https://docs.rushdb.com/learn/records-and-queries/raw-queries/ --- ## Persistent Agent Memory for OpenClaw and Hermes with RushDB Canonical URL: https://rushdb.com/blog/persistent-agent-memory-openclaw-hermes-rushdb Published: 2026-08-18T17:02:00.000Z Updated: 2026-08-18T17:56:32.945Z Author: RushDB Category: Engineering Tags: AI agents, agent memory, persistent memory, openclaw, hermes agent, knowledge graph # Persistent Agent Memory for OpenClaw and Hermes with RushDB RushDB now has native memory connectors for OpenClaw and Hermes Agent. Both integrations recall relevant history before inference, persist completed turns through a durable local outbox, and keep remote database failures away from the conversation path. They share one provider-neutral event contract, so memory written by different runtimes has the same identity, scope, trust, and retrieval semantics. The connectors are available today as [`@rushdb/openclaw-memory`](https://www.npmjs.com/package/@rushdb/openclaw-memory) on npm and [`rushdb-hermes-memory`](https://pypi.org/project/rushdb-hermes-memory/) on PyPI. ## Why native memory needs lifecycle hooks An MCP server gives an agent tools. The model can decide to search, create, update, or traverse records, which is exactly what you want for explicit work such as storing a decision or connecting a task to an artifact. Automatic memory has a different job. It must run at moments the model does not control: - recall before the prompt is finalized; - capture only after a turn completes successfully; - preserve the last bounded episode before compression; - rotate or clear state when sessions change; - flush pending writes during session end and shutdown. A tool call cannot guarantee those transitions. A native connector can, because it participates directly in the host runtime lifecycle. The new RushDB connectors make that lifecycle plane automatic while leaving MCP available as the knowledge plane. ## What shipped | Package | Runtime | Role | | --------------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------- | | `@rushdb/openclaw-memory` | OpenClaw | Additive plugin for automatic recall and completed-turn capture | | `rushdb-hermes-memory` | Hermes Agent | Native `MemoryProvider` with recall, turn sync, compression, and session hooks | | `@rushdb/agent-memory-contract`| TypeScript and custom runtimes | Shared AgentMemoryEvent v1 types, identity helpers, scoped client, schema, and fixture | At a high level, both native connectors follow the same path: ```text Before inference host metadata -> authorized scope -> RushDB semantic recall -> untrusted context After a successful turn latest user/assistant pair -> local outbox -> idempotent RushDB upsert -> EPISODE During degraded operation short timeout -> continue the host turn -> replay pending writes later ``` This is memory designed around agent execution rather than a generic transcript archive. ## OpenClaw: additive memory without replacing local storage The OpenClaw connector supplements the runtime's existing Markdown and SQLite memory. It does not claim an exclusive memory slot or disable local behavior. The plugin searches RushDB before prompt construction and projects the latest successful user/assistant pair to an `EPISODE` after `agent_end`. Install the published package and expose a RushDB project key to the gateway: ```bash openclaw plugins install @rushdb/openclaw-memory export RUSHDB_API_KEY="your-project-api-key" ``` Automatic recall and capture are enabled by default. A minimal explicit configuration looks like this: ```json { "plugins": { "entries": { "rushdb-memory": { "enabled": true, "config": { "profileId": "default", "autoRecall": true, "autoCapture": true, "recallTimeoutMs": 300 } } } } } ``` Only eligible private or local conversations receive automatic RushDB memory. Sandboxed, shared-group, automation, heartbeat, hook, and subagent contexts fail closed. The plugin also ignores system messages, full transcripts, tool calls, command output, secrets, and local paths during automatic capture. Completed events first enter a mode-`0600` outbox under `~/.openclaw/rushdb-memory/outbox`. If RushDB is temporarily unavailable, OpenClaw still replies, its local memory remains active, and the pending event can replay after restart. The [OpenClaw connector guide](https://docs.rushdb.com/connect/openclaw-memory) documents the full configuration and verification flow. OpenClaw currently maps completed turns to `EPISODE`. Its existing local memory path remains the right owner for explicit “remember this” behavior; use RushDB MCP when the model needs to create intentional graph records. ## Hermes Agent: a native MemoryProvider The Hermes connector implements the runtime's native `MemoryProvider` interface. It prefetches scoped memory, synchronizes successful primary-agent turns, captures the latest eligible episode before compression, reacts to session switches, and performs bounded flushes at session end and shutdown. Install the provider into the same Python environment as Hermes: ```bash pip install rushdb-hermes-memory export RUSHDB_API_KEY="your-project-api-key" hermes memory setup ``` Hermes discovers the `rushdb` provider through its Python entry-point system. Once selected, the provider owns automatic lifecycle recall and persistence without requiring the model to call a database tool. Hermes also exposes a trusted native memory-write surface. Supported `add` and `replace` events become active `MEMORY_FACT` records, so an explicit preference or rule can be recalled independently from conversational episodes. The local outbox lives under `$HERMES_HOME/rushdb-memory/outbox`, preserving profile isolation. Subagents and other non-primary contexts do not write automatic memory. See the [Hermes provider guide](https://docs.rushdb.com/connect/hermes-memory) for lifecycle details and environment options. ## One contract across both runtimes The connectors share AgentMemoryEvent v1 instead of inventing an OpenClaw schema and a separate Hermes schema. The contract defines two canonical record types: | Label | Semantic property | Meaning | | ------------- | ----------------- | ------------------------------------------------------------- | | `EPISODE` | `summary` | One bounded completed turn or lifecycle observation | | `MEMORY_FACT` | `text` | A curated preference, rule, or fact with active/version state | Every canonical record carries the same authorization scope: ```text agentId profileId privacyScope participantScopeHash sandboxEligible ``` These fields are structured prefilters, not similarity hints. The connector applies all five before vector ranking. Participant identifiers are salted and hashed instead of being stored as raw platform IDs, and a runtime that cannot derive a trusted scope does not broaden the query. AgentMemoryEvent v1 also standardizes provenance, visibility, trust classification, timestamps, and deterministic SHA-256 identities. Retries therefore use the same `eventId` or `factId`, allowing idempotent upserts instead of duplicate memories. The [event contract documentation](https://docs.rushdb.com/learn/agent-memory/event-contract) includes the canonical graph, supersession rules, and trust boundaries. For custom TypeScript harnesses, the contract package exposes the same primitives directly: ```bash pnpm add @rushdb/agent-memory-contract ``` Its published JSON Schema and conformance fixture provide a language-neutral boundary for other runtimes. ## Durability without adding latency to every answer Memory persistence is a separate committed action from the model response. Neither connector keeps a database transaction open across inference or waits indefinitely for a remote write. The reliability model has four parts: 1. **Fail-open recall.** A short timeout returns no remote memory instead of failing the host turn. 2. **Durable enqueue.** Completed episodes reach a local outbox before background delivery is acknowledged. 3. **Idempotent replay.** Deterministic IDs make retry and restart replay safe. 4. **Recent-write fallback.** A bounded local cache makes fresh episodes recallable while managed embeddings become visible. This keeps the conversation responsive while still giving acknowledged memory writes a durable path to RushDB. ## Native memory and MCP solve different problems Installing a native connector does not make RushDB MCP redundant. The two layers are complementary: | Layer | Best owner for | | ---------------- | ------------------------------------------------------------------------------------------------------------ | | Native connector | Pre-inference recall, completed-turn episodes, compression/session handling, retry, shutdown | | RushDB MCP | Explicit `DECISION`, `TASK`, `ENTITY`, `ARTIFACT`, and other domain records; graph traversal; administration | The important rule is to assign each operation one owner. Do not mirror every completed turn through MCP when the native connector already captures it. Use MCP when the write adds intentional structure beyond the episode—for example, turning a conversation outcome into a `DECISION` connected to a `TASK` and an `ARTIFACT`. For application-controlled runtimes, use the shared contract and a RushDB SDK to build the same lifecycle explicitly. For hosts without native hooks, MCP-only memory remains useful, but recall and persistence are model-directed rather than guaranteed lifecycle operations. ## How to verify the integration After installing either connector: 1. Tell the primary agent a stable project decision in an eligible private session. 2. Complete the turn and end or switch the session. 3. Start another authorized session with the same profile and participant scope. 4. Ask about the decision without instructing the model to call RushDB. 5. Confirm that one canonical `EPISODE` exists for the deterministic event ID. 6. Temporarily make RushDB unavailable and confirm that the conversation still completes. 7. Restore connectivity and verify that the outbox replays the pending event. For Hermes, also test an explicit native memory `add` and confirm that it creates an active `MEMORY_FACT`. For OpenClaw, confirm that local Markdown and SQLite memory remain available alongside the RushDB supplement. ## A shared memory layer, not a shared transcript The goal is not to upload everything an agent sees. It is to retain the smallest useful, authorized memory unit and make it available at the right lifecycle moment. OpenClaw and Hermes now reach that goal through their own native interfaces while producing compatible RushDB records. The result is automatic recall where it belongs, durable capture without response-path network waits, explicit boundaries for privacy and trust, and a graph layer ready for more deliberate knowledge operations. Create a project at [app.rushdb.com](https://app.rushdb.com), install the connector for your runtime, and let the next session start with the context the previous one earned. ## Sources - [OpenClaw Native Memory documentation](https://docs.rushdb.com/connect/openclaw-memory) - [Hermes Native Memory Provider documentation](https://docs.rushdb.com/connect/hermes-memory) - [Agent Memory Event Contract documentation](https://docs.rushdb.com/learn/agent-memory/event-contract) - [`@rushdb/openclaw-memory` on npm](https://www.npmjs.com/package/@rushdb/openclaw-memory) - [`rushdb-hermes-memory` on PyPI](https://pypi.org/project/rushdb-hermes-memory/) - [`@rushdb/agent-memory-contract` on npm](https://www.npmjs.com/package/@rushdb/agent-memory-contract) --- ## Vector Search Doesn't Understand Data Structure Canonical URL: https://rushdb.com/blog/vector-search-doesn-t-understand-data-structure-cda544 Published: 2026-07-21T23:35:00.000Z Updated: 2026-07-22T08:01:16.649Z Author: RushDB Category: Engineering Tags: vector search, graph database, hybrid retrieval, semantic search, RAG, schema discovery, RushDB # Vector Search Doesn't Understand Data Structure Vector search is genuinely good at one thing: finding records whose meaning is close to a query. Given a question about data retention obligations, a well-tuned embedding model will surface clauses that discuss keeping records, storing data, and retention periods—even when none of those exact words appear in the query. That capability is valuable. But it answers exactly one question: *how similar is this text to that text?* It does not answer whether the retrieved clause belongs to the correct jurisdiction, whether the department that owns it has authority over the requesting user, or whether the policy type is `retention` rather than `consent`. Those are structural questions, and embeddings have no representation for structure. This gap becomes a real failure mode in any system where retrieval must respect hard boundaries—compliance routing, multi-tenant knowledge bases, agentic memory systems that need to reason over connected evidence rather than isolated passages. The rest of this article explains why the gap exists, what it costs in practice, and how RushDB's Labeled Meta Property Graph model closes it by treating vector search as one signal inside a structure-aware graph. ## The Structural Blind Spot An embedding is a point in high-dimensional space. Two points are close when the underlying texts share semantic content. That is the entire information model: proximity, not provenance. Consider a compliance agent that must answer: *"What is our data retention obligation for EU users?"* A pure vector search over a policy corpus will rank every clause that discusses retention, regardless of which jurisdiction authored it, which department owns it, or whether it applies to the requesting context. A US-jurisdiction retention policy and an EU-jurisdiction retention policy may be nearly identical in meaning—and therefore nearly identical in vector space—even though serving the wrong one constitutes a compliance failure. This is not a tuning problem. No amount of prompt engineering or re-ranking fixes it, because the jurisdiction relationship is not encoded in the embedding at all. The embedding captures what the text says; it does not capture where the text sits in the organizational graph. **Three concrete failure modes** - **Jurisdiction leak.** Semantically similar policies from different regulatory regions rank together. The agent retrieves an EU clause in response to a US query, or vice versa, because the cosine distance between them is small. - **Cardinality blindness.** A department owns two policies: one `retention` and one `consent`. A query for retention policies may return both, because the semantic distance between "keep data for three years" and "keep marketing emails indefinitely" is smaller than it looks to a human. - **Constraint invisibility.** Business rules like `severity: critical` or `type: retention` exist as typed properties on records, but a flat vector store treats metadata as opaque filter fields with no awareness of the graph they inhabit. Filtering on `severity` in a vector store is possible, but it is application-managed—the store has no concept that `severity` is a property of a `POLICY` node that is owned by a `DEPARTMENT` that belongs to a `JURISDICTION`. The meaningful distinction is not whether a vector store *can* store metadata—most can. The distinction is whether connected context is traversed natively as part of the query, or reconstructed in application logic after retrieval. When the graph is reconstructed in application code, every new relationship type requires a new join, a new filter pass, and a new opportunity for the boundary to be missed. ## Two Models of the Same Data It helps to hold two pictures of the same compliance dataset in mind simultaneously. **The flat vector picture.** Every policy clause is a vector. Queries return the nearest vectors. Metadata fields like `jurisdiction` and `department` can be attached as payload, and some vector stores support pre-filtering on those fields before ranking. But the relationships between jurisdictions, departments, and policies are not first-class citizens of the data model. They exist only as repeated values in metadata columns, and the query planner has no way to traverse them. **The graph picture.** `JURISDICTION → DEPARTMENT → POLICY` is an explicit edge structure. A `POLICY` node carries typed properties: `type: string`, `severity: string`, `clause: string`. The graph knows that `EU Data Retention Policy` is reachable from the `EU` jurisdiction through the `Legal` department. A query can start from a jurisdiction constraint, traverse to its policies, and *then* rank by semantic similarity—in that order, not the reverse. RushDB implements the second picture through its Labeled Meta Property Graph (LMPG) model, which runs on Neo4j as the underlying storage and transaction engine. Where a plain Labeled Property Graph treats properties as key-value pairs attached to nodes, the LMPG elevates properties into first-class graph structures—HyperProperties—that can themselves carry metadata, participate in indexes, and be queried across the graph. Embedding indexes are one expression of this: a `clause` property can have a vector index attached to it, making it queryable by semantic similarity while remaining a typed, traversable property inside the graph. [RushDB 2.0: Memory Infrastructure for the Agentic Era](https://rushdb.com/blog/rushdb-2-0-release) The result is that semantic similarity becomes one signal among several, not the only signal. A `SearchQuery` can express: *find `POLICY` records where `type` equals `retention` and `severity` equals `critical`*—and optionally rank the filtered set by how closely the `clause` text matches a natural-language query. The structural constraint runs first; the semantic ranking runs over the surviving candidates. [Hybrid Retrieval: Filters Plus Semantic Search](https://docs.rushdb.com/learn/tutorials/ai-and-rag/hybrid-retrieval) The diagram below contrasts the two retrieval paths over the same dataset. ```mermaid flowchart LR subgraph flat["Flat Vector Search"] direction TB Q1["Query"] -->|"cosine similarity, no boundary"| VI["Vector Index"] VI -->|"returned"| EUP["EU Policy"] VI -->|"also returned — jurisdiction leak"| USP["US Policy"] end subgraph hybrid["RushDB Hybrid Search"] direction TB Q2["Query"] -->|"filter: name = EU"| J["JURISDICTION"] J -->|"graph traversal"| D["DEPARTMENT"] D -->|"graph traversal"| P["POLICY"] P -->|"ranked by similarity"| EUP2["EU Policy"] end ``` ## How RushDB Combines Structure and Similarity RushDB exposes three capabilities that work together to close the gap between semantic retrieval and structural reasoning. **Embedding indexes as first-class graph concepts.** An embedding index in RushDB is not a separate service or a sidecar vector store. It is a policy attached to a string property inside the LMPG. When you create an index on `POLICY.clause`, RushDB manages the embedding lifecycle on Neo4j—generating vectors for new records, updating them on writes, and exposing the index through `db.records.vectorSearch()`. You can also bring your own vectors by upserting pre-computed embeddings for a specific property and specifying the similarity function (cosine, euclidean) for that index. [Bring Your Own Vectors](https://docs.rushdb.com/learn/semantic-search/bring-your-own-vectors) Either way, the vector index lives inside the same graph that holds the relationships. **Hybrid retrieval through label and property filters.** `db.records.vectorSearch()` accepts a `labels` array and a `where` clause alongside the query text or query vector. RushDB narrows the candidate set using those structural constraints first, then ranks the filtered records by cosine or euclidean similarity. [Semantic Search (AI and Vectors Search API)](https://docs.rushdb.com/learn/reference/rest-api/ai-and-vectors/search) This means the semantic ranking never sees records that fail the structural test—the jurisdiction boundary is enforced before similarity is computed, not after. **Live schema discovery.** `db.ai.getSchema()` returns the full graph structure as machine-readable JSON: labels with record counts, properties with inferred types and value ranges, cross-label relationship maps, and per-property vector index metadata. `db.ai.getSchemaMarkdown()` returns the same information as compact Markdown tables, sized for direct LLM consumption. [AI Overview (Semantic Search)](https://docs.rushdb.com/rest-api/ai/overview) An agent that calls `getSchemaMarkdown()` before constructing a query knows which labels exist, which properties are filterable, which properties have semantic search indexes, and how the labels connect to each other. It can ground its query in the actual data model rather than guessing field names. These three capabilities compose. An agent can discover the schema, learn that `POLICY` records have `type` and `severity` properties with known value ranges, learn that `POLICY` is reachable from `JURISDICTION` through `DEPARTMENT`, and then issue a query that filters by `type` and `severity` before ranking by semantic similarity over `clause`. The query is both structurally sound and semantically ranked. [Features — Vector And Graph Search For Connected AI Retrieval](https://rushdb.com/features/vector-graph-search) ## End-to-End: Compliance Policy Retrieval The following walkthrough uses a small compliance dataset to make the mechanics concrete. The dataset models a single jurisdiction (`EU`) that owns a `Legal` department, which in turn owns two policies: one `retention` policy with `critical` severity, and one `consent` policy with `medium` severity. ### Step 1: Seed the graph The nested JSON import creates the `JURISDICTION → DEPARTMENT → POLICY` edge structure automatically. RushDB infers the labels from the JSON keys and creates typed records for each node. ```json { "JURISDICTION": { "name": "EU", "region": "Europe", "DEPARTMENT": [ { "name": "Legal", "POLICY": [ { "title": "EU Data Retention Policy", "clause": "We retain user personal data for exactly 3 years under GDPR guidelines.", "type": "retention", "severity": "critical" }, { "title": "EU Marketing Consent Policy", "clause": "Keep marketing emails indefinitely unless the user opts out.", "type": "consent", "severity": "medium" } ] } ] } } ``` The `suggestTypes: true` option tells RushDB to infer property types from the values—`severity` becomes a `string` property with known values `critical` and `medium`, not an opaque blob. ### Step 2: Discover the live schema Before issuing any query, call `getSchema()` to see what the graph actually contains. This is the step that separates structure-aware retrieval from blind vector search. ```sdk schema = db.ai.get_schema({}) print(json.dumps(schema.data, indent=2)) ___SPLIT___ const schema = await db.ai.getSchema({}) console.log(JSON.stringify(schema.data, null, 2)) ``` The response shows three labels (`JURISDICTION`, `DEPARTMENT`, `POLICY`), their record counts, the typed properties on each label, the value ranges for those properties, and the directed relationships between labels. The `POLICY` label has four string properties: `clause`, `severity`, `title`, and `type`. The `Semantic Search` column in the Markdown variant would show `—` for each property until an embedding index is created on `clause`—at which point it would show the index source type, similarity function, and dimension count. For an LLM agent, the Markdown variant is more token-efficient: ```sdk schema_markdown = db.ai.get_schema_markdown({}) print(schema_markdown.data) ___SPLIT___ const schemaMarkdown = await db.ai.getSchemaMarkdown({}) console.log(schemaMarkdown.data) ``` The schema snapshot is cached for up to one hour. If records are added or removed between calls, the cached snapshot may not reflect the latest state; the cache refreshes automatically on the next cycle. ### Step 3: Query with structural constraints With the schema in hand, the agent knows that `POLICY` records have a `type` property with values `consent` and `retention`, and a `severity` property with values `critical` and `medium`. A query for critical retention policies can be expressed as exact filters—no semantic ambiguity, no risk of returning the consent policy. ```sdk records = db.records.find({ "labels": [ "POLICY" ], "where": { "type": "retention", "severity": "critical" }, "limit": 10 }) print(json.dumps({"total": records.total, "data": [record.data for record in records.data]}, indent=2)) ___SPLIT___ const records = await db.records.find({ "labels": [ "POLICY" ], "where": { "type": "retention", "severity": "critical" }, "limit": 10 }) console.log(JSON.stringify({ total: records.total, data: records.data }, null, 2)) ``` When an embedding index exists on `POLICY.clause`, the same `SearchQuery` shape extends naturally to hybrid retrieval: add a `query` field with the natural-language text, and RushDB ranks the filtered candidates by semantic similarity before returning them. The structural filter runs first; the semantic ranking runs over the survivors. [Hybrid Retrieval: Filters Plus Semantic Search](https://docs.rushdb.com/learn/tutorials/ai-and-rag/hybrid-retrieval) ## Observed Results The query above—`labels: ["POLICY"]`, `where: { type: "retention", severity: "critical" }`—returns exactly one record: ```json { "data": [ { "__label": "POLICY", "clause": "We retain user personal data for exactly 3 years under GDPR guidelines.", "severity": "critical", "title": "EU Data Retention Policy", "type": "retention" } ], "total": 1 } ``` The `EU Marketing Consent Policy` is absent. Its `type` is `consent` and its `severity` is `medium`; it fails both filters. The structural constraint did its job before any similarity ranking was needed. The `total: 1` in the response confirms that the filter is applied server-side, not post-hoc in application code. The `searchQuery` echo in the response shows the exact query that was executed, which is useful for debugging and audit logging.
Observed API responses Captured from a run against an isolated RushDB project in Python and TypeScript; volatile record identifiers are normalized. **Use the discovered fields in a structured query** ```json { "data": [ { "__label": "POLICY", "clause": "We retain user personal data for exactly 3 years under GDPR guidelines.", "severity": "critical", "title": "EU Data Retention Policy", "type": "retention" } ], "searchQuery": { "labels": [ "POLICY" ], "limit": 10, "where": { "severity": "critical", "type": "retention" } }, "total": 1 } ```
## What This Changes for Agentic Systems The compliance scenario is deliberately small, but the architectural pattern scales to the problems that make pure vector search insufficient in production. **Agents can ground queries in the actual data model.** When an agent calls `getSchemaMarkdown()` at the start of a session, it receives a token-efficient summary of every label, every typed property, every value range, and every relationship in the graph. It can use that summary to construct queries that reference real field names and real values—not hallucinated ones. The schema is live: it reflects the current state of the graph, not a static documentation page that may have drifted. [AI Overview (Semantic Search)](https://docs.rushdb.com/rest-api/ai/overview) **Semantic search becomes a ranking signal, not a retrieval boundary.** In a pure vector system, the embedding is the only retrieval mechanism. Everything that matters—jurisdiction, department, policy type, severity—must be encoded into the embedding or stored as metadata and filtered in application code. In RushDB, those dimensions are first-class properties in the graph. Semantic similarity ranks within a structurally correct candidate set, rather than competing with structural correctness for the same retrieval slot. [Semantic Search (AI and Vectors Search API)](https://docs.rushdb.com/learn/reference/rest-api/ai-and-vectors/search) **The same backend serves multiple retrieval patterns.** Agent recall, knowledge-base search, faceted filtering, and operational dashboards can all query the same RushDB project. A faceted UI filters by `severity` and `type` using exact `where` clauses. An agent uses `db.ai.search()` for natural-language queries that RushDB converts into a `SearchQuery` using the live schema. A RAG pipeline uses `db.records.vectorSearch()` for direct similarity ranking over an embedding index. None of these require a separate vector store, a separate metadata database, or application-layer join logic. [Features — Vector And Graph Search For Connected AI Retrieval](https://rushdb.com/features/vector-graph-search) [Features — RushDB](https://rushdb.com/features) **Bring Your Own Vectors remains an option.** Teams that already generate embeddings with a specific model—or that need a model not covered by RushDB's managed indexes—can upsert pre-computed vectors for any property and specify the similarity function for that index. [Bring Your Own Vectors](https://docs.rushdb.com/learn/semantic-search/bring-your-own-vectors) The structural query layer works identically regardless of whether the vectors were managed or externally supplied. **One caveat worth naming.** Schema grounding reduces the risk of querying nonexistent fields or using wrong value types, but it does not make queries semantically correct by construction. An agent that misreads the schema or constructs a logically wrong filter will still get wrong results—just wrong results that are structurally valid. Schema discovery is a tool for reducing a class of errors, not eliminating all retrieval errors. ## Similarity Is Not Enough Embeddings are a powerful tool for ranking text by meaning. They are not a data model. They have no representation for the relationships between records, the types of properties, the cardinality of edges, or the organizational boundaries that determine whether a retrieved result is actually correct. RushDB's Labeled Meta Property Graph model treats those structural dimensions as first-class citizens—stored and traversed on Neo4j, exposed through a unified REST and SDK interface, and queryable in combination with semantic similarity through a single `SearchQuery`. The schema APIs make the live graph structure available to agents and applications without requiring them to maintain a separate schema registry or guess field names. The result is a retrieval system that can answer both questions at once: *is this text semantically relevant?* and *does this record belong to the correct part of the graph?* For systems where the second question has hard consequences—compliance, multi-tenant isolation, policy routing—the combination is not a convenience. It is a requirement. ## Sources - [Semantic Search (AI and Vectors Search API)](https://docs.rushdb.com/learn/reference/rest-api/ai-and-vectors/search) - [AI Overview (Semantic Search)](https://docs.rushdb.com/rest-api/ai/overview) - [Hybrid Retrieval: Filters Plus Semantic Search](https://docs.rushdb.com/learn/tutorials/ai-and-rag/hybrid-retrieval) - [Bring Your Own Vectors](https://docs.rushdb.com/learn/semantic-search/bring-your-own-vectors) - [RushDB 2.0: Memory Infrastructure for the Agentic Era](https://rushdb.com/blog/rushdb-2-0-release) - [Features — Vector And Graph Search For Connected AI Retrieval](https://rushdb.com/features/vector-graph-search) - [Features — RushDB](https://rushdb.com/features) --- ## Why Every AI Stack Grows Into Five Data Pipelines Canonical URL: https://rushdb.com/blog/why-every-ai-stack-starts-with-five-data-pipelines-2a1d57 Published: 2026-07-19T07:51:00.000Z Updated: 2026-08-21T06:10:26.507Z Author: RushDB Category: Engineering Tags: data-pipelines, ai-architecture, graph-database, vector-search, rushdb, llm-applications, ai-agents # Why Every AI Stack Grows Into Five Data Pipelines Most teams building LLM-powered applications start with a single goal: get data in front of the model. They end up with five jobs. The first pipeline extracts and transforms raw data into a warehouse. The second generates embeddings and pushes them to a vector store. The third syncs structured records into a graph or relational database. The fourth builds search indexes for full-text retrieval. The fifth maintains a metadata catalog so the system knows what it can query. None of these pipelines is accidental. Each one exists because LLM applications have genuinely different retrieval requirements that no single traditional store was designed to satisfy simultaneously. The operational cost—synchronization bugs, deployment complexity, cross-system latency—is the structural consequence of that mismatch. This article explains why those five pipelines emerge, what each one is actually doing, and how RushDB's architecture collapses them into a single ingestion flow that produces a structured graph, managed embedding indexes, and a live schema layer in one operation. ## The Five-Pipeline Tax To understand why fragmentation happens, it helps to trace the data path of a concrete AI application—say, an agent that helps engineers navigate a company's infrastructure knowledge base. **Pipeline 1: ETL into a warehouse.** Raw data arrives as JSON events, Markdown documents, API responses, and database exports. Before anything else can use it, this data must be cleaned, typed, and loaded into a queryable store. Teams reach for tools like Fivetran, dbt, or custom ingestion scripts feeding into Snowflake or BigQuery. The output is structured rows, but the store is optimized for analytical queries, not low-latency retrieval or graph traversal. **Pipeline 2: Embedding generation.** LLM retrieval requires semantic similarity, which means converting text fields into dense vectors. This is a separate compute job: call an embedding API (OpenAI, Cohere, or a self-hosted model), receive float arrays, and write them somewhere. The embedding job must run on every new document and re-run when the embedding model changes. The output lives in a dedicated vector store like Pinecone or Weaviate, or in a vector extension like pgvector on PostgreSQL [Pinecone Documentation – Product Overview](https://www.pinecone.io/docs/overview/) [Weaviate Documentation – Developers Overview](https://weaviate.io/developers/weaviate) [pgvector – Open-source Vector Similarity Extension for PostgreSQL](https://github.com/pgvector/pgvector). **Pipeline 3: Graph sync.** Relationships between entities—which engineer owns which service, which ticket references which component—are not naturally represented in flat rows or vector indexes. Teams add a graph database (often Neo4j) or build a relational schema with foreign keys. Keeping this store in sync with the warehouse requires a third pipeline: change-data-capture, scheduled exports, or application-layer dual-writes. **Pipeline 4: Search index builds.** Full-text search over document content requires yet another system. Elasticsearch and OpenSearch both support dense vector fields alongside inverted indexes [Elasticsearch Reference – dense_vector field type](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html) [OpenSearch Documentation – k-NN Search](https://opensearch.org/docs/latest/search-plugins/knn/), but they are typically deployed as separate infrastructure from the graph and the warehouse. Index builds must be triggered on ingestion and kept consistent with the source of truth. **Pipeline 5: Metadata and schema catalog.** Agents need to know what they can query. Which labels exist? What properties does each record type carry? What are the valid value ranges for a numeric filter? Without a live schema layer, agents either hallucinate query structure or require hand-written tool descriptions that drift out of date. Teams build internal catalogs, OpenAPI specs, or prompt-engineering workarounds to paper over this gap. The result is a stack where a single write to the source system fans out into five asynchronous jobs across five different stores. Any one of them can fall behind. When the graph and the vector store diverge—a record deleted from one but not the other—retrieval produces inconsistent results that are difficult to diagnose. Orchestration frameworks like LangChain and LlamaIndex [LangChain Python Documentation – Introduction](https://python.langchain.com/docs/get_started/introduction/) abstract over these backends through integrations and chains, but they do not eliminate the underlying synchronization problem. The databases still run independently; the framework only hides the seams at query time. Vector databases can store metadata, filters, identifiers, and provenance alongside embeddings [Pinecone Documentation – Product Overview](https://www.pinecone.io/docs/overview/) [Weaviate Documentation – Developers Overview](https://weaviate.io/developers/weaviate), which helps with some retrieval patterns. But metadata stored in a vector index is not the same as connected context traversed natively in a graph. When an agent needs to follow a relationship—find all memories belonging to a specific agent, then filter by topic and recency—that traversal either happens in application logic across two systems or requires the graph to be the authoritative store with vectors kept in sync beside it. Neither option eliminates the synchronization burden; they only move it. The diagram below contrasts these two worlds: the traditional five-pipeline fan-out on the left, and RushDB's single-ingestion path on the right. ```mermaid flowchart LR subgraph Traditional["Traditional: Five-Pipeline Fan-out"] RJ1["Raw JSON"] ETL["ETL Pipeline"] DW["Data Warehouse"] ES["Embedding Service"] VS["Vector Store"] GD["Graph Database"] SI["Search Index"] MC["Metadata Catalog"] RJ1 --> ETL ETL --> DW DW --> ES ES --> VS DW --> GD DW --> SI DW --> MC end subgraph RushDBPath["RushDB: Single Ingestion"] RJ2["Raw JSON"] RDB["RushDB"] N4J["Neo4j"] EI["Embedding Index"] LS["Live Schema"] AG["Agent"] RJ2 --> RDB RDB --> N4J RDB --> EI RDB --> LS N4J --> AG EI --> AG LS --> AG end ``` ## RushDB's Architecture: One Store, Three Layers RushDB is a graph and vector database built on Neo4j, designed for AI-native workloads [GitHub - rush-db/rushdb: RushDB is a graph + vector database and memory layer for AI agents. Push any JSON, get typed, searchable, relationship-aware records back — no schema, no migrations. Built on Neo4j.](https://github.com/rush-db/rushdb). Neo4j serves as the underlying storage and transaction engine; RushDB exposes its own data model, APIs, and SDKs on top of it [Neo4j Live: RushDB in Action - Graph-Native Tools for the AI Era](https://www.youtube.com/watch?v=NKgNV3y_wVY). The data model RushDB implements is the **Labeled Meta Property Graph (LMPG)**—distinct from a plain Labeled Property Graph. In a standard LPG, properties are key-value pairs attached to nodes and edges. In RushDB's LMPG, properties are elevated into first-class graph structures called **HyperProperties**: each property has its own identity, type metadata, and value range information that the system tracks and exposes. This means the schema is not a separate catalog bolted on afterward—it is a structural consequence of how data is stored. On top of Neo4j's transactional engine and the LMPG model, RushDB provides three layers that replace the five pipelines: 1. **Ingestion layer.** A single `importJson` / `import_json` call accepts arbitrary nested JSON, infers types, maps relationships from nested structure, assigns labels, and writes typed records into the graph—no schema definition required, no migrations [GitHub - rush-db/rushdb: RushDB is a graph + vector database and memory layer for AI agents. Push any JSON, get typed, searchable, relationship-aware records back — no schema, no migrations. Built on Neo4j.](https://github.com/rush-db/rushdb). 2. **Embedding index layer.** After ingestion, any string property can be designated for semantic search by creating a managed embedding index. RushDB handles embedding generation and storage internally. Alternatively, teams can supply their own pre-computed vectors through an external index. Either way, vector similarity search runs against the same records that graph queries address [Features | RushDB](https://rushdb.com/features). 3. **Live schema layer.** Because properties are first-class structures in the LMPG, RushDB can expose a live schema at any time: labels, record counts, property names with types and value ranges, and cross-label relationships with direction. This schema is available as structured JSON for programmatic use or as compact Markdown tables sized for LLM context windows [Features | RushDB](https://rushdb.com/features). The practical effect is that the five pipelines collapse into one ingestion call, with the embedding and schema layers activated through configuration rather than separate infrastructure. ## From JSON to Graph: What Ingestion Actually Does The mechanism is easier to understand with a concrete example. Consider an AI agent that stores memories about user interactions. Each memory has a text content field, a numeric importance score, a status, and a topic. In a five-pipeline stack, this data would flow through ETL into a warehouse, get embedded separately, and be synced to a graph with a schema defined upfront. With RushDB, the same data is pushed once: ```json { "AGENT_MEMORY": [ { "id": "mem_001", "agentId": "agent_alpha", "content": "User requested assistance with setting up a Kubernetes cluster on AWS.", "importance": 0.9, "timestamp": 1710000000, "topic": "Infrastructure", "status": "active", "min": 0, "max": 1 }, { "id": "mem_002", "agentId": "agent_alpha", "content": "User mentioned they prefer Terraform over CloudFormation for IaC.", "importance": 0.8, "timestamp": 1710005000, "topic": "Infrastructure", "status": "active", "min": 0, "max": 1 }, { "id": "mem_003", "agentId": "agent_beta", "content": "Discussed marketing strategy and social media scheduling tools.", "importance": 0.4, "timestamp": 1710010000, "topic": "Marketing", "status": "archived", "min": 0, "max": 1 } ] } ``` The `suggestTypes: true` option instructs RushDB to infer property types from the values—`importance` becomes a `number`, `content` becomes a `string`, `status` becomes a `string`. The `returnResult: true` option returns the created records in the response so the caller can inspect them immediately. After this single call, the ingestion layer has: - Created three `AGENT_MEMORY` nodes in Neo4j - Assigned typed properties to each node - Registered those properties in the LMPG's HyperProperty catalog - Made the records immediately queryable by label, property filter, or relationship No schema was defined beforehand. No migration was run. The graph structure and the schema catalog were produced as a side effect of the write. ## Schema Discovery, Embedding Indexes, and Hybrid Search Once records exist, the three layers become independently useful. ### Live Schema Discovery The properties API returns the schema that was inferred during ingestion: ```sdk properties = db.properties.find({}) print(json.dumps(properties["data"], indent=2)) ___SPLIT___ const properties = await db.properties.find({}) console.log(JSON.stringify(properties.data, null, 2)) ``` The response lists every property across all `AGENT_MEMORY` records—`agentId`, `content`, `importance`, `status`, `timestamp`, `topic`—each with its inferred type and a count of how many records carry that property. An agent receiving this output knows exactly what it can filter on without any hand-written tool description. For numeric properties, the schema layer goes further. Calling `properties.values()` on the `importance` property returns the actual distribution: ```sdk properties = db.properties.find({}) facet = next(prop for prop in properties["data"] if prop["name"] == "importance") values = db.properties.values(facet["id"]) print(json.dumps(values["data"], indent=2)) ___SPLIT___ const properties = await db.properties.find({}) const facet = properties.data.find((item) => item.name === "importance") if (!facet) throw new Error("Property importance is missing") const values = await db.properties.values(facet.id) console.log(JSON.stringify(values.data, null, 2)) ``` The response includes `min: 0.4`, `max: 0.9`, and the discrete values `[0.4, 0.8, 0.9]`. An agent constructing a filter like `importance > 0.7` can validate that range before executing the query, rather than discovering at runtime that no records match. For agents consuming schema in bulk, `db.ai.get_schema_markdown()` returns a compact Markdown table that includes a **Semantic Search** column per property—showing `managed cosine 1536d [ready]` for indexed properties or `—` for unindexed ones. This format is sized for LLM context windows and lets a model reason about which properties support semantic retrieval versus structured filtering [Features | RushDB](https://rushdb.com/features). One operational note: the schema returned by `get_schema` and `get_schema_markdown` may reflect a cached snapshot up to one hour old. The cache exists because computing cross-label relationship statistics over large graphs is expensive. ### Creating a Managed Embedding Index Semantic search over the `content` field requires an embedding index. Creating one is a single API call: ```sdk index = db.ai.indexes.create({ "sourceType": "managed", "label": "AGENT_MEMORY", "propertyName": "content" }) print(json.dumps(index["data"], indent=2)) ___SPLIT___ const index = await db.ai.indexes.create({ "sourceType": "managed", "label": "AGENT_MEMORY", "propertyName": "content" }) console.log(JSON.stringify(index.data, null, 2)) ``` The response confirms `status: "ready"` and `indexedRecords: 3`—all three memories were embedded and indexed. There was no separate embedding service to call, no vector store to provision, and no sync job to schedule. The embedding index is a policy attached to a property within the same database that holds the records. ### Hybrid Vector Search with Structured Filters With the index in place, semantic search can be combined with property filters in a single query: ```sdk hits = db.records.vector_search({ "labels": [ "AGENT_MEMORY" ], "propertyName": "content", "query": "Infrastructure deployment tools", "where": { "status": "active" } }) print(json.dumps({"total": hits.total, "data": [record.data for record in hits.data]}, indent=2)) ___SPLIT___ const hits = await db.records.vectorSearch({ "labels": [ "AGENT_MEMORY" ], "propertyName": "content", "query": "Infrastructure deployment tools", "where": { "status": "active" } }) console.log(JSON.stringify({ total: hits.total, data: hits.data }, null, 2)) ``` ```json { "data": [ { "__label": "AGENT_MEMORY", "__score": 0.78, "agentId": "agent_alpha", "content": "User mentioned they prefer Terraform over CloudFormation for IaC.", "id": "mem_002", "importance": 0.8, "max": 1, "min": 0, "status": "active", "timestamp": 1710005000, "topic": "Infrastructure" }, { "__label": "AGENT_MEMORY", "__score": 0.8, "agentId": "agent_alpha", "content": "User requested assistance with setting up a Kubernetes cluster on AWS.", "id": "mem_001", "importance": 0.9, "max": 1, "min": 0, "status": "active", "timestamp": 1710000000, "topic": "Infrastructure" } ] } ``` The query returns the two active infrastructure memories—`mem_001` (Kubernetes on AWS, `__score: 0.80`) and `mem_002` (Terraform vs CloudFormation, `__score: 0.78`)—and excludes `mem_003` because its `status` is `"archived"`. The `where` filter ran inside the database against the graph properties; it was not applied as a post-processing step in application code after fetching all vector matches. This is the meaningful architectural distinction. In a five-pipeline stack, the vector store returns candidate IDs ranked by similarity, and the application then queries the graph or relational store to apply structured filters and fetch full records. That round-trip introduces latency and requires the two stores to agree on record identity. Here, both operations execute against the same underlying Neo4j instance through RushDB's unified query layer.
Observed API responses Captured from a run against an isolated RushDB project in Python and TypeScript; volatile record identifiers are normalized. **Execute Vector Search with Metadata Filters** ```json { "data": [ { "__label": "AGENT_MEMORY", "__score": 0.78, "agentId": "agent_alpha", "content": "User mentioned they prefer Terraform over CloudFormation for IaC.", "id": "mem_002", "importance": 0.8, "max": 1, "min": 0, "status": "active", "timestamp": 1710005000, "topic": "Infrastructure" }, { "__label": "AGENT_MEMORY", "__score": 0.8, "agentId": "agent_alpha", "content": "User requested assistance with setting up a Kubernetes cluster on AWS.", "id": "mem_001", "importance": 0.9, "max": 1, "min": 0, "status": "active", "timestamp": 1710000000, "topic": "Infrastructure" } ] } ```
## How Orchestration Frameworks and Vector Extensions Compare It is worth being precise about what RushDB replaces and what it does not. **Orchestration frameworks (LangChain, LlamaIndex).** These tools [LangChain Python Documentation – Introduction](https://python.langchain.com/docs/get_started/introduction/) abstract over multiple backends through integrations: a LangChain retriever can query Pinecone for vectors, then call a separate graph database for context, then merge results in application code. This approach works and is widely deployed. The limitation is that the underlying databases still operate independently. A document deleted from the graph is not automatically removed from the vector index; the orchestration layer has no mechanism to enforce that consistency. RushDB's approach is different in kind: it collapses the storage layer itself so there is no cross-system synchronization to manage. Orchestration frameworks and RushDB are not mutually exclusive—an agent built with LangChain or LlamaIndex can use RushDB as its memory backend. **Vector databases (Pinecone, Weaviate).** Dedicated vector stores [Pinecone Documentation – Product Overview](https://www.pinecone.io/docs/overview/) [Weaviate Documentation – Developers Overview](https://weaviate.io/developers/weaviate) are optimized for high-dimensional similarity search at scale and offer features like multi-tenancy, namespace isolation, and fine-grained index tuning that RushDB's managed embedding layer does not currently expose. They can store metadata alongside vectors, which supports filtered retrieval. What they do not provide is native graph traversal: following a relationship from a memory to its owning agent, then to other memories that agent has stored, requires either application-layer joins or a separate graph database. Teams with very large embedding corpora or specialized ANN index requirements may still reach for a dedicated vector store. **Vector extensions for relational databases (pgvector, Elasticsearch dense vectors).** Adding pgvector to PostgreSQL [pgvector – Open-source Vector Similarity Extension for PostgreSQL](https://github.com/pgvector/pgvector) or using Elasticsearch's `dense_vector` field type [Elasticsearch Reference – dense_vector field type](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html) gives a single store that handles both structured queries and approximate nearest-neighbor search. This reduces the number of systems but does not provide graph traversal semantics. Complex relationship queries still require multi-table joins, and the schema catalog remains implicit in the table definitions rather than being a live, queryable structure. OpenSearch's k-NN plugin [OpenSearch Documentation – k-NN Search](https://opensearch.org/docs/latest/search-plugins/knn/) follows the same pattern. These are reasonable choices for teams already invested in PostgreSQL or Elasticsearch whose relationship queries are simple enough to express as joins. The practical question is not which approach is universally correct but which one matches the query patterns of a given application. If an agent needs to traverse connected context—follow relationships, filter by property ranges, and rank by semantic similarity in one operation—a unified graph-plus-vector store reduces the coordination surface. If the workload is primarily similarity search with simple metadata filters and the corpus is very large, a dedicated vector store may be the right fit. ## Constraints Worth Understanding RushDB's single-ingestion model carries trade-offs that matter for production decisions. **Schema cache latency.** The `get_schema` and `get_schema_markdown` APIs may return a snapshot up to one hour old. For applications where schema changes are frequent—rapid prototyping, high-velocity ingestion of new record types—agents may query against a schema that does not yet reflect the latest labels or properties. **Managed embedding index scope.** The managed embedding index handles embedding generation internally, which simplifies operations but means the embedding model is chosen by RushDB rather than the application. Teams that need a specific embedding model for domain-specific recall, or that want to bring pre-computed vectors from a fine-tuned model, can use the external index path (`sourceType: "external"`) and supply vectors via `upsert_vectors`. This preserves flexibility but reintroduces an external embedding step. **Graph traversal depth and scale.** RushDB inherits Neo4j's strengths for connected data traversal, but very large graphs with deep multi-hop traversals carry the same performance considerations as any graph database. The LMPG model's HyperProperty catalog adds overhead compared to a plain property graph because properties are first-class nodes. For workloads that are purely flat-record retrieval with no relationship traversal, a simpler store may have lower operational overhead. **Not a universal replacement.** RushDB is positioned as a graph and vector database for AI agent memory and LLM application backends [GitHub - rush-db/rushdb: RushDB is a graph + vector database and memory layer for AI agents. Push any JSON, get typed, searchable, relationship-aware records back — no schema, no migrations. Built on Neo4j.](https://github.com/rush-db/rushdb). It is not a data warehouse, a streaming pipeline, or a full-text search engine with the tuning surface of Elasticsearch. Teams that need analytical aggregations over billions of rows, complex stream processing, or advanced relevance tuning for search-as-a-service workloads will still reach for specialized systems. The five-pipeline stack may shrink—ETL into a warehouse can remain for analytical workloads while RushDB handles the agent memory and retrieval layer—but it does not necessarily disappear entirely. ## One Ingestion Call, Three Layers The five-pipeline tax is not a consequence of poor tooling choices. It emerges because LLM applications genuinely need structured relationships, semantic similarity, and live schema introspection—capabilities that were historically distributed across separate systems optimized for different access patterns. RushDB's architecture addresses this at the storage layer rather than the orchestration layer. By implementing the Labeled Meta Property Graph model on top of Neo4j, it makes properties first-class structures that carry type metadata and value ranges as a side effect of ingestion. By attaching managed embedding indexes to string properties within the same database, it eliminates the separate embedding pipeline and the synchronization risk between vector and graph stores. By exposing a live schema API—including a Markdown format sized for LLM context—it replaces the metadata catalog with a queryable structure that updates as data changes [Features | RushDB](https://rushdb.com/features) [GitHub - rush-db/rushdb: RushDB is a graph + vector database and memory layer for AI agents. Push any JSON, get typed, searchable, relationship-aware records back — no schema, no migrations. Built on Neo4j.](https://github.com/rush-db/rushdb). The result is that pushing JSON once yields a typed graph, searchable embedding indexes, and a schema layer that agents can introspect and query through a single contract. Whether that contract is sufficient for a given production workload depends on the embedding model requirements, the scale of the vector corpus, and the complexity of the analytical queries involved. But for the common case—an AI agent that needs to store, retrieve, and reason over connected structured data—the five pipelines can become one. ## Sources - [Features | RushDB](https://rushdb.com/features) - [GitHub - rush-db/rushdb: RushDB is a graph + vector database and memory layer for AI agents. Push any JSON, get typed, searchable, relationship-aware records back — no schema, no migrations. Built on Neo4j.](https://github.com/rush-db/rushdb) - [Neo4j Live: RushDB in Action - Graph-Native Tools for the AI Era](https://www.youtube.com/watch?v=NKgNV3y_wVY) - [Pinecone Documentation – Product Overview](https://www.pinecone.io/docs/overview/) - [Weaviate Documentation – Developers Overview](https://weaviate.io/developers/weaviate) - [LangChain Python Documentation – Introduction](https://python.langchain.com/docs/get_started/introduction/) - [pgvector – Open-source Vector Similarity Extension for PostgreSQL](https://github.com/pgvector/pgvector) - [Elasticsearch Reference – dense_vector field type](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html) - [OpenSearch Documentation – k-NN Search](https://opensearch.org/docs/latest/search-plugins/knn/) --- ## Stop Teaching Agents Your Schema Canonical URL: https://rushdb.com/blog/stop-teaching-agents-your-schema-d57a76 Published: 2026-07-15T23:17:00.000Z Updated: 2026-07-16T18:10:46.699Z Author: RushDB Category: Engineering Tags: ai-agents, schema-discovery, graph-database, rushdb, agent-memory, dynamic-schema, llm # Stop Teaching Agents Your Schema Every time you build a new AI agent on top of a database, you write the same kind of system prompt: a description of your labels, fields, relationships, and whatever values the LLM needs to filter correctly. The prompt works until the schema changes. Then it silently drifts, and the agent starts generating queries against fields that no longer exist or missing fields that were added last sprint. The root problem is that schema knowledge lives in a document—a prompt, a README, a Confluence page—rather than in the database itself. RushDB takes a different approach. It continuously tracks its own structure and exposes that structure through a dedicated endpoint, so agents can fetch a current snapshot of what exists before they construct a single query. This article explains how that endpoint works, walks through a verified experiment that shows the exact response shape, and discusses where the approach has real limits. ## The Schema Narration Problem When a developer writes a schema prompt, they are doing something that feels routine but is actually fragile: translating a live database structure into static text and hoping the two stay synchronized. Three things make that synchronization hard. **Schema drift.** Databases evolve. A new `ownerTeam` field gets added to issues, a relationship gets renamed, an embedding index gets created on a property. None of those changes automatically propagate to the system prompt. The agent keeps generating queries against the old mental model. **Token cost.** A thorough schema description for a moderately complex graph can run to several hundred tokens per agent invocation. Multiply that by session volume and the cost compounds quickly—especially when most of those tokens describe parts of the schema the agent never touches in a given session. **Opaque values.** Independent research on agent-facing schema design argues that schemas should expose human-readable values rather than opaque identifiers, so agents can filter correctly without extra mapping logic [Your Database Schema Is Your Agent's Mental Model](https://tianpan.co/blog/2026-04-09-data-schema-design-cognitive-interface-agents). A static prompt rarely includes the actual values a field contains in practice. An agent told that `priority` is a string field has to guess whether the values in use are `high/medium/low`, `P0/P1/P2`, or something else entirely. Research on agentic schema refinement proposes giving agents minimal seed instructions and direct database access so they can discover structure, refine a semantic layer, and validate results—rather than relying on static documentation [Towards Agentic Schema Refinement](https://arxiv.org/html/2412.07786v1). RushDB's runtime schema discovery is a production implementation of that principle. ## The Fixture: A Project Graph with Issues and Contributors To make the mechanism concrete, start with a realistic graph. The fixture below represents a software project called "Atlas Support" with two nested record types: `ISSUE` records that carry `status`, `priority`, `ownerTeam`, and `title` fields, and `CONTRIBUTOR` records that carry `name` and `team` fields. Importing this single JSON payload creates five records and the parent-child relationships between them automatically. ```json { "PROJECT": { "name": "Atlas Support", "repository": "atlas-api", "ISSUE": [ { "title": "Checkout timeout", "status": "open", "priority": "high", "ownerTeam": "backend" }, { "title": "Update empty state", "status": "open", "priority": "low", "ownerTeam": "frontend" } ], "CONTRIBUTOR": [ { "name": "Mina", "team": "backend" }, { "name": "Noah", "team": "frontend" } ] } } ``` RushDB's `import_json` / `importJson` method accepts nested JSON and infers the graph structure from the key hierarchy. The top-level label is `PROJECT`; nested arrays whose keys are uppercase become child labels (`ISSUE`, `CONTRIBUTOR`). The `suggestTypes` option tells RushDB to infer property types from the values rather than storing everything as strings. Once this data is in the graph, no schema documentation has been written anywhere. The structure exists only inside RushDB—built on Neo4j as the underlying storage and transaction engine, with RushDB's Labeled Meta Property Graph (LMPG) model managing how properties and relationships are represented as first-class structures above the storage layer. ## How Runtime Schema Discovery Works RushDB is [self-aware about its own structure](https://docs.rushdb.com/learn/agent-memory/schema-self-awareness/): as records are written, the LMPG model continuously tracks which labels exist, which properties appear on each label, what types and value ranges those properties hold, and which labels are connected by relationships. That tracked structure is what the discovery endpoints expose. Two methods surface it: **`db.ai.get_schema_markdown` / `db.ai.getSchemaMarkdown`** returns the schema as a compact Markdown string. It is designed for direct LLM consumption: labels with record counts, properties with types and sampled values, relationship traversal patterns, and a "Semantic Search" column that shows embedding index metadata for any property that has a vector index configured. When no embedding index exists for a property, the column shows `—`. The entire graph schema arrives as a single token-efficient string that an agent can place directly in its context window. **`db.ai.get_schema` / `db.ai.getSchema`** returns the same information as structured JSON. Each item in the response array contains the label name, record count, a `properties` array with name, type, and sampled `values`, and a `relationships` array with direction and connected label. When a property has an embedding index, a `vectorIndexes` array appears on that property entry, exposing `id`, `sourceType`, `similarityFunction`, `dimensions`, `status`, and `modelKey`. A non-empty `vectorIndexes` array means the property is queryable with `db.records.vector_search` / `db.records.vectorSearch`. Both methods accept an optional `labels` filter to scope the response to a subset of the graph, which is useful when an agent only needs to reason about one or two record types. The [RushDB Schema API feature page](https://rushdb.com/features/schema-api) describes the design intent: the first schema call tells the agent what data exists and what queries are safe to construct. RushDB's agent-safe query planning documentation recommends a schema-first loop—load the schema first, learn the query specification second, and only then build queries from what actually exists [Agent-Safe Query Planning with Schema First | RushDB Docs](https://docs.rushdb.com/learn/tutorials/agent-memory/agent-safe-query-planning/). ```mermaid sequenceDiagram participant Agent participant RushDB as RushDB (LMPG Layer) participant Neo4j as Neo4j (Storage) Agent->>RushDB: db.ai.getSchemaMarkdown({}) RushDB->>Neo4j: Read LMPG label/property/relationship metadata Neo4j-->>RushDB: Raw graph structure RushDB-->>Agent: Compact Markdown schema (labels, properties, sampled values, relationships, vector index status) Note over Agent: Agent inspects available labels,
observed field values, and traversal patterns Agent->>RushDB: db.records.find with grounded query RushDB->>Neo4j: Execute structured query Neo4j-->>RushDB: Matching records RushDB-->>Agent: SearchResult with total and data ``` The diagram shows the two-step pattern: one schema call at session start, then one or more record queries grounded in the returned structure. The agent never has to guess whether `priority` accepts `"high"` or `"HIGH"` or `"p1"`—the schema response includes the actual sampled values observed in the graph. ## Fetching and Using the Discovered Schema With the fixture in place, call `get_schema_markdown` to retrieve the LLM-ready representation. ```sdk # Python from rushdb import RushDB db = RushDB("RUSHDB_API_KEY") schema_markdown = db.ai.get_schema_markdown({}) print(schema_markdown.data) ___SPLIT___ // TypeScript import RushDB from '@rushdb/javascript-sdk' const db = new RushDB('RUSHDB_API_KEY') const schemaMarkdown = await db.ai.getSchemaMarkdown({}) console.log(schemaMarkdown.data) ``` The response is a single Markdown string. An agent can place `schema_markdown.data` directly into its system prompt or inject it as a user-turn context message before asking the LLM to generate a query. Because the string is fetched at session start rather than hardcoded, it reflects the state of the graph at the time the cache was last populated—more on that timing in the limitations section. For programmatic use—validation, query planning logic, graph visualization—call the JSON variant instead: ```sdk # Python import json from rushdb import RushDB db = RushDB("RUSHDB_API_KEY") schema = db.ai.get_schema({}) print(json.dumps(schema.data, indent=2)) ___SPLIT___ // TypeScript import RushDB from '@rushdb/javascript-sdk' const db = new RushDB('RUSHDB_API_KEY') const schema = await db.ai.getSchema({}) console.log(JSON.stringify(schema.data, null, 2)) ``` ```sdk schema = db.ai.get_schema({}) print(json.dumps(schema.data, indent=2)) ___SPLIT___ const schema = await db.ai.getSchema({}) console.log(JSON.stringify(schema.data, null, 2)) ``` The JSON response gives an agent's orchestration layer everything it needs to validate a proposed query before executing it: the exact label names, the property names and their types, sampled values for string fields, and the relationship directions. A query that references a label or field not present in this response can be rejected before it ever reaches the database. Once the schema is loaded, building a grounded query is straightforward. The Markdown output shows that `ISSUE` records have a `priority` field with observed values `"high"` and `"low"`, and a `status` field with observed value `"open"`. An agent can use those exact values: ```sdk # Python import json from rushdb import RushDB db = RushDB("RUSHDB_API_KEY") records = db.records.find({ "labels": ["ISSUE"], "where": { "status": "open", "priority": "high" }, "limit": 10 }) print(json.dumps({"total": records.total, "data": [r.data for r in records.data]}, indent=2)) ___SPLIT___ // TypeScript import RushDB from '@rushdb/javascript-sdk' const db = new RushDB('RUSHDB_API_KEY') const records = await db.records.find({ "labels": ["ISSUE"], "where": { "status": "open", "priority": "high" }, "limit": 10 }) console.log(JSON.stringify({ total: records.total, data: records.data }, null, 2)) ``` ```sdk records = db.records.find({ "labels": [ "ISSUE" ], "where": { "status": "open", "priority": "high" }, "limit": 10 }) print(json.dumps({"total": records.total, "data": [record.data for record in records.data]}, indent=2)) ___SPLIT___ const records = await db.records.find({ "labels": [ "ISSUE" ], "where": { "status": "open", "priority": "high" }, "limit": 10 }) console.log(JSON.stringify({ total: records.total, data: records.data }, null, 2)) ``` The agent did not need to be told that `ISSUE` is a valid label, that `priority` accepts `"high"`, or that `status` accepts `"open"`. It discovered all of that from the schema response. ## What the Schema Response Actually Contains The Markdown output from `get_schema_markdown` for the Atlas Support fixture looks like this: ```text # Graph Schema ## Labels | Label | Count | |-------|------:| | `CONTRIBUTOR` | 2 | | `ISSUE` | 2 | | `PROJECT` | 1 | --- ## `ISSUE` (2 records) ### Properties | Property | Type | Values / Range | Semantic Search | |----------|------|----------------|-----------------| | `ownerTeam` | string | `backend`, `frontend` | — | | `priority` | string | `high`, `low` | — | | `status` | string | `open` | — | | `title` | string | `Checkout timeout`, `Update empty state` | — | ### Relationships | Traversal | Count | Edge Properties | |-----------|------:|-----------------| | `(ISSUE)<-[:__RUSHDB__RELATION__DEFAULT__]-(PROJECT)` | 2 | — | --- ## `CONTRIBUTOR` (2 records) ``` Several things are worth noting in this output. First, the three labels (`CONTRIBUTOR`, `ISSUE`, `PROJECT`) appear with their record counts. Second, each label section lists its properties with types and sampled values—`priority` shows `high` and `low`, `status` shows `open`, `ownerTeam` shows `backend` and `frontend`. An agent reading this knows what filter values have been observed in the graph without any additional documentation. Third, the Relationships section for each label shows the traversal pattern with direction, so an agent can reason about which labels are connected and in which direction. The Semantic Search column shows `—` for every property in this fixture because no embedding indexes have been configured. When a property does have a vector index, that column would show the index metadata (for example, `managed cosine 1536d [ready]`), signaling to the agent that `db.records.vector_search` / `db.records.vectorSearch` is available for that property. The JSON response carries the same information in a machine-readable form: ```json [ { "label": "ISSUE", "count": 2, "properties": [ { "name": "ownerTeam", "type": "string", "recordsCount": 2, "values": [ "backend", "frontend" ] }, { "name": "priority", "type": "string", "recordsCount": 2, "values": [ "high", "low" ] }, { "name": "status", "type": "string", "recordsCount": 2, "values": [ "open" ] }, { "name": "title", "type": "string", "recordsCount": 2, "values": [ "Checkout timeout", "Update empty state" ] } ], "relationships": [ { "label": "PROJECT", "direction": "in", "count": 2, "type": "RUSHDB_DEFAULT_RELATION" } ] } ] ``` The `relationships` array on each label entry includes `direction` (`"in"` or `"out"`), the connected `label`, and a `count`. This is the same structural information that `db.relationships.patterns.list()` exposes for relationship pattern analysis—the live schema endpoint surfaces it inline so an agent does not need a separate call to understand graph connectivity. The downstream query result confirms that schema-grounded filtering works correctly: ```json { "data": [ { "__label": "ISSUE", "ownerTeam": "backend", "priority": "high", "status": "open", "title": "Checkout timeout" } ], "total": 1 } ``` One record is returned: "Checkout timeout", with `priority: "high"` and `status: "open"`. The `searchQuery` field in the response echoes back the exact query that was executed, which is useful for debugging and for agents that need to log or audit their query decisions.
Verification details — exact normalized responses Verified against an isolated RushDB project in Python and TypeScript. Volatile record identifiers are normalized. **Capture the token-efficient schema** ```json { "data": "# Graph Schema\n\n## Labels\n\n| Label | Count |\n|-------|------:|\n| `CONTRIBUTOR` | 2 |\n| `ISSUE` | 2 |\n| `PROJECT` | 1 |\n\n---\n\n## `ISSUE` (2 records)\n\n### Properties\n\n| Property | Type | Values / Range | Semantic Search |\n|----------|------|----------------|-----------------|\n| `ownerTeam` | string | `backend`, `frontend` | — |\n| `priority` | string | `high`, `low` | — |\n| `status` | string | `open` | — |\n| `title` | string | `Checkout timeout`, `Update empty state` | — |\n\n### Relationships\n\n| Traversal | Count | Edge Properties |\n|-----------|------:|-----------------|\n| `(ISSUE)<-[:__RUSHDB__RELATION__DEFAULT__]-(PROJECT)` | 2 | — |\n\n---\n\n## `CONTRIBUTOR` (2 records)\n\n### Properties\n\n| Property | Type | Values / Range | Semantic Search |\n|----------|------|----------------|-----------------|\n| `name` | string | `Mina`, `Noah` | — |\n| `team` | string | `backend`, `frontend` | — |\n\n### Relationships\n\n| Traversal | Count | Edge Properties |\n|-----------|------:|-----------------|\n| `(CONTRIBUTOR)<-[:__RUSHDB__RELATION__DEFAULT__]-(PROJECT)` | 2 | — |\n\n---\n\n## `PROJECT` (1 record)\n\n### Properties\n\n| Property | Type | Values / Range | Semantic Search |\n|----------|------|----------------|-----------------|\n| `name` | string | `Atlas Support` | — |\n| `repository` | string | `atlas-api` | — |\n\n### Relationships\n\n| Traversal | Count | Edge Properties |\n|-----------|------:|-----------------|\n| `(PROJECT)-[:__RUSHDB__RELATION__DEFAULT__]->(CONTRIBUTOR)` | 2 | — |\n| `(PROJECT)-[:__RUSHDB__RELATION__DEFAULT__]->(ISSUE)` | 2 | — |", "success": true } ``` **Capture the structured schema response** ```json { "data": [ { "count": 1, "label": "PROJECT", "properties": [ { "id": "", "name": "name", "recordsCount": 1, "type": "string", "values": [ "Atlas Support" ] }, { "id": "", "name": "repository", "recordsCount": 1, "type": "string", "values": [ "atlas-api" ] } ], "relationships": [ { "count": 2, "direction": "out", "label": "CONTRIBUTOR", "type": "RUSHDB_DEFAULT_RELATION" }, { "count": 2, "direction": "out", "label": "ISSUE", "type": "RUSHDB_DEFAULT_RELATION" } ] }, { "count": 2, "label": "CONTRIBUTOR", "properties": [ { "id": "", "name": "name", "recordsCount": 2, "type": "string", "values": [ "Mina", "Noah" ] }, { "id": "", "name": "team", "recordsCount": 2, "type": "string", "values": [ "backend", "frontend" ] } ], "relationships": [ { "count": 2, "direction": "in", "label": "PROJECT", "type": "RUSHDB_DEFAULT_RELATION" } ] }, { "count": 2, "label": "ISSUE", "properties": [ { "id": "", "name": "ownerTeam", "recordsCount": 2, "type": "string", "values": [ "backend", "frontend" ] }, { "id": "", "name": "priority", "recordsCount": 2, "type": "string", "values": [ "high", "low" ] }, { "id": "", "name": "status", "recordsCount": 2, "type": "string", "values": [ "open" ] }, { "id": "", "name": "title", "recordsCount": 2, "type": "string", "values": [ "Checkout timeout", "Update empty state" ] } ], "relationships": [ { "count": 2, "direction": "in", "label": "PROJECT", "type": "RUSHDB_DEFAULT_RELATION" } ] } ], "success": true } ``` **Use the discovered fields in a structured query** ```json { "data": [ { "__label": "ISSUE", "ownerTeam": "backend", "priority": "high", "status": "open", "title": "Checkout timeout" } ], "searchQuery": { "labels": [ "ISSUE" ], "limit": 10, "where": { "priority": "high", "status": "open" } }, "total": 1 } ```
## Trade-offs and Practical Boundaries Runtime schema discovery is a useful grounding mechanism, but it has real constraints that matter for production agent design. **Schema snapshot caching.** The graph structure tracked by RushDB's LMPG model updates as records are written. However, the snapshot returned by the schema endpoints is cached for approximately one hour. A schema call made shortly after a migration or bulk import may still return the previous cached snapshot until the cache refreshes. For most agent workflows this lag is acceptable, but agents that operate immediately after a schema migration or a bulk import should account for this latency window. **Sampled values, not exhaustive enumerations.** The `values` array in the JSON response and the Values/Range column in the Markdown output contain samples drawn from existing records, not a complete enumeration of every distinct value in the database. For high-cardinality string fields like `title` or `name`, the samples are illustrative rather than exhaustive. An agent should treat sampled values as evidence of format and vocabulary—useful for constructing plausible filters—not as a closed set of the only valid inputs. **Schema grounding reduces but does not eliminate query errors.** Knowing that `priority` has been observed with values `"high"` and `"low"` prevents the agent from filtering on `"P1"`, but it does not prevent logical errors in query construction—incorrect `where` clause nesting, wrong relationship traversal direction, or mismatched label scoping. Schema grounding narrows the error surface; it does not make queries risk-free. **Relationship traversal depth is not exposed.** The schema shows direct relationships between labels (one hop), but it does not describe multi-hop traversal paths. An agent that needs to reason about paths like `PROJECT → ISSUE → CONTRIBUTOR` must infer the chain from the per-label relationship entries rather than reading a single traversal descriptor. **Vector index readiness is a prerequisite for semantic search.** The Semantic Search column in the Markdown schema shows index metadata, but an index in a non-`ready` state cannot be queried with `db.records.vector_search`. The schema tells the agent whether an index exists and what its current status is; the agent is responsible for checking that status before attempting a vector search call. ## Schema Discovery as a First-Class Agent Primitive The core shift RushDB enables is moving schema knowledge from a document you maintain to a runtime call the agent makes. Instead of writing a prompt that says "the ISSUE label has a priority field that accepts high, medium, or low", the agent calls `get_schema_markdown` at session start and reads that fact directly from the graph. The verified experiment shows what this looks like in practice: a five-record graph with three labels, imported from a single nested JSON payload, produces a complete Markdown schema that includes label counts, property types, sampled values, relationship directions, and vector index status—all without any manual schema documentation. A downstream query built from that schema returns exactly the expected record. The mechanism has a real boundary: the schema snapshot is cached for roughly an hour, so graph changes made after the last cache population may not appear immediately in a subsequent schema call. Sampled values are not exhaustive enumerations, and grounding does not eliminate all query errors. Those constraints are worth understanding before designing an agent that depends on schema freshness or treats sampled values as closed sets. For teams building agents on evolving graphs, the practical next step is to add a schema fetch as the first operation in every agent session. The [RushDB agent memory documentation](https://docs.rushdb.com/learn/agent-memory/) covers how to structure that session initialization, and the [Schema API feature page](https://rushdb.com/features/schema-api) describes the full response contract including vector index metadata. ## Sources - [Schema Self-Awareness | RushDB Docs](https://docs.rushdb.com/learn/agent-memory/schema-self-awareness/) - [Schema API For Schema-Aware AI Agents | RushDB](https://rushdb.com/features/schema-api) - [Agent Memory Overview | RushDB Docs](https://docs.rushdb.com/learn/agent-memory/) - [Agent-Safe Query Planning with Schema First | RushDB Docs](https://docs.rushdb.com/learn/tutorials/agent-memory/agent-safe-query-planning/) - [RushDB 2.0: Memory Infrastructure for the Agentic Era](https://rushdb.com/blog/rushdb-2-0-release) - [GitHub - rush-db/rushdb](https://github.com/rush-db/rushdb) - [Your Database Schema Is Your Agent's Mental Model](https://tianpan.co/blog/2026-04-09-data-schema-design-cognitive-interface-agents) - [Towards Agentic Schema Refinement](https://arxiv.org/html/2412.07786v1) --- ## RushDB 2.0: Memory Infrastructure for the Agentic Era Canonical URL: https://rushdb.com/blog/rushdb-2-0-release Published: 2026-05-21T00:00:00.000Z Updated: 2026-05-20T17:29:26.224Z # RushDB 2.0: Memory Infrastructure for the Agentic Era _Native semantic search, Ontology API, MCP + OAuth, Bring Your Own Neo4j, Skills, and a pricing model that makes sense._ --- When we built the first version of RushDB, the pitch was simple: push JSON, get a graph database back. No schema design, no migration files, auto-linked nested records, a clean query API. Batteries included. That pitch still holds. But the industry moved, and we moved with it. The biggest shift in software development right now isn't a new framework or language. It's that **applications need to remember things and reason across structured data** — and the infrastructure to do that reliably, without three separate systems, barely existed. RushDB 2.0 is the answer we kept building toward. Here's everything that shipped. --- ## 1. Native Semantic Search The old way to add semantic search to a graph database: run a separate vector store, write an embedding pipeline, keep them synchronized, query both, merge results. Four separate concerns, none of them fun. RushDB 2.0 has native vector support built directly into the graph. Embedding indexes are a first-class concept — you create one on any string property, and RushDB manages everything from there. ### Creating an index ```sdk # Python db.ai.indexes.create({ "label": "DECISION", "propertyName": "rationale" # sourceType defaults to 'managed' — RushDB handles embeddings }) ___SPLIT___ // TypeScript await db.ai.indexes.create({ label: 'DECISION', propertyName: 'rationale' // sourceType defaults to 'managed' — RushDB handles embeddings }) ``` ```bash # MCP tool (Claude, Cursor, VS Code) createEmbeddingIndex: { label: "DECISION", propertyName: "rationale" } ``` RushDB immediately starts backfilling existing records asynchronously. Check progress: ```sdk # Python stats = db.ai.indexes.stats(index_id) # { "totalRecords": 4200, "indexedRecords": 3847 } ___SPLIT___ // TypeScript const stats = await db.ai.indexes.stats(indexId) // { totalRecords: 4200, indexedRecords: 3847 } ``` ### Searching by meaning Once the index is ready: ```sdk # Python results = db.ai.search({ "labels": ["DECISION"], "propertyName": "rationale", "query": "why did we choose that authentication approach", "limit": 5 }) # Returns records ranked by __score — no exact keyword match needed ___SPLIT___ // TypeScript const results = await db.ai.search({ labels: ['DECISION'], propertyName: 'rationale', query: 'why did we choose that authentication approach', limit: 5 }) // Returns records ranked by __score — no exact keyword match needed ``` ### Semantic search + metadata filters (prefilter mode) This is the most practical pattern — combine semantic ranking with structured filtering: ```sdk # Python results = db.ai.search({ "labels": ["DECISION"], "propertyName": "rationale", "query": "authentication approach", "where": { "status": "confirmed", "decidedAt": {"$gte": "2026-01-01T00:00:00Z"} }, "limit": 10 }) ___SPLIT___ // TypeScript const results = await db.ai.search({ labels: ['DECISION'], propertyName: 'rationale', query: 'authentication approach', where: { status: 'confirmed', decidedAt: { $gte: '2026-01-01T00:00:00Z' } }, limit: 10 }) ``` When `where` is present, RushDB filters candidates first, then ranks by similarity. Exact results, semantic recall. ### Bring Your Own Vectors (external indexes) Using a different embedding model? Supply vectors yourself: ```sdk # Python db.ai.indexes.create({ "label": "ARTICLE", "propertyName": "content", "sourceType": "external", "dimensions": 768 }) # Python SDK: upsert_vectors(index_id, params) db.ai.indexes.upsert_vectors("idx_abc", { "items": [ {"recordId": "rec_001", "vector": [...]}, {"recordId": "rec_002", "vector": [...]} ] }) ___SPLIT___ // TypeScript await db.ai.indexes.create({ label: 'ARTICLE', propertyName: 'content', sourceType: 'external', dimensions: 768 }) await db.ai.vectors.upsert({ indexId: 'idx_abc', items: [ { recordId: 'rec_001', vector: [...] }, { recordId: 'rec_002', vector: [...] } ] }) ``` Self-hosted? Configure your own embedding model in `RUSHDB_EMBEDDING_MODEL`. The index pipeline is swappable — no vendor lock-in. --- ## 2. Ontology API — Data Explains Itself The most consistent problem in AI integrations: agents hallucinate field names, query labels that don't exist, and filter on properties with the wrong type. The root cause is that they have no authoritative schema to work from. The Ontology API solves this at the source. ```sdk # Python ontology = db.ai.get_ontology() ___SPLIT___ // TypeScript const ontology = await db.records.getOntology() ``` Returns: ```json { "labels": [ { "label": "DECISION", "count": 847, "properties": [ { "id": "prop_abc", "name": "topic", "type": "string" }, { "id": "prop_def", "name": "decidedAt", "type": "datetime", "min": "2025-01-01T00:00:00Z", "max": "2026-05-14T00:00:00Z" }, { "id": "prop_ghi", "name": "rationale", "type": "string", "vectorIndexes": [ { "id": "idx_001", "status": "ready", "sourceType": "managed", "similarityFunction": "cosine", "dimensions": 1536 } ] } ] } ], "relationships": [{ "from": "SESSION", "to": "DECISION", "type": "HAS_DECISION" }] } ``` The markdown variant (`getOntologyMarkdown`) is what MCP agents call at session start. It surfaces everything in one pass: labels, types, value ranges, relationship map, and a **Semantic Search** column that tells the agent which fields support `semanticSearch`. No guessing. No schema discovery round-trips. This one API makes analytical queries more reliable, reduces hallucinations, and gives agents the context they need before they ask their first question. --- ## 3. MCP Server + OAuth The MCP server ships with full OAuth 2.0 support — standard RS256, JWKS endpoint, per-user token scoping. Connect it to Claude Desktop, Cursor, VS Code, or ChatGPT and each user authenticates independently. Read-only tools work without auth, write tools require a token. ### Claude Desktop setup (API key mode) ```json { "mcpServers": { "rushdb": { "command": "npx", "args": ["@rushdb/mcp-server"], "env": { "RUSHDB_API_KEY": "your-key" } } } } ``` ### What the agent gets The MCP server exposes the full RushDB toolset — 35+ tools covering every operation: - **Discovery**: `getOntologyMarkdown`, `getOntology`, `findProperties`, `propertyValues` - **Read**: `findRecords`, `findOneRecord`, `getRecord`, `findRelationships`, `exportRecords` - **Write**: `createRecord`, `updateRecord`, `bulkCreateRecords`, `attachRelation` - **AI**: `createEmbeddingIndex`, `semanticSearch`, `getEmbeddingIndexStats`, `upsertEmbeddingVectors` - **Analytics**: `findRecords` with `select` + `groupBy` The `getSearchQuerySpec` tool delivers the complete query syntax into the agent's context window on demand — so it doesn't have to carry the full spec in its system prompt. --- ## 4. Skills — Skip the Boring Part Skills are pre-written, structured knowledge files for AI coding agents. Drop them into your project alongside your agent configuration, reference them by name, and the agent already knows how to do the thing correctly. Four skills ship with RushDB 2.0: ### `rushdb-agent-memory` Turns RushDB into a persistent memory layer. The skill teaches the agent the store → link → recall pattern, session management, the recommended label taxonomy (`SESSION`, `DECISION`, `ENTITY`, `TASK`, `PREFERENCE`), and how to traverse related memories across conversations. ### `rushdb-query-builder` The discovery-first workflow for safe, correct query construction. Mandatory ontology check before querying, intent classification, query spec loading for complex operations. Agents that load this skill don't hallucinate label names. ### `rushdb-data-modeling` LMPG schema design: label naming conventions, property types, relationship modeling, nested JSON import patterns, schema evolution without migrations. ### `rushdb-faceted-search` Build filter UIs that derive from live schema. Discover properties → enumerate values → map to widgets → assemble `where` clause as the user interacts. No hardcoded field names. ```bash # Install npm install @rushdb/skills # Reference in your agent config (VS Code example) "skills": ["rushdb-query-builder", "rushdb-agent-memory"] ``` --- ## 5. SearchQuery `select` + `groupBy` Analytical workloads now live entirely in the query layer. No more pulling records to count them in application code. ```sdk # Python — how many decisions per topic, last 90 days? result = db.records.find({ "labels": ["DECISION"], "where": { "decidedAt": {"$gte": "2026-02-14T00:00:00Z"} }, "select": { "topic": "$record.topic", "count": {"fn": "count"} }, "groupBy": ["$record.topic"], "orderBy": {"count": "desc"} }) ___SPLIT___ // TypeScript — how many decisions per topic, last 90 days? const breakdown = await db.records.find({ labels: ['DECISION'], where: { decidedAt: { $gte: '2026-02-14T00:00:00Z' } }, select: { topic: '$record.topic', count: { fn: 'count' } }, groupBy: ['$record.topic'], orderBy: { count: 'desc' } }) ``` Sum, avg, min, max, collect, timeBucket — all available. Relationship traversal works inside the same query. --- ## 6. Bring Your Own Neo4j — Everyone Free accounts, pro accounts, everyone. Connect your own Neo4j instance and keep full control of your data. The LMPG model sits on top of Neo4j — using your own instance means your data never leaves your infrastructure. --- ## 7. KU Pricing — One Metric Knowledge Units. One number that reflects how much knowledge your application creates and queries. Not instance hours, not storage tiers, not separate API call pricing. Free tier got a real upgrade: more KUs per month, zero feature restrictions. Every feature in RushDB 2.0 is available to free users. --- ## 8. Dashboard Improvements - Record editing in-place — click a field, edit it, done - Reworked graph visualization — see the actual structure of your data, not just a node cloud - Cleaner navigation and faster load times - Better separation between cloud and self-hosted feature sets --- ## Putting It Together: A Memory Layer in 15 Lines ```sdk # Python from rushdb import RushDB import os db = RushDB(os.environ["RUSHDB_API_KEY"]) # Store a session with auto-linked memories db.records.import_json( label="SESSION", data={ "startedAt": "2026-05-15T10:00:00Z", "topic": "product architecture review", "DECISION": [ {"topic": "auth", "decision": "Use Clerk", "rationale": "Better Next.js integration", "status": "confirmed"} ], "ENTITY": [{"name": "Clerk", "type": "service"}] } ) # Recall by meaning — no exact keyword match needed past_decisions = db.ai.search({ "labels": ["DECISION"], "propertyName": "rationale", "query": "how we handled login and authentication", "limit": 5 }) ___SPLIT___ // TypeScript import RushDB from '@rushdb/javascript-sdk' const db = new RushDB(process.env.RUSHDB_API_KEY) // Store a session with auto-linked memories await db.records.importJson({ label: 'SESSION', data: { startedAt: new Date().toISOString(), topic: 'product architecture review', DECISION: [ { topic: 'auth', decision: 'Use Clerk', rationale: 'Better Next.js integration', status: 'confirmed' } ], ENTITY: [{ name: 'Clerk', type: 'service' }] } }) // Recall by meaning — no exact keyword match needed const pastDecisions = await db.ai.search({ labels: ['DECISION'], propertyName: 'rationale', query: 'how we handled login and authentication', limit: 5 }) ``` That's the full loop: store structured + relational data, search by meaning, combine with filters. No vector store, no embedding pipeline, no separate graph database. --- ## Getting Started ```bash # Cloud (free) # 1. Create a project at app.rushdb.com # 2. Copy your API key # Install the SDK npm install @rushdb/javascript-sdk # Or connect via MCP npx @rushdb/mcp-server ``` Full docs: [docs.rushdb.com](https://docs.rushdb.com) MCP quickstart: [docs.rushdb.com/mcp-server/quickstart](https://docs.rushdb.com/mcp-server/quickstart) Agent setup: [rushdb.com/agent-setup](https://rushdb.com/agent-setup) GitHub: [github.com/rush-db/rushdb](https://github.com/rush-db/rushdb) --- ## What's Next We're building toward a world where the data layer and the memory layer are the same thing — where agents, humans, and applications all read and write to the same graph, with the same query language, and understand each other's context. 2.0 is a big step in that direction. We'd love to hear what you build with it. --- ## Labeled Meta Property Graphs (LMPG): A Property-Centric Approach to Graph Database Architecture Canonical URL: https://rushdb.com/blog/labeled-meta-property-graphs-rushdb-s-revolutionary-approach-to-graph-database-architecture Published: 2025-07-07T16:05:51.196Z Updated: 2025-07-10T16:50:57.683Z Tags: rushdb, graphs, graph theory # Labeled Meta Property Graphs: A Property-Centric Approach to Graph Database Architecture In the evolving landscape of database technologies, graph databases have emerged as powerful solutions for managing interconnected data. However, most graph databases still require developers to think in terms of nodes, edges, and complex query languages. RushDB introduces a paradigm shift with its **Labeled Meta Property Graph (LMPG)** architecture – a revolutionary approach that makes properties first-class citizens and enables unprecedented flexibility in data modeling and querying. What sets LMPG apart is its **unified query interface** that allows a single Data Transfer Object (DTO) to query Records, Labels, Properties, Relationships, and Available Values across any subgraph perspective. This creates what we call "database self-awareness" – the ability for the system to introspect and optimize queries dynamically based on the property-centric architecture. ## The Problem with Traditional Graph Approaches Traditional property graphs, while powerful, force developers into rigid thinking patterns: - **Schema-first mindset**: You must define your data structure before storing data - **Query complexity**: Learning Cypher, Gremlin, or other graph query languages - **Relationship overhead**: Manually defining and maintaining relationships - **Type constraints**: Rigid type systems that don't adapt to evolving data Consider a typical e-commerce scenario in a traditional property graph: ```cypher // Traditional approach - you must know the schema MATCH (product:Product)-[:BELONGS_TO]->(category:Category) WHERE product.price > 100 AND category.name = 'Electronics' RETURN product.name, product.price ``` This requires understanding: - Node labels (Product, Category) - Relationship types (BELONGS_TO) - Property names and their locations - Query syntax ## Introducing Labeled Meta Property Graphs (LMPG) RushDB's LMPG architecture flips this model on its head by making **properties** the central organizing principle. In LMPG: 1. **Properties are first-class citizens** with their own nodes 2. **Records are connected through shared properties** 3. **Relationships emerge automatically** based on property overlap 4. **Types are inferred and maintained automatically** ### The LMPG Structure ```mermaid graph LR subgraph "Properties (First-Class Citizens)" P1[":Property
name: 'price'
type: 'number'"] P2[":Property
name: 'color'
type: 'string'"] P3[":Property
name: 'brand'
type: 'string'"] end subgraph "Records (Data Containers)" R1[":Record :Car
price: 25000
color: 'red'
brand: 'Toyota'"] R2[":Record :House
price: 350000
color: 'white'"] R3[":Record :Shirt
color: 'blue'
brand: 'Nike'"] end P1 -->|__RUSHDB__RELATION__VALUE__| R1 P1 -->|__RUSHDB__RELATION__VALUE__| R2 P2 -->|__RUSHDB__RELATION__VALUE__| R1 P2 -->|__RUSHDB__RELATION__VALUE__| R2 P2 -->|__RUSHDB__RELATION__VALUE__| R3 P3 -->|__RUSHDB__RELATION__VALUE__| R1 P3 -->|__RUSHDB__RELATION__VALUE__| R3 ``` ## From JSON to LMPG: The BFS Transformation RushDB employs a sophisticated **Breadth-First Search (BFS)** algorithm to automatically convert hierarchical JSON data into LMPG structures. This process eliminates the need for manual schema design while preserving data relationships. ### Example: E-commerce Product Data Let's see how RushDB transforms complex JSON into an LMPG: **Input JSON:** ```json { "products": [ { "id": "prod-001", "name": "Wireless Headphones", "price": 299.99, "inStock": true, "category": { "name": "Electronics", "department": "Audio" }, "specifications": { "batteryLife": "30 hours", "connectivity": ["Bluetooth 5.0", "USB-C"], "weight": 250 }, "reviews": [ { "rating": 5, "comment": "Excellent sound quality", "verified": true }, { "rating": 4, "comment": "Good value for money", "verified": false } ] } ] } ``` **LMPG Transformation Process:** 1. **BFS Level 0** - Root object detection 2. **BFS Level 1** - Extract main entities (product, category, specifications) 3. **BFS Level 2** - Process nested objects and arrays 4. **BFS Level 3** - Handle deeply nested structures (reviews) **Resulting Graph Structure:** ```mermaid graph LR subgraph "Property Nodes" PN[":Property name:string"] PP[":Property price:number"] PS[":Property inStock:boolean"] PR[":Property rating:number"] PC[":Property comment:string"] PV[":Property verified:boolean"] PB[":Property batteryLife:string"] PW[":Property weight:number"] PD[":Property department:string"] end subgraph "Record Nodes" R1[":Record :Product
id: prod-001
name: Wireless Headphones
price: 299.99
inStock: true"] R2[":Record :Category
name: Electronics
department: Audio"] R3[":Record :Specifications
batteryLife: 30 hours
weight: 250"] R4[":Record :Review
rating: 5
comment: Excellent...
verified: true"] R5[":Record :Review
rating: 4
comment: Good value...
verified: false"] end PN -->|__RUSHDB__RELATION__VALUE__| R1 PN -->|__RUSHDB__RELATION__VALUE__| R2 PP -->|__RUSHDB__RELATION__VALUE__| R1 PS -->|__RUSHDB__RELATION__VALUE__| R1 PR -->|__RUSHDB__RELATION__VALUE__| R4 PR -->|__RUSHDB__RELATION__VALUE__| R5 PC -->|__RUSHDB__RELATION__VALUE__| R4 PC -->|__RUSHDB__RELATION__VALUE__| R5 PV -->|__RUSHDB__RELATION__VALUE__| R4 PV -->|__RUSHDB__RELATION__VALUE__| R5 PB -->|__RUSHDB__RELATION__VALUE__| R3 PW -->|__RUSHDB__RELATION__VALUE__| R3 PD -->|__RUSHDB__RELATION__VALUE__| R2 R1 -.->|HAS_CATEGORY| R2 R1 -.->|HAS_SPECIFICATIONS| R3 R1 -.->|HAS_REVIEW| R4 R1 -.->|HAS_REVIEW| R5 ``` ### Auto-Generated Internal Structure RushDB automatically enhances each record with metadata: ```javascript // RushDB's representation (simplified) { "__id": "01968aa4-22c1-781a-8e8c-8fe6be6c3fd4", // UUIDv7 "__label": "Product", // Auto-derived label "__proptypes": { // Type metadata "name": "string", "price": "number", "inStock": "boolean" }, "name": "Wireless Headphones", "price": 299.99, "inStock": true } ``` ## LMPG vs Other Graph Paradigms ### Comparison Matrix | Feature | Traditional Property Graph | RDF/Triple Store | Knowledge Graph | LMPG (RushDB) | |---------|---------------------------|------------------|-----------------|---------------| | **Schema Requirements** | Rigid, predefined | Ontology-based | Schema-on-write | Schema-free | | **Query Complexity** | High (Cypher/Gremlin) | Very High (SPARQL) | Medium | Low (JSON queries) | | **Property Handling** | Node attributes | Triple predicates | Entity properties | First-class citizens | | **Cross-type Queries** | Complex joins | SPARQL UNION | Limited | Native support | | **Data Import** | Manual modeling | RDF conversion | ETL pipelines | Auto-normalization | | **Learning Curve** | Steep | Very Steep | Moderate | Minimal | ### Traditional Property Graph Approach ```cypher // Find all items with price > 1000 across different types MATCH (n) WHERE (n:Car OR n:House OR n:Jewelry) AND n.price > 1000 RETURN n.name, n.price, labels(n) ``` **Problems:** - Must know all possible labels - Cannot discover new types automatically - Requires complex OR conditions - Brittle when new types are added ### LMPG Approach ```sdk # Same query in RushDB - discover ANY record with price > 1000 from rushdb import RushDB db = RushDB("RUSHDB_API_TOKEN") results = db.records.find({ "where": { "price": { "$gt": 1000 } } }) ___SPLIT___ // Same query in RushDB - discover ANY record with price > 1000 import RushDB from '@rushdb/javascript-sdk'; const db = new RushDB('RUSHDB_API_TOKEN'); const results = await db.records.find({ where: { price: { $gt: 1000 } } }); ``` **Advantages:** - Automatically finds all records regardless of type - No need to know labels in advance - Discovers relationships through shared properties - Self-adapting to new data types ## Cross-Domain Insights Through Property Traversal One of LMPG's most powerful features is its ability to reveal hidden connections across seemingly unrelated data through property-based traversal. ### Example: Multi-Domain Analysis Consider data from different domains stored in the same RushDB instance: ```json // E-commerce products { "label": "Product", "name": "Premium Coffee Maker", "price": 299, "color": "stainless steel", "rating": 4.8 } // Real estate listings { "label": "Property", "address": "123 Main St", "price": 299000, "color": "white", "rating": 4.2 } // Restaurant reviews { "label": "Restaurant", "name": "Downtown Bistro", "rating": 4.8, "color": "modern" } // Investment portfolios { "label": "Stock", "symbol": "AAPL", "price": 299.50, "rating": 4.5 } ``` ### Property-Based Cross-Domain Queries **1. Find all highly-rated items regardless of domain:** ```sdk results = db.records.find({ "where": { "rating": { "$gte": 4.5 } } }) # Returns: Coffee Maker, Restaurant, Stock ___SPLIT___ const results = await db.records.find({ where: { rating: { $gte: 4.5 } } }); // Returns: Coffee Maker, Restaurant, Stock ``` **2. Price range analysis across all domains:** ```sdk results = db.records.find({ "where": { "price": { "$gte": 250, "$lte": 350 } } }) # Returns: Coffee Maker, Stock, and potentially Real Estate down payments ___SPLIT___ const results = await db.records.find({ where: { price: { $gte: 250, $lte: 350 } } }); // Returns: Coffee Maker, Stock, and potentially Real Estate down payments ``` **3. Color-based aesthetic preferences:** ```sdk results = db.records.find({ "where": { "color": { "$in": ["stainless steel", "modern", "white"] } } }) # Reveals design preferences across products, properties, and venues ___SPLIT___ const results = await db.records.find({ where: { color: { $in: ["stainless steel", "modern", "white"] } } }); // Reveals design preferences across products, properties, and venues ``` ## Advanced LMPG Querying Patterns ### Property Intersection Analysis ```mermaid graph LR subgraph "Shared Properties Create Insights" P1[":Property rating:number"] P2[":Property price:number"] end subgraph "Cross-Domain Records" R1[":Restaurant
rating: 4.8"] R2[":Product
rating: 4.8
price: 299"] R3[":Hotel
rating: 4.2
price: 150"] R4[":Stock
price: 299"] end P1 --> R1 P1 --> R2 P1 --> R3 P2 --> R2 P2 --> R3 P2 --> R4 ``` ### Multi-Property Queries ```sdk # Find premium experiences (high rating + reasonable price) results = db.records.find({ "where": { "rating": { "$gte": 4.5 }, "price": { "$lte": 500 } } }) ___SPLIT___ // Find premium experiences (high rating + reasonable price) const results = await db.records.find({ where: { rating: { $gte: 4.5 }, price: { $lte: 500 } } }); ``` **Response structure:** ```javascript { "data": [ { "__label": "Restaurant", "name": "Downtown Bistro", "rating": 4.8, "price": 45 }, { "__label": "Product", "name": "Coffee Maker", "rating": 4.8, "price": 299 }, { "__label": "Hotel", "name": "Boutique Inn", "rating": 4.6, "price": 180 } ] } ``` ## Vector Integration in LMPG RushDB's LMPG architecture seamlessly integrates vector operations as first-class properties, enabling AI-powered insights while maintaining the unified query interface: ### Vector Properties as First-Class Citizens ```sdk # Add vector embeddings as properties db.records.create({ "label": "Document", "data": { "title": "AI Research Paper", "content": "Large language models have revolutionized...", "embedding": [0.1, 0.8, -0.3, 0.9, ...], # 1536-dimensional vector "category": "AI Research", "publishDate": "2024-01-15", "citationCount": 42, "impact_score": 8.7 } }); ___SPLIT___ // Add vector embeddings as properties await db.records.create({ label: "Document", data: { title: "AI Research Paper", content: "Large language models have revolutionized...", embedding: [0.1, 0.8, -0.3, 0.9, ...], // 1536-dimensional vector category: "AI Research", publishDate: "2024-01-15", citationCount: 42, impact_score: 8.7 } }); ``` ### Hybrid Search with Unified Querying The power of LMPG shows in combining semantic similarity with structured property filters: ```sdk # Vector similarity search combined with property filtering similarDocuments = db.records.find({ "where": { "category": "AI Research", "publishDate": { "$gte": "2024-01-01" }, "citationCount": { "$gte": 10 }, "embedding": { "$vector": { "fn": "gds.similarity.cosine", "query": queryEmbedding, "threshold": 0.75 # Interpreted as $gte: 0.75 } } }, "limit": 10 }) ___SPLIT___ // Vector similarity search combined with property filtering const similarDocuments = await db.records.find({ where: { category: "AI Research", publishDate: { $gte: "2024-01-01" }, citationCount: { $gte: 10 }, embedding: { $vector: { fn: "gds.similarity.cosine", query: queryEmbedding, threshold: 0.75 // Interpreted as $gte: 0.75 } } }, limit: 10 }); ``` ### Multi-Perspective Vector Analysis The same query provides vector insights across all perspectives: **Records Perspective:** ```javascript // Documents with semantic similarity + structured filters { "data": [ { "__id": "...", "title": "Transformer Architectures in NLP", "embedding": [...], "similarity_score": 0.89, "__label": "Document" } ] } ``` **Properties Perspective:** ```javascript // Discovers vector properties automatically { "data": [ { "name": "embedding", "type": "vector", "dimensions": 1536, "similarity_function": "cosine" } ] } ``` **Relationships Perspective:** ```javascript // Vector-based relationships discovered { "data": [ { "sourceId": "doc1", "targetId": "doc2", "type": "SEMANTIC_SIMILARITY", "similarity_score": 0.85 } ] } ``` ### Vector-Enhanced Performance ```mermaid graph TB subgraph "Traditional Vector DB" T1[Vector Index] --> T2[Similarity Search] T2 --> T3[Post-Filter Results] T3 --> T4[Join with Metadata] end subgraph "LMPG Vector Integration" P1[Property-Vector Index] --> P2[Parallel Execution] P2 --> P3[Vector Similarity] P2 --> P4[Property Filtering] P3 --> P5[Unified Results] P4 --> P5 end T4 --> TR[Sequential Processing] P5 --> PR[Parallel Processing] ``` This enables powerful hybrid search combining semantic similarity with structured property filters, all through the same unified interface. --- *Learn more about [Vector Search](https://docs.rushdb.com/concepts/search/where#vector-operators)* ## Performance Characteristics ### Why LMPG Scales Differently Traditional database performance degrades with data size and query complexity. LMPG maintains consistent performance through its revolutionary **perforating query architecture** that skips expensive operations by leveraging properties as dynamic indices. **1. Property-First Indexing:** ``` Traditional JOIN: O(n × m × log(k)) LMPG Traversal: O(p + r) ``` Where: - n, m, k = table/node sizes - p = number of properties - r = number of relevant records **2. Perforating Query Execution:** ```mermaid graph LR subgraph "Traditional Database Query Path" T1[Table Scan] --> T2[Filter Apply] T2 --> T3[Join Execution] T3 --> T4[Aggregation] T4 --> T5[Sort & Limit] T5 --> T6[Result Set] end subgraph "LMPG Perforating Query Path" P1[Property Index] --> P2[Record Pointer] P2 --> P3[Lazy Load Relations] P3 --> P4[Cached Metadata] P4 --> P5[Direct Result] end T6 --> TR["High Latency
O(n×m×log k)"] P5 --> PR["Low Latency
O(p+r)"] ``` **3. Dynamic Index Management:** Properties act as **living indices** that: - **Self-organize** with controllable overhead - **Adapt to data distribution** in real-time **4. Handful Index Optimization:** ```sql -- Auto-generated Neo4j indexes for each property CREATE INDEX property_name_string FOR (n:__RUSHDB__LABEL__PROPERTY__) ON (n.name, n.type, n.projectId, n.metadata); CREATE INDEX record_lookup FOR (n:__RUSHDB__LABEL__RECORD__) ON (n.__RUSHDB__KEY__ID__, n.__RUSHDB__KEY__PROJECT__ID__); ``` ## Graph Perforating Architecture: Technical Deep Dive RushDB's revolutionary **graph perforating architecture** achieves unprecedented data observability through a single unified query interface. Unlike traditional databases that require separate APIs for different data perspectives, LMPG enables one query to simultaneously access Records, Labels, Properties, Values, and Relationships. ### The Unified Query Foundation Consider this complex organizational analysis query that demonstrates cross-entity traversal with multi-level filtering: ```javascript // Example: Enterprise Data Intelligence Query const QUERY = { labels: ["DEPARTMENT"], where: { name: { "$contains": "e" }, PROJECT: { budget: { $xor: { $lte: 10000000, $gte: 15000000 } }, EMPLOYEE: { salary: { $gte: 300000 } } } } } ``` This query structure directly maps to graph traversal paths, enabling intuitive nested querying across related entities without complex join syntax: ```mermaid graph LR subgraph "Query Traversal Path" D[":DEPARTMENT
name contains 'e'"] P[":PROJECT
budget ≤10M XOR ≥15M"] E[":EMPLOYEE
salary ≥300K"] end D -->|RUSHDB_DEFAULT_RELATION| P P -->|RUSHDB_DEFAULT_RELATION| E subgraph "Property Filters" DF["name: { $contains: 'e' }"] PF["budget: { $xor: { $lte: 10M, $gte: 15M } }"] EF["salary: { $gte: 300000 }"] end D -.-> DF P -.-> PF E -.-> EF ``` ### 1. Records Perspective: Data Retrieval **SDK Call:** ```sdk # Get actual department records matching criteria records = db.records.find(QUERY) ___SPLIT___ // Get actual department records matching criteria const records = await db.records.find(QUERY); ``` **Generated Cypher Query:** ```cypher MATCH (record:__RUSHDB__LABEL__RECORD__:`DEPARTMENT` { __RUSHDB__KEY__PROJECT__ID__: $projectId }) WHERE (any(value IN record.name WHERE value =~ "(?i).*e.*")) OPTIONAL MATCH (record)--(record1:PROJECT) WHERE ((any(value IN record1.budget WHERE value <= 10000000) XOR any(value IN record1.budget WHERE value >= 15000000))) OPTIONAL MATCH (record1)--(record2:EMPLOYEE) WHERE (any(value IN record2.salary WHERE value >= 300000)) WITH record, record1, record2 WHERE record IS NOT NULL AND (record1 IS NOT NULL AND record2 IS NOT NULL) RETURN record SKIP 0 LIMIT 1000 ``` **Resulting Data:** ```json { "data": [ { "__id": "01974151-41f4-7c7e-a9bd-a28df7703077", "__label": "DEPARTMENT", "name": "Research and Development", "description": "Innovation-focused department driving product evolution", "headcount": 150, "budget": 2500000 } ], "total": 5, "success": true } ``` ### 2. Labels Perspective: Entity Type Discovery **SDK Call:** ```sdk # Discover all entity types matching the criteria labels = db.labels.find(QUERY) ___SPLIT___ // Discover all entity types matching the criteria const labels = await db.labels.find(QUERY); ``` **Generated Cypher Query:** ```cypher MATCH (record:__RUSHDB__LABEL__RECORD__ { __RUSHDB__KEY__PROJECT__ID__: $projectId }) WHERE (any(value IN record.name WHERE value =~ "(?i).*e.*")) OPTIONAL MATCH (record)--(record1:PROJECT) WHERE ((any(value IN record1.budget WHERE value <= 10000000) XOR any(value IN record1.budget WHERE value >= 15000000))) OPTIONAL MATCH (record1)--(record2:EMPLOYEE) WHERE (any(value IN record2.salary WHERE value >= 300000)) WITH record, record1, record2 WHERE record IS NOT NULL AND (record1 IS NOT NULL AND record2 IS NOT NULL) WITH DISTINCT record, [label IN labels(record) WHERE label <> "__RUSHDB__LABEL__RECORD__"] as recordLabels RETURN count(recordLabels) as total, recordLabels[0] as label ``` **Resulting Data:** ```json { "data": { "DEPARTMENT": 5, "EMPLOYEE": 2863 }, "success": true } ``` ### 3. Properties Perspective: Schema Discovery **SDK Call:** ```sdk # Discover available properties across matching entities properties = db.properties.find(QUERY) ___SPLIT___ // Discover available properties across matching entities const properties = await db.properties.find(QUERY); ``` **Generated Cypher Queries:** ```cypher -- Get entity-specific properties MATCH (record:__RUSHDB__LABEL__RECORD__:`DEPARTMENT` { __RUSHDB__KEY__PROJECT__ID__: $projectId }) WHERE (any(value IN record.name WHERE value =~ "(?i).*e.*")) OPTIONAL MATCH (record)--(record1:PROJECT) WHERE ((any(value IN record1.budget WHERE value <= 10000000) XOR any(value IN record1.budget WHERE value >= 15000000))) OPTIONAL MATCH (record1)--(record2:EMPLOYEE) WHERE (any(value IN record2.salary WHERE value >= 300000)) WITH record, record1, record2 WHERE record IS NOT NULL AND (record1 IS NOT NULL AND record2 IS NOT NULL) UNWIND keys(record) as propertyName RETURN collect(DISTINCT propertyName) as fields -- Get global property metadata MATCH (property:__RUSHDB__LABEL__PROPERTY__ { projectId: $id }) RETURN collect(DISTINCT property { .id, .metadata, .name, .type, .projectId }) as properties ``` **Resulting Data:** ```json { "data": [ { "id": "01974151-41f3-7ecc-a42c-2a6a336f856f", "name": "name", "type": "string", "metadata": "" }, { "id": "01974151-41f4-7c7e-a9bd-a28cffae6594", "name": "description", "type": "string", "metadata": "" }, { "id": "01974151-41f5-7635-81a1-budget", "name": "budget", "type": "number", "metadata": "" } ], "success": true } ``` ### 4. Values Perspective: Data Range Discovery **SDK Call:** ```sdk # Get distinct values and ranges for specific properties values = db.properties.values(property_id, QUERY) ___SPLIT___ // Get distinct values and ranges for specific properties const values = await db.properties.values(propertyId, QUERY); ``` **Generated Cypher Query:** ```cypher MATCH (record:__RUSHDB__LABEL__RECORD__:`DEPARTMENT` { __RUSHDB__KEY__PROJECT__ID__: $projectId }) <-[value:__RUSHDB__RELATION__VALUE__]-(property:__RUSHDB__LABEL__PROPERTY__ { id: $id }) WHERE (any(value IN record.name WHERE value =~ "(?i).*e.*")) OPTIONAL MATCH (record)--(record1:PROJECT) WHERE ((any(value IN record1.budget WHERE value <= 10000000) XOR any(value IN record1.budget WHERE value >= 15000000))) OPTIONAL MATCH (record1)--(record2:EMPLOYEE) WHERE (any(value IN record2.salary WHERE value >= 300000)) AND record[property.name] IS NOT NULL AND property.type <> 'vector' WITH property, record, record1, record2 WHERE record IS NOT NULL AND (record1 IS NOT NULL AND record2 IS NOT NULL) WITH record[property.name] AS propValue, property.type AS propType ORDER BY record.__RUSHDB__KEY__ID__ WITH apoc.coll.toSet(apoc.coll.flatten(collect(DISTINCT propValue))) AS values, propType as type UNWIND values AS v WITH values, type, min(CASE type WHEN 'datetime' THEN datetime(v) ELSE toFloatOrNull(v) END) AS minValue, max(CASE type WHEN 'datetime' THEN datetime(v) ELSE toFloatOrNull(v) END) AS maxValue RETURN { values: values[0..1000], min: CASE type WHEN 'datetime' THEN toString(minValue) ELSE minValue END, max: CASE type WHEN 'datetime' THEN toString(maxValue) ELSE maxValue END, type: type } AS result ``` **Resulting Data:** ```json { "data": { "values": [ "Research and Development", "Engineering Excellence Division", "Product Innovation Center", "Advanced Technology Department", "Strategic Development Unit" ], "min": null, "max": null, "type": "string" }, "success": true } ``` ### 5. Relationships Perspective: Connection Discovery **SDK Call:** ```sdk # Discover relationships between matching entities relationships = db.relationships.find(QUERY) ___SPLIT___ // Discover relationships between matching entities const relationships = await db.relationships.find(QUERY); ``` **Generated Cypher Queries:** ```cypher -- Get relationship details MATCH (record:__RUSHDB__LABEL__RECORD__:`DEPARTMENT` { __RUSHDB__KEY__PROJECT__ID__: $projectId }) WHERE (any(value IN record.name WHERE value =~ "(?i).*e.*")) OPTIONAL MATCH (record)--(record1:PROJECT) WHERE ((any(value IN record1.budget WHERE value <= 10000000) XOR any(value IN record1.budget WHERE value >= 15000000))) OPTIONAL MATCH (record1)--(record2:EMPLOYEE) WHERE (any(value IN record2.salary WHERE value >= 300000)) WITH record, record1, record2 WHERE record IS NOT NULL AND (record1 IS NOT NULL AND record2 IS NOT NULL) MATCH (record)-[rel]-(neighbor:__RUSHDB__LABEL__RECORD__) SKIP 0 LIMIT 1000 RETURN DISTINCT CASE WHEN startNode(rel) = record THEN { sourceId: record.__RUSHDB__KEY__ID__, sourceLabel: [label IN labels(record) WHERE label <> "__RUSHDB__LABEL__RECORD__"][0], targetId: neighbor.__RUSHDB__KEY__ID__, targetLabel: [label IN labels(neighbor) WHERE label <> "__RUSHDB__LABEL__RECORD__"][0], type: type(rel) } ELSE { sourceId: neighbor.__RUSHDB__KEY__ID__, sourceLabel: [label IN labels(neighbor) WHERE label <> "__RUSHDB__LABEL__RECORD__"][0], targetId: record.__RUSHDB__KEY__ID__, targetLabel: [label IN labels(record) WHERE label <> "__RUSHDB__LABEL__RECORD__"][0], type: type(rel) } END AS relation -- Get relationship count MATCH (record:__RUSHDB__LABEL__RECORD__:`DEPARTMENT` { __RUSHDB__KEY__PROJECT__ID__: $projectId }) WHERE (any(value IN record.name WHERE value =~ "(?i).*e.*")) OPTIONAL MATCH (record)--(record1:PROJECT) WHERE ((any(value IN record1.budget WHERE value <= 10000000) XOR any(value IN record1.budget WHERE value >= 15000000))) OPTIONAL MATCH (record1)--(record2:EMPLOYEE) WHERE (any(value IN record2.salary WHERE value >= 300000)) WITH record, record1, record2 WHERE record IS NOT NULL AND (record1 IS NOT NULL AND record2 IS NOT NULL) MATCH (record)-[rel]-(target:__RUSHDB__LABEL__RECORD__) RETURN count(DISTINCT rel) as total ``` **Resulting Data:** ```json { "data": [ { "targetLabel": "PROJECT", "targetId": "01974151-41f6-78b8-9d4b-ad5bd184baf9", "type": "RUSHDB_DEFAULT_RELATION", "sourceId": "01974151-41f4-7c7e-a9bd-a28df7703077", "sourceLabel": "DEPARTMENT" }, { "targetLabel": "PROJECT", "targetId": "01974151-41f6-78b8-9d4b-ad5190bb4abf", "type": "RUSHDB_DEFAULT_RELATION", "sourceId": "01974151-41f4-7c7e-a9bd-a28df7703077", "sourceLabel": "DEPARTMENT" }, { "targetLabel": "COMPANY", "targetId": "01974151-41f0-7309-946f-2a45a8391ed8", "type": "RUSHDB_DEFAULT_RELATION", "sourceId": "01974151-41f4-7c7e-a9bd-a28df7703077", "sourceLabel": "DEPARTMENT" } ], "total": 25, "success": true } ``` ### The Perforating Query Advantage This unified approach delivers **complete data observability** from a single query interface: ```mermaid graph TB subgraph "Single SDK Query" Q[QUERY Object] end subgraph "Perforating Architecture" P1[Query Parser] P2[Cypher Generator] P3[Execution Engine] P4[Result Aggregator] end subgraph "Five Perspectives" R1[Records
Actual Data] R2[Labels
Entity Types] R3[Properties
Schema Info] R4[Values
Data Ranges] R5[Relationships
Connections] end Q --> P1 P1 --> P2 P2 --> P3 P3 --> P4 P4 --> R1 P4 --> R2 P4 --> R3 P4 --> R4 P4 --> R5 ``` ### Performance Characteristics **Traditional Approach (5 separate API calls):** - Records: 250ms - Labels: 180ms - Properties: 320ms - Values: 420ms - Relationships: 290ms - **Total: 1,460ms** **LMPG Perforating Approach (parallel execution):** - All perspectives: **~300ms** - **Performance gain: 80% reduction** The key insight is that RushDB's property-centric architecture allows the same filtered record set to be analyzed from multiple perspectives without re-executing the expensive traversal logic. The WHERE clauses are shared across all perspective queries, enabling massive optimization through result set reuse. ### Real-World Applications of Graph Perforating The unified query interface enables powerful real-world applications that would require complex joins and multiple API calls in traditional databases: **E-commerce Intelligence:** ```sdk # Single query for comprehensive product analysis products = db.records.find({ "labels": ["Product"], "where": { "price": { "$gte": 50, "$lte": 500 }, "rating": { "$gte": 4.0 }, "CATEGORY": { "trending": True, "REVIEW": { "sentiment": { "$gte": 0.7 } } } } }) # Simultaneously provides: # - Product records (actual inventory data) # - Available categories (PRODUCT, CATEGORY, REVIEW entity types) # - Price/rating distributions (min/max values across properties) # - Cross-entity relationships (product-category-review connections) ___SPLIT___ // Single query for comprehensive product analysis const products = await db.records.find({ labels: ["Product"], where: { price: { $gte: 50, $lte: 500 }, rating: { $gte: 4.0 }, CATEGORY: { trending: true, REVIEW: { sentiment: { $gte: 0.7 } } } } }); // Simultaneously provides: // - Product records (actual inventory data) // - Available categories (PRODUCT, CATEGORY, REVIEW entity types) // - Price/rating distributions (min/max values across properties) // - Cross-entity relationships (product-category-review connections) ``` **IoT Sensor Analysis:** ```sdk # Multi-dimensional sensor data analysis sensors = db.records.find({ "labels": ["Sensor"], "where": { "temperature": { "$between": [20, 25] }, "humidity": { "$lte": 60 }, "LOCATION": { "region": "west-coast", "BUILDING": { "efficiency_rating": { "$gte": 4.0 } } } } }) # Automatic discovery of: # - Sensor readings (filtered data points) # - Equipment types (SENSOR, LOCATION, BUILDING labels) # - Environmental ranges (temperature/humidity distributions) # - Spatial relationships (sensor-location-building hierarchy) ___SPLIT___ // Multi-dimensional sensor data analysis const sensors = await db.records.find({ labels: ["Sensor"], where: { temperature: { $between: [20, 25] }, humidity: { $lte: 60 }, LOCATION: { region: "west-coast", BUILDING: { efficiency_rating: { $gte: 4.0 } } } } }); // Automatic discovery of: // - Sensor readings (filtered data points) // - Equipment types (SENSOR, LOCATION, BUILDING labels) // - Environmental ranges (temperature/humidity distributions) // - Spatial relationships (sensor-location-building hierarchy) ``` **Financial Portfolio Analysis:** ```sdk # Complex risk assessment across investment hierarchy investments = db.records.find({ "labels": ["Investment"], "where": { "value": { "$gte": 1000000 }, "PORTFOLIO": { "risk_score": { "$lte": 7 }, "INVESTOR": { "net_worth": { "$gte": 10000000 } } } } }) # Comprehensive risk profiling reveals: # - Investment instruments (matching financial products) # - Entity classification (INVESTMENT, PORTFOLIO, INVESTOR types) # - Value distributions (investment amounts, risk scores, net worth ranges) # - Ownership networks (investor-portfolio-investment relationships) ___SPLIT___ // Complex risk assessment across investment hierarchy const investments = await db.records.find({ labels: ["Investment"], where: { value: { $gte: 1000000 }, PORTFOLIO: { risk_score: { $lte: 7 }, INVESTOR: { net_worth: { $gte: 10000000 } } } } }); // Comprehensive risk profiling reveals: // - Investment instruments (matching financial products) // - Entity classification (INVESTMENT, PORTFOLIO, INVESTOR types) // - Value distributions (investment amounts, risk scores, net worth ranges) // - Ownership networks (investor-portfolio-investment relationships) ``` --- *Explore [Search Capabilities](https://docs.rushdb.com/concepts/search/introduction)* ## The Unified Query Revolution The most transformative aspect of LMPG is its **unified query interface** that eliminates the complexity of traditional database interactions: ```mermaid graph LR subgraph "Before: Multiple Interfaces" B1[Records API] B2[Schema API] B3[Metadata API] B4[Analytics API] B5[Relationship API] end subgraph "After: Single DTO" A1[Universal Query Interface] end subgraph "All Perspectives" P1[Records] P2[Labels] P3[Properties] P4[Values] P5[Relationships] end B1 --> P1 B2 --> P2 B3 --> P3 B4 --> P4 B5 --> P5 A1 --> P1 A1 --> P2 A1 --> P3 A1 --> P4 A1 --> P5 ``` **Key Benefits of the Unified Interface:** - **Single DTO, infinite perspectives**: One query interface for all data aspects - **Properties as dynamic indices**: Self-optimizing performance without manual tuning - **Database self-awareness**: Automatic adaptation to data patterns and usage - **Perforating query architecture**: Skip expensive operations for consistent performance - **Cross-domain insights**: Discover relationships across unrelated data domains This revolutionary approach means developers no longer need to learn separate APIs for different database operations. Whether you need records, schema information, property metadata, value ranges, or relationship mappings - it all comes from the same intuitive JSON query structure demonstrated in the Graph Perforating section above. ### Revolutionary Applications Enabled by Unified Interface The unified query interface opens up entirely new possibilities across multiple domains, enabling sophisticated applications without writing complex database code: #### 1. Cataloging Indeterminate Data **Challenge**: Scientific datasets, IoT streams, and user-generated content often have unpredictable schemas and evolving structures. **LMPG Solution**: Automatic schema adaptation with unified querying across all data perspectives. ```sdk # Automatically catalog any scientific data structure research_data = db.records.create({ "label": "Experiment", "data": { "experiment_id": "EXP-2024-001", "temperature": 23.5, "unexpected_compound": "C8H10N4O2", # New discovery "readings": [1.2, 3.4, 5.6], "metadata": { "researcher": "Dr. Smith", "equipment": "Spectrometer-X200" } } }) # Later, discover all experiments with any temperature data temperature_studies = db.records.find({ "where": { "temperature": { "$exists": True } } }) # Automatically discover new property types new_properties = db.properties.find() # Finds "unexpected_compound" property property_values = db.properties.values(compound_property_id) # Get all compound values ___SPLIT___ // Automatically catalog any scientific data structure const researchData = await db.records.create({ label: "Experiment", data: { experiment_id: "EXP-2024-001", temperature: 23.5, unexpected_compound: "C8H10N4O2", // New discovery readings: [1.2, 3.4, 5.6], metadata: { researcher: "Dr. Smith", equipment: "Spectrometer-X200" } } }); // Later, discover all experiments with any temperature data const temperatureStudies = await db.records.find({ where: { temperature: { $exists: true } } }); // Automatically discover new property types const newProperties = await db.properties.find(); // Finds "unexpected_compound" property const propertyValues = await db.properties.values(compoundPropertyId); // Get all compound values ``` **Result**: Zero-configuration data cataloging that automatically adapts to new discoveries. #### 2. AI-Driven Scientific Research Loops **Challenge**: Modern AI research requires iterative data exploration, hypothesis generation, and validation across evolving datasets. **LMPG Solution**: Unified interface enables AI agents to autonomously explore data relationships and generate research hypotheses. ```sdk # AI research agent workflow class ResearchAgent: def explore_correlations(self): # Discover all numeric properties numeric_props = db.properties.find({"where": {"type": "number"}}) for prop in numeric_props["data"]: # Get value distributions distribution = db.properties.values(prop["id"]) # Find correlating entities correlated_records = db.records.find({ "where": {prop["name"]: {"$gte": distribution["data"]["min"]}} }) # Discover relationship patterns relationships = db.relationships.find(correlated_records["query"]) # Generate hypothesis based on discovered patterns yield self.generate_hypothesis(prop, distribution, relationships) def validate_hypothesis(self, hypothesis): # Use unified interface to test hypothesis across all data perspectives validation_query = { "where": hypothesis["conditions"] } results = { "records": db.records.find(validation_query), "patterns": db.relationships.find(validation_query), "distributions": [db.properties.values(p) for p in hypothesis["properties"]] } return self.analyze_validation(results) ___SPLIT___ // AI research agent workflow class ResearchAgent { async exploreCorrelations() { // Discover all numeric properties const numericProps = await db.properties.find({where: {type: "number"}}); for (const prop of numericProps.data) { // Get value distributions const distribution = await db.properties.values(prop.id); // Find correlating entities const correlatedRecords = await db.records.find({ where: {[prop.name]: {$gte: distribution.data.min}} }); // Discover relationship patterns const relationships = await db.relationships.find(correlatedRecords.query); // Generate hypothesis based on discovered patterns yield this.generateHypothesis(prop, distribution, relationships); } } async validateHypothesis(hypothesis) { // Use unified interface to test hypothesis across all data perspectives const validationQuery = { where: hypothesis.conditions }; const results = { records: await db.records.find(validationQuery), patterns: await db.relationships.find(validationQuery), distributions: await Promise.all( hypothesis.properties.map(p => db.properties.values(p)) ) }; return this.analyzeValidation(results); } } ``` **Result**: AI agents can autonomously discover patterns, generate hypotheses, and validate theories through iterative data exploration. #### 3. Unbeatable E-commerce Filtering (Zero Code) **Challenge**: Building sophisticated product filtering requires complex database queries and extensive frontend logic. **LMPG Solution**: Unified interface automatically generates filters from data, requires zero manual configuration. ```sdk # Auto-generate complete filtering interface class AutoFilter: def __init__(self, category="Product"): self.category = category def get_filter_options(self): # Single query gets all filter possibilities base_query = {"labels": [self.category]} return { # Available products "products": db.records.find(base_query), # Auto-discovered filter categories "categories": db.labels.find(base_query), # All filterable properties "properties": db.properties.find(base_query), # Value ranges for each property "ranges": { prop["name"]: db.properties.values(prop["id"], base_query) for prop in db.properties.find(base_query)["data"] } } def apply_filters(self, user_filters): # User filters automatically become query conditions filtered_query = { "labels": [self.category], "where": user_filters # Direct mapping from UI } return { "products": db.records.find(filtered_query), "updated_ranges": self.get_updated_ranges(filtered_query), "related_categories": db.labels.find(filtered_query) } # Frontend automatically adapts to any product catalog auto_filter = AutoFilter("Product") filter_ui = auto_filter.get_filter_options() # User applies filters - no backend code needed user_selection = { "price": {"$gte": 100, "$lte": 500}, "rating": {"$gte": 4.0}, "brand": {"$in": ["Nike", "Adidas"]}, "CATEGORY": { "trending": True } } filtered_results = auto_filter.apply_filters(user_selection) ___SPLIT___ // Auto-generate complete filtering interface class AutoFilter { constructor(category = "Product") { this.category = category; } async getFilterOptions() { // Single query gets all filter possibilities const baseQuery = {labels: [this.category]}; const properties = await db.properties.find(baseQuery); return { // Available products products: await db.records.find(baseQuery), // Auto-discovered filter categories categories: await db.labels.find(baseQuery), // All filterable properties properties: properties, // Value ranges for each property ranges: await Promise.all( properties.data.map(async prop => ({ [prop.name]: await db.properties.values(prop.id, baseQuery) })) ) }; } async applyFilters(userFilters) { // User filters automatically become query conditions const filteredQuery = { labels: [this.category], where: userFilters // Direct mapping from UI }; return { products: await db.records.find(filteredQuery), updatedRanges: await this.getUpdatedRanges(filteredQuery), relatedCategories: await db.labels.find(filteredQuery) }; } } // Frontend automatically adapts to any product catalog const autoFilter = new AutoFilter("Product"); const filterUI = await autoFilter.getFilterOptions(); // User applies filters - no backend code needed const userSelection = { price: {$gte: 100, $lte: 500}, rating: {$gte: 4.0}, brand: {$in: ["Nike", "Adidas"]}, CATEGORY: { trending: true } }; const filteredResults = await autoFilter.applyFilters(userSelection); ``` **Result**: Complete e-commerce filtering interface that automatically adapts to any product catalog without writing filtering logic. #### 4. Real-Time Analytical Workloads **Challenge**: Traditional analytical queries require complex aggregations, joins, and pre-computed views. **LMPG Solution**: Unified interface enables real-time analytics across any data dimension without pre-configuration. ```sdk # Real-time business intelligence dashboard class RealTimeAnalytics: def __init__(self): self.metrics = {} def get_sales_insights(self, time_range): base_query = { "labels": ["Sale"], "where": { "timestamp": { "$gte": time_range["start"], "$lte": time_range["end"] } } } # Single unified call gets all analytics return { # Core sales data "sales": db.records.find(base_query), # Auto-discovered segments "segments": db.labels.find(base_query), # All sales dimensions "dimensions": db.properties.find(base_query), # Value distributions per dimension "distributions": { "revenue": db.properties.values("revenue", base_query), "products": db.properties.values("product_id", base_query), "regions": db.properties.values("region", base_query), "channels": db.properties.values("channel", base_query) }, # Relationship insights "correlations": db.relationships.find(base_query) } def drill_down(self, dimension, value): # Dynamic drill-down without predefined hierarchies drill_query = { "where": { dimension: value, "timestamp": {"$gte": "2024-01-01"} } } return { "details": db.records.find(drill_query), "related_dimensions": db.properties.find(drill_query), "cross_correlations": db.relationships.find(drill_query) } # Usage: Real-time dashboard that adapts to any business analytics = RealTimeAnalytics() # Get comprehensive sales insights insights = analytics.get_sales_insights({ "start": "2024-01-01", "end": "2024-12-31" }) # Dynamic drill-down based on user clicks region_details = analytics.drill_down("region", "North America") product_details = analytics.drill_down("product_category", "Electronics") ___SPLIT___ // Real-time business intelligence dashboard class RealTimeAnalytics { constructor() { this.metrics = {}; } async getSalesInsights(timeRange) { const baseQuery = { labels: ["Sale"], where: { timestamp: { $gte: timeRange.start, $lte: timeRange.end } } }; // Single unified call gets all analytics return { // Core sales data sales: await db.records.find(baseQuery), // Auto-discovered segments segments: await db.labels.find(baseQuery), // All sales dimensions dimensions: await db.properties.find(baseQuery), // Value distributions per dimension distributions: { revenue: await db.properties.values("revenue", baseQuery), products: await db.properties.values("product_id", baseQuery), regions: await db.properties.values("region", baseQuery), channels: await db.properties.values("channel", baseQuery) }, // Relationship insights correlations: await db.relationships.find(baseQuery) }; } async drillDown(dimension, value) { // Dynamic drill-down without predefined hierarchies const drillQuery = { where: { [dimension]: value, timestamp: {$gte: "2024-01-01"} } }; return { details: await db.records.find(drillQuery), relatedDimensions: await db.properties.find(drillQuery), crossCorrelations: await db.relationships.find(drillQuery) }; } } // Usage: Real-time dashboard that adapts to any business const analytics = new RealTimeAnalytics(); // Get comprehensive sales insights const insights = await analytics.getSalesInsights({ start: "2024-01-01", end: "2024-12-31" }); // Dynamic drill-down based on user clicks const regionDetails = await analytics.drillDown("region", "North America"); const productDetails = await analytics.drillDown("product_category", "Electronics"); ``` **Result**: Real-time analytics dashboards that automatically discover and visualize any business dimension without pre-configuration. #### 5. Healthcare Data Integration **Challenge**: Medical data comes from disparate systems with different schemas and requires complex integration. **LMPG Solution**: Automatic schema harmonization enables unified patient views across all medical systems. ```sdk # Unified patient data across all medical systems class MedicalDataIntegration: def integrate_patient_data(self, patient_id): # Query across all medical record types base_query = { "where": { "patient_id": patient_id } } return { # All medical records "records": db.records.find(base_query), # Auto-discovered record types "record_types": db.labels.find(base_query), # All medical properties "medical_fields": db.properties.find(base_query), # Value ranges for medical metrics "vital_ranges": { field["name"]: db.properties.values(field["id"], base_query) for field in db.properties.find(base_query)["data"] if field["name"] in ["blood_pressure", "heart_rate", "temperature"] }, # Medical relationships "care_relationships": db.relationships.find(base_query) } def find_similar_cases(self, symptoms, demographics): # Cross-system case similarity without predefined schemas similarity_query = { "where": { **symptoms, # Any symptom properties **demographics, # Any demographic properties } } return { "similar_patients": db.records.find(similarity_query), "common_patterns": db.relationships.find(similarity_query), "outcome_distributions": db.properties.values("outcome", similarity_query) } # Usage: Instant integration across any medical system medical = MedicalDataIntegration() # Complete patient view from all systems patient_data = medical.integrate_patient_data("PAT-12345") # Find similar cases for treatment planning similar_cases = medical.find_similar_cases( symptoms={"chest_pain": True, "shortness_of_breath": True}, demographics={"age": {"$between": [45, 65]}, "gender": "male"} ) ___SPLIT___ // Unified patient data across all medical systems class MedicalDataIntegration { async integratePatientData(patientId) { // Query across all medical record types const baseQuery = { where: { patient_id: patientId } }; const properties = await db.properties.find(baseQuery); const vitalFields = properties.data.filter(field => ["blood_pressure", "heart_rate", "temperature"].includes(field.name) ); return { // All medical records records: await db.records.find(baseQuery), // Auto-discovered record types recordTypes: await db.labels.find(baseQuery), // All medical properties medicalFields: properties, // Value ranges for medical metrics vitalRanges: await Promise.all( vitalFields.map(async field => ({ [field.name]: await db.properties.values(field.id, baseQuery) })) ), // Medical relationships careRelationships: await db.relationships.find(baseQuery) }; } async findSimilarCases(symptoms, demographics) { // Cross-system case similarity without predefined schemas const similarityQuery = { where: { ...symptoms, // Any symptom properties ...demographics, // Any demographic properties } }; return { similarPatients: await db.records.find(similarityQuery), commonPatterns: await db.relationships.find(similarityQuery), outcomeDistributions: await db.properties.values("outcome", similarityQuery) }; } } // Usage: Instant integration across any medical system const medical = new MedicalDataIntegration(); // Complete patient view from all systems const patientData = await medical.integratePatientData("PAT-12345"); // Find similar cases for treatment planning const similarCases = await medical.findSimilarCases( {chest_pain: true, shortness_of_breath: true}, {age: {$between: [45, 65]}, gender: "male"} ); ``` **Result**: Unified patient views and intelligent case matching across any medical system without manual integration work. These examples demonstrate how LMPG's unified query interface eliminates the complexity barrier that typically prevents sophisticated data applications. Developers can now build AI-driven research tools, zero-code filtering interfaces, real-time analytics, and cross-system integrations using the same simple JSON query structure, enabling unprecedented innovation across all domains. ## Migration and Integration Strategies ### From Relational Databases **Before (SQL):** ```sql SELECT p.name, p.price, c.name as category FROM products p JOIN categories c ON p.category_id = c.id JOIN product_attributes pa ON p.id = pa.product_id JOIN attributes a ON pa.attribute_id = a.id WHERE p.price > 100 AND a.name = 'color' AND pa.value = 'red'; ``` **After (LMPG):** ```javascript const results = await rushdb.records.find({ labels: ['Product'], where: { price: { $gt: 100 }, color: 'red' } }); ``` ### From Document Databases **Before (MongoDB):** ```javascript db.products.aggregate([ { $match: { price: { $gt: 100 } } }, { $lookup: { from: "categories", localField: "categoryId", foreignField: "_id", as: "category" }}, { $unwind: "$category" }, { $match: { "attributes.color": "red" } } ]); ``` **After (LMPG):** ```javascript // Same query as above - LMPG handles relationships automatically const results = await rushdb.records.find({ where: { price: { $gt: 100 }, color: 'red' } }); ``` ## Future of LMPG Architecture The Labeled Meta Property Graph represents a fundamental shift toward **property-centric data modeling**. As data becomes increasingly interconnected and diverse, LMPG's ability to: 1. **Automatically discover relationships** through shared properties 2. **Adapt to evolving schemas** without migration overhead 3. **Enable cross-domain insights** through property traversal 4. **Simplify complex queries** with intuitive JSON syntax 5. **Integrate vector operations** for AI-powered applications 6. **Provide unified query interface** across all data perspectives 7. **Self-optimize through property-based indexing** for massive scale ...makes it the ideal architecture for the next generation of data-intensive applications. ### The Self-Aware Database Revolution LMPG introduces the concept of **database self-awareness** where: ```mermaid graph TB subgraph "Traditional Database" T1[Static Schema] --> T2[Manual Optimization] T2 --> T3[Query Planning] T3 --> T4[Execution] end subgraph "Self-Aware LMPG Database" S1[Dynamic Property Discovery] --> S2[Automatic Index Creation] S2 --> S3[Pattern Recognition] S3 --> S4[Query Optimization] S4 --> S5[Performance Adaptation] S5 --> S1 end T4 --> TR[Static Performance] S5 --> SR[Adaptive Performance] ``` **Key Self-Awareness Features:** - **Automatic schema evolution** without downtime - **Dynamic query optimization** based on data patterns - **Property relationship inference** through usage analysis - **Performance self-tuning** based on access patterns - **Cross-domain insight generation** through property overlap discovery ### Emerging Applications **1. AI-Native Data Architecture:** - Vector embeddings as first-class properties - Semantic search integrated with structured queries - LLM-generated property relationships - Automated data pipeline optimization **2. Real-Time Analytics at Scale:** - Stream processing with property-based filtering - Event correlation through shared properties - Dynamic aggregation without pre-computation - Sub-second response times on billion-record datasets **3. Knowledge Graph Evolution:** - Automatic ontology generation from data patterns - Cross-domain knowledge discovery - Semantic relationship inference - Dynamic concept emergence ### Industry Transformation Potential LMPG is positioned to transform how organizations handle data complexity: - **Financial Services**: Real-time risk assessment across interconnected portfolios - **Healthcare**: Patient data integration across disparate systems - **Manufacturing**: IoT sensor correlation for predictive maintenance - **Retail**: Customer behavior analysis across all touchpoints - **Research**: Scientific data integration and hypothesis generation ## Getting Started with LMPG ### Quick Setup ```bash # Install RushDB SDK npm install @rushdb/javascript-sdk # Or use Python pip install rushdb ``` ### First LMPG Implementation ```sdk # Push any JSON - LMPG structure is created automatically from rushdb import RushDB db = RushDB('your-api-key') customer_data = db.records.create_many({ "label": "Customer", "data": [ { "name": "Alice Johnson", "email": "alice@example.com", "preferences": { "color": "blue", "priceRange": "premium" }, "orders": [ {"product": "Laptop", "amount": 1299}, {"product": "Mouse", "amount": 79} ] } ] }) # Query across all automatically-created relationships premium_customers = db.records.find({ "labels": ["Customer"], "where": { "preferences": { "priceRange": "premium", }, "orders": { "amount": {"$gt": 1000} } } }) ___SPLIT___ // Push any JSON - LMPG structure is created automatically import RushDB from '@rushdb/javascript-sdk'; const db = new RushDB('your-api-key'); const customerData = await db.records.createMany({ label: "Customer", data: [ { name: "Alice Johnson", email: "alice@example.com", preferences: { color: "blue", priceRange: "premium" }, orders: [ { product: "Laptop", amount: 1299 }, { product: "Mouse", amount: 79 } ] } ] }); // Query across all automatically-created relationships const premiumCustomers = await db.records.find({ labels: ["Customer"], where: { preferences: { priceRange: "premium", }, orders: { amount: { $gt: 1000 } } } }); ``` ## Conclusion RushDB's Labeled Meta Property Graph architecture represents a paradigm shift in database design. By making properties first-class citizens, LMPG enables: - **Zero-configuration data modeling** with automatic schema inference - **Automatic relationship discovery** through property overlap analysis - **Cross-domain query capabilities** with unified interface - **Simplified development workflows** using intuitive JSON syntax - **AI-ready data structures** with native vector support - **Database self-awareness** through dynamic property indexing - **Perforating query performance** that skips expensive operations - **Multi-perspective data access** from single query interface ### The Database of Tomorrow The future of databases is not about forcing data into predefined structures, but about letting the data define its own relationships while providing intelligent optimization. LMPG makes this vision a reality, enabling developers to focus on building features rather than fighting with database schemas. As applications become increasingly complex and data sources multiply, LMPG's property-centric approach will become the standard for managing interconnected data at scale. The question isn't whether to adopt this architecture – it's how quickly you can start leveraging its power for your applications. **Key Takeaways:** - **Single DTO, infinite perspectives**: One query interface for all data aspects - **Properties as dynamic indices**: Self-optimizing performance without manual tuning - **Database self-awareness**: Automatic adaptation to data patterns and usage - **Perforating query architecture**: Skip expensive operations for consistent performance - **Cross-domain insights**: Discover relationships across unrelated data domains --- ## Knowledge Graphs: Semantic Reasoning Meets Graph Architecture Canonical URL: https://rushdb.com/blog/knowledge-graphs-semantic-reasoning-meets-graph-architecture Published: 2025-07-07T05:21:38.001Z Updated: 2025-07-09T05:36:29.065Z # Knowledge Graphs: Semantic Reasoning Meets Graph Architecture ## Introduction Knowledge Graphs (KGs) represent the synthesis of formal semantics, graph data modeling, and AI-driven reasoning. Evolving from Semantic Web standards like RDF and OWL, knowledge graphs have matured into a core infrastructure layer for intelligent applications across enterprises. Unlike Labeled Property Graphs, which emphasize flexible schema and performant traversal, Knowledge Graphs prioritize meaning, consistency, and inference. They treat data as *knowledge*, not just structured entities, linking facts with context, provenance, and uncertainty. This makes KGs uniquely suited for domains where *understanding*, *disambiguation*, and *reasoning* are as important as performance—like natural language processing, biomedical research, enterprise knowledge management, and explainable AI. --- ## Core Components of a Knowledge Graph ### 1. **Entities (Nodes)** * Represent **real-world objects**: people, places, events, concepts * Identified via **URIs** or **canonical IDs** * Categorized using ontologies (e.g., `Person`, `Organization`, `Product`) * May include **labels**, **descriptions**, and **confidence scores** ### 2. **Relationships (Edges)** * Semantic predicates (e.g., `worksFor`, `memberOf`, `locatedIn`) * Directed, often enriched with metadata like **confidence**, **source**, **timestamp** * Defined in terms of ontological **domain** and **range** ### 3. **Ontology / Schema Layer** * Built using **RDFS** and **OWL** * Provides class hierarchies, constraints, and inference rules * Enables automatic classification (e.g., inferring `Manager ⊆ Employee`) ### 4. **Named Graphs / Contexts** * Used to group triples by **source**, **time**, or **assertion context** * Essential for provenance, versioning, and trust --- ## Knowledge Graph vs. Labeled Property Graph | Feature | Knowledge Graph (KG) | Labeled Property Graph (LPG) | | ------------------------- | ------------------------- | ----------------------------------- | | **Data Model** | RDF Triples + Ontology | Nodes + Edges + Labels + Properties | | **Schema** | Formal (OWL/RDFS) | Optional, label-driven | | **Inference** | Yes (RDFS/OWL reasoning) | No built-in reasoning | | **Query Language** | SPARQL | Cypher, GQL, Gremlin | | **Interoperability** | High (W3C standards) | Vendor-specific | | **Use Case Focus** | Semantics, disambiguation | Structure, performance | | **Constraint Validation** | SHACL, OWL axioms | Schema constraints, Cypher rules | | **Graph Composition** | Named graphs, Linked Data | Flat graph model | --- ## Advanced Data Modeling in KGs ```turtle @prefix ex: . @prefix rdf: . @prefix foaf: . @prefix schema: . ex:alice_j a schema:Person ; schema:name "Alice Johnson" ; schema:memberOf ex:techcorp ; schema:jobTitle "Senior Developer" ; schema:skills "Graph Databases" . ex:techcorp a schema:Organization ; schema:name "TechCorp Inc." ; schema:location "San Francisco" . ``` This model semantically asserts that: * Alice is a Person and a member of TechCorp * Her job title is explicitly typed * All predicates are semantically grounded (not just keys) --- ## Reasoning Capabilities KGs support **automatic inference** using ontologies: ```rdf :Manager rdfs:subClassOf :Employee . :alice a :Manager . ``` A reasoner will automatically classify Alice as an `:Employee`—a behavior impossible in LPG without custom logic. They also support **property chains**, **inverse relationships**, and **transitive closure**: ```owl :supervises owl:inverseOf :reportsTo . :locatedIn owl:TransitiveProperty . ``` --- ## Querying Knowledge Graphs (SPARQL) ```sparql # Find senior employees working for TechCorp with high-confidence triples SELECT ?name ?title ?confidence WHERE { ?person a schema:Person ; schema:name ?name ; schema:jobTitle ?title ; schema:memberOf ex:techcorp . GRAPH ?g { ?person schema:memberOf ex:techcorp . } ?g ex:confidence ?confidence . FILTER(?confidence > 0.9) } ``` SPARQL supports querying across **named graphs**, filtering by **semantic type**, and joining by **ontology constraints**. --- ## Practical Use Cases ### 1. **Enterprise Knowledge Management** * Consolidate data silos from CRM, HR, CMS, and internal wikis * Enable contextual answers and traceable knowledge sources ### 2. **AI/ML Feature Enrichment** * Provide **graph-derived features**: hierarchy depth, semantic similarity * Enhance **recommendation**, **classification**, **link prediction** ### 3. **Biomedical Discovery** * Integrate literature, genomic data, drug ontologies (e.g., Bio2RDF) * Enable inference of protein–disease relationships ### 4. **Financial Compliance** * Model beneficial ownership, regulatory rules * Trace hidden risks across legal entities --- ## Mermaid Diagram ```mermaid graph TD subgraph "Knowledge Graph" A["👤 Alice Johnson schema:Person jobTitle: Senior Developer"] B["🏢 TechCorp Inc. schema:Organization location: San Francisco"] end A -->|"schema:memberOf confidence: 0.98 source: HR System"| B ``` --- ## Schema Constraints with SHACL ```turtle ex:EmployeeShape a sh:NodeShape ; sh:targetClass schema:Person ; sh:property [ sh:path schema:email ; sh:datatype xsd:string ; sh:pattern "^.+@.+\\..+$" ; sh:message "Must be a valid email." ; ] ; sh:property [ sh:path schema:memberOf ; sh:class schema:Organization ; ] . ``` This validates that all persons have valid emails and are linked to an organization. --- ## Performance Optimization Strategies ### 1. **Materialized Inferences** Precompute subclass/inverse relations to avoid runtime reasoning. ### 2. **Named Graph Partitioning** Split by source, domain, or access control: * `/graphs/hr/` * `/graphs/corp-registry/` * `/graphs/user/ingested/` ### 3. **Hybrid Indexing** Combine triple stores with full-text indexes (e.g., via Apache Lucene or Elasticsearch). --- ## Migration Strategies ### From Relational Databases 1. **Tables → Entities**: Convert rows to nodes 2. **Foreign Keys → Triples**: Transform FK constraints to RDF predicates 3. **ER Schema → OWL Ontology**: Translate DB schema to formal vocabulary ### From Property Graphs 1. **Extract Labels → RDF Types**: Map LPG labels to RDF `rdf:type` 2. **Flatten Properties**: Represent LPG node props as RDF triples 3. **Custom URIs**: Create canonical entity identifiers --- ## Advanced SPARQL Queries ### 1. Semantic Entity Resolution ```sparql SELECT ?entity ?label WHERE { ?entity schema:name ?label . FILTER (CONTAINS(LCASE(?label), "alice johnson")) } ``` ### 2. Transitive Location Reasoning ```sparql # Get all entities located within USA via transitive closure SELECT ?entity WHERE { ?entity schema:location+ ex:USA . } ``` ### 3. Concept Hierarchy Query ```sparql # Retrieve all subtypes of Employee SELECT ?subClass WHERE { ?subClass rdfs:subClassOf* ex:Employee . } ``` --- ## Industry Adoption * **Google Knowledge Graph**: Enhances search with entity disambiguation * **Amazon Product Graph**: Powers search and recommendations * **Siemens & GE**: Use KGs for equipment diagnostics and digital twins * **Thomson Reuters**: Semantic enrichment of financial documents * **Roche & Novartis**: Biomedical research over KGs --- ## Limitations and Challenges * **Steep Learning Curve**: Requires ontology engineering expertise * **Tooling Maturity**: SPARQL and OWL reasoners have varied performance * **Impedance Mismatch**: Mapping tabular or nested JSON data is non-trivial * **Real-time Inference**: Reasoning over large graphs can be costly --- ## Future Trends ### 1. **Neuro-Symbolic Systems** * Combine deep learning with KG reasoning * e.g., language models fine-tuned on graph-derived knowledge ### 2. **Federated Knowledge Graphs** * Query across multiple distributed RDF sources via SPARQL 1.1 ### 3. **Graph Embeddings & GNNs** * Use KGs as input for **knowledge graph embeddings** (e.g., TransE) * Support **Graph Neural Networks** over RDF graphs ### 4. **KG Construction from LLMs** * Extract structured triples from raw text * Auto-suggest schema via ontology learning --- ## Conclusion Knowledge Graphs elevate data to **context-aware knowledge**, supporting richer inference, disambiguation, and semantic integration. While their formalism adds complexity, the value they unlock in AI, analytics, and decision support justifies the investment. For applications requiring *explainability*, *integration of diverse data*, or *semantic interoperability*, KGs are irreplaceable. The synergy of graph structure and ontological semantics offers a durable foundation for intelligent systems in the AI era. --- ## Labeled Property Graphs: A Comprehensive Guide to Enhanced Graph Data Modeling Canonical URL: https://rushdb.com/blog/labeled-property-graphs-a-comprehensive-guide-to-enhanced-graph-data-modeling Published: 2025-07-07T05:20:11.438Z Updated: 2025-07-08T03:40:57.637Z # Labeled Property Graphs: A Comprehensive Guide to Enhanced Graph Data Modeling ## Introduction Labeled Property Graphs (LPGs) represent a significant evolution in graph database technology, building upon the foundation of traditional property graphs by introducing explicit type labels for both nodes and relationships. This enhancement transforms how we model, query, and understand complex data relationships, making LPGs an essential tool for modern data-driven applications. Unlike traditional property graphs that rely solely on properties to distinguish entity types, LPGs provide explicit typing through labels, creating a more structured and performant data model. This approach bridges the gap between the flexibility of property graphs and the structured nature of relational databases, offering the best of both worlds for complex data modeling scenarios. ## Understanding Labeled Property Graphs ### Core Components **1. Nodes (Vertices)** - **Labels**: Explicit type identifiers (e.g., `:Person`, `:Employee`, `:Company`) - **Properties**: Key-value pairs storing attributes - **Multiple Labels**: A single node can have multiple labels for inheritance-like behavior **2. Relationships (Edges)** - **Type Labels**: Explicit relationship types (e.g., `:WORKS_FOR`, `:MANAGES`, `:ASSIGNED_TO`) - **Properties**: Metadata about the relationship itself - **Directionality**: Relationships have explicit direction **3. Properties** - **Flexible Schema**: Properties can be added dynamically - **Multiple Data Types**: Support for strings, numbers, dates, arrays, and more - **Indexable**: Properties can be indexed for performance optimization ### Key Differences from Traditional Property Graphs | Aspect | Traditional Property Graphs | Labeled Property Graphs | |--------|---------------------------|-------------------------| | **Node Typing** | Implicit through properties | Explicit through labels | | **Schema Enforcement** | Minimal | Optional but robust | | **Query Performance** | Property-based filtering | Label-based optimization | | **Type Safety** | Runtime validation | Compile-time + runtime validation | | **Indexing Strategy** | Property-based only | Label + property combinations | ## Advantages of Labeled Property Graphs ### 1. Enhanced Schema Clarity and Documentation Labels serve as self-documenting schema elements, making data models immediately understandable. Consider the difference: **Traditional Property Graph:** ``` {id: 123, name: "Alice", type: "employee", role: "engineer"} ``` **Labeled Property Graph:** ``` (:Person :Employee {id: 123, name: "Alice", role: "engineer"}) ``` The LPG approach clearly indicates that Alice is both a Person and an Employee, establishing a clear type hierarchy that's immediately visible in the data structure. ### 2. Superior Query Performance Labels enable database engines to optimize queries by: - **Index Partitioning**: Separate indexes for different node types - **Query Planning**: Better execution plan generation - **Filtering Efficiency**: Early elimination of non-matching nodes Performance comparison example: ```cypher // Less efficient (traditional) MATCH (n) WHERE n.type = 'employee' AND n.department = 'Engineering' // More efficient (LPG) MATCH (n:Employee) WHERE n.department = 'Engineering' ``` ### 3. Type Safety and Validation LPGs support optional schema constraints that enforce data integrity: ```cypher // Create constraint ensuring Employee nodes have required properties CREATE CONSTRAINT employee_id FOR (e:Employee) REQUIRE e.id IS NOT NULL CREATE CONSTRAINT employee_email FOR (e:Employee) REQUIRE e.email IS UNIQUE ``` ### 4. Advanced Modeling Capabilities **Multiple Label Inheritance:** ```cypher // A node can be both Manager and Employee CREATE (alice:Person:Employee:Manager {name: "Alice", team_size: 8}) ``` **Relationship Type Specificity:** ```cypher // Different relationship types for different contexts (emp:Employee)-[:REPORTS_TO]->(mgr:Manager) (emp:Employee)-[:ASSIGNED_TO]->(proj:Project) (emp:Employee)-[:BELONGS_TO]->(dept:Department) ``` ## Disadvantages and Limitations ### 1. Increased Complexity LPGs require more careful schema design and planning: - **Label Strategy**: Deciding on appropriate labeling hierarchies - **Relationship Modeling**: Choosing between relationship types vs. properties - **Schema Evolution**: Managing changes to labels and constraints over time ### 2. Limited Semantic Reasoning Unlike RDF and knowledge graphs, LPGs don't provide: - **Inference Capabilities**: No automatic reasoning about relationships - **Ontology Support**: Limited support for formal knowledge representation - **Standards Compliance**: No standardized query language across all implementations ### 3. Learning Curve Teams transitioning from relational databases face: - **Mindset Shift**: Thinking in graphs rather than tables - **Query Language**: Learning Cypher or similar graph query languages - **Performance Tuning**: Understanding graph-specific optimization techniques ## Real-World Data Modeling Examples ### Enterprise Human Resources System ```json { "employees": [ { "id": "emp_001", "name": "Alice Johnson", "email": "alice.johnson@techcorp.com", "department": "Engineering", "role": "Senior Software Engineer", "salary_grade": "L6", "hire_date": "2021-03-15", "skills": ["Java", "Python", "Kubernetes", "AWS"] }, { "id": "emp_002", "name": "Bob Smith", "email": "bob.smith@techcorp.com", "department": "Engineering", "role": "Engineering Manager", "salary_grade": "M3", "hire_date": "2019-07-22", "direct_reports": 8 }, { "id": "emp_003", "name": "Carol Davis", "email": "carol.davis@techcorp.com", "department": "Product", "role": "Product Manager", "salary_grade": "L7", "hire_date": "2020-11-10", "certifications": ["PMP", "Scrum Master"] } ], "companies": [ { "id": "comp_123", "name": "TechCorp", "industry": "Software Development", "founded": 2010, "employees_count": 1250, "annual_revenue": 150000000, "headquarters": "San Francisco, CA" } ], "projects": [ { "id": "proj_456", "name": "API Gateway Redesign", "status": "active", "budget": 500000, "priority": "high", "start_date": "2024-01-15", "expected_completion": "2024-12-31" }, { "id": "proj_789", "name": "Data Pipeline Optimization", "status": "planning", "budget": 300000, "priority": "medium", "start_date": "2024-09-01", "expected_completion": "2025-03-31" } ], "departments": [ { "id": "dept_eng", "name": "Engineering", "budget": 5000000, "employee_count": 45, "location": "Building A, Floor 3", "head": "emp_002" }, { "id": "dept_prod", "name": "Product", "budget": 2000000, "employee_count": 12, "location": "Building B, Floor 2", "head": "emp_003" } ] } ``` ## Diagram ```mermaid graph TD %% Companies comp_123["🏢 TechCorp (Software Development)"] %% Departments dept_eng["🛠️ Department: Engineering"] dept_prod["📦 Department: Product"] %% Department heads emp_002["👨‍💼 Bob Smith | Engineering Manager"] emp_003["👩‍💼 Carol Davis | Product Manager"] %% Other employees emp_001["👩‍💻 Alice Johnson | Senior Software Engineer"] %% Projects proj_456["🚀 API Gateway Redesign (status: active)"] proj_789["📊 Data Pipeline Optimization (status: planning)"] %% Structure comp_123 -->|HAS_DEPARTMENT| dept_eng comp_123 -->|HAS_DEPARTMENT| dept_prod dept_eng -->|MANAGED_BY| emp_002 dept_prod -->|MANAGED_BY| emp_003 dept_eng -->|HAS_MEMBER| emp_001 dept_eng -->|HAS_MEMBER| emp_002 dept_prod -->|HAS_MEMBER| emp_003 %% Skills (shown as properties in tooltips, not rendered as nodes) emp_001 -->|WORKS_ON| proj_456 emp_003 -->|WORKS_ON| proj_789 %% Labels for context (optional) ``` ## Advanced Query Examples ### 1. Hierarchical Queries ```cypher // Find all employees and their management chain MATCH path = (emp:Employee)-[:REPORTS_TO*]->(topManager:Employee:Manager) WHERE NOT (topManager)-[:REPORTS_TO]->() RETURN emp.name, [node in nodes(path) | node.name] AS management_chain ``` ### 2. Resource Allocation Analysis ```cypher // Find over-allocated employees (>100% project allocation) MATCH (emp:Employee)-[r:ASSIGNED_TO]->(proj:Project) WITH emp, sum(r.allocation) AS total_allocation WHERE total_allocation > 1.0 RETURN emp.name, emp.department, total_allocation ORDER BY total_allocation DESC ``` ### 3. Cross-Department Collaboration ```cypher // Find projects with team members from multiple departments MATCH (proj:Project)<-[:ASSIGNED_TO]-(emp:Employee)-[:BELONGS_TO]->(dept:Department) WITH proj, collect(DISTINCT dept.name) AS departments WHERE size(departments) > 1 RETURN proj.name, departments, proj.budget ``` ### 4. Skill Gap Analysis ```cypher // Find departments lacking specific skills MATCH (dept:Department)<-[:BELONGS_TO]-(emp:Employee) WHERE dept.name = 'Engineering' WITH dept, collect(emp.skills) AS all_skills WITH dept, reduce(skills = [], skill_list IN all_skills | skills + skill_list) AS flattened_skills WITH dept, apoc.coll.toSet(flattened_skills) AS unique_skills WHERE NOT 'Kubernetes' IN unique_skills RETURN dept.name, unique_skills ``` ## Performance Optimization Strategies ### 1. Index Design ```cypher // Create composite indexes for common query patterns CREATE INDEX employee_dept_role FOR (e:Employee) ON (e.department, e.role) CREATE INDEX project_status_priority FOR (p:Project) ON (p.status, p.priority) ``` ### 2. Query Optimization ```cypher // Use label-specific queries for better performance // Good: Label-first approach MATCH (emp:Employee {department: 'Engineering'}) WHERE emp.salary_grade STARTS WITH 'L' // Avoid: Property-first approach MATCH (n) WHERE n.type = 'employee' AND n.department = 'Engineering' ``` ### 3. Relationship Direction ```cypher // Leverage relationship direction for efficiency // More efficient: Follow natural direction MATCH (emp:Employee)-[:WORKS_FOR]->(company:Company) // Less efficient: Against natural direction MATCH (company:Company)<-[:WORKS_FOR]-(emp:Employee) ``` ## Industry Applications and Use Cases ### 1. Healthcare Systems - **Patient Care Networks**: Model patient-doctor relationships, treatment histories, and care team collaboration - **Medical Knowledge Graphs**: Connect symptoms, diseases, treatments, and outcomes - **Resource Management**: Track equipment, room allocation, and staff scheduling ### 2. Financial Services - **Fraud Detection**: Analyze transaction patterns and suspicious relationship networks - **Risk Assessment**: Model counterparty relationships and exposure chains - **Regulatory Compliance**: Track transaction flows and reporting requirements ### 3. Telecommunications - **Network Topology**: Model physical and logical network infrastructure - **Service Dependencies**: Track service relationships and failure propagation - **Customer Journey**: Analyze customer interaction patterns and service usage ### 4. E-commerce and Retail - **Product Recommendations**: Model user preferences and product relationships - **Supply Chain**: Track product flows from suppliers to customers - **Customer Segmentation**: Analyze purchasing patterns and customer relationships ### 5. Social Networks and Content Platforms - **User Relationships**: Model friendships, follows, and social interactions - **Content Recommendation**: Connect users with relevant content and creators - **Influence Analysis**: Track information propagation and influence networks ## Schema Design Best Practices ### 1. Label Hierarchy Planning ```cypher // Good: Clear hierarchy with meaningful labels (:Person :Employee :Manager) (:Person :Employee :Developer) (:Person :Customer :Individual) (:Organization :Company :Startup) // Avoid: Overly complex or ambiguous labels (:Entity :Thing :Object :Employee) ``` ### 2. Relationship Naming Conventions ```cypher // Use clear, action-oriented relationship names (:Employee)-[:REPORTS_TO]->(:Manager) (:Employee)-[:ASSIGNED_TO]->(:Project) (:Company)-[:EMPLOYS]->(:Employee) // Avoid ambiguous relationship names (:Employee)-[:RELATED_TO]->(:Manager) (:Employee)-[:HAS]->(:Project) ``` ### 3. Property Organization ```cypher // Group related properties logically // Contact Information CREATE (person:Person { name: "John Doe", email: "john.doe@company.com", phone: "+1-555-0123" }) // Professional Information CREATE (employee:Employee { id: "emp_001", role: "Senior Developer", department: "Engineering", hire_date: date("2020-01-15") }) ``` ## Migration Strategies ### From Relational Databases 1. **Identify Entities**: Convert tables to node labels 2. **Map Relationships**: Transform foreign keys to graph relationships 3. **Preserve Constraints**: Implement validation rules as graph constraints 4. **Optimize Queries**: Rewrite JOIN operations as graph traversals ### From Document Databases 1. **Extract Entities**: Convert nested documents to separate nodes 2. **Normalize References**: Replace embedded documents with relationships 3. **Preserve Flexibility**: Maintain schema-less properties where appropriate 4. **Optimize Access Patterns**: Design traversal paths for common queries ## Future Developments and Trends ### 1. Graph ML Integration - **Embeddings**: Generate node and relationship embeddings for ML models - **GNN Support**: Native support for Graph Neural Networks - **Automated Feature Engineering**: Extract graph features for predictive models ### 2. Multi-Modal Graphs - **Heterogeneous Data**: Combine structured and unstructured data in single graphs - **Temporal Modeling**: Advanced time-series and temporal relationship support - **Geospatial Integration**: Native support for location-based relationships ### 3. Standardization Efforts - **ISO/IEC 39075**: SQL/PGQ standard for property graph queries - **OpenCypher**: Open standard for graph query languages - **GQL**: Graph Query Language standardization ## Conclusion Labeled Property Graphs represent a mature and powerful approach to graph data modeling, offering significant advantages in schema clarity, performance, and type safety compared to traditional property graphs. While they introduce additional complexity and require careful design considerations, the benefits typically outweigh the costs for complex, relationship-rich data scenarios. The key to successful LPG implementation lies in thoughtful schema design, understanding the specific query patterns of your application, and leveraging the performance optimizations that labels enable. As graph databases continue to evolve, LPGs provide a solid foundation for building scalable, maintainable, and performant graph-based applications. Organizations considering LPGs should evaluate their specific use cases, existing data models, and performance requirements to determine if the enhanced capabilities justify the additional complexity. With proper planning and implementation, LPGs can transform how organizations understand and leverage their complex data relationships, enabling more sophisticated analytics and insights than traditional data modeling approaches allow. --- ## RDF: A Comprehensive Guide to Semantic Web Data Modeling Canonical URL: https://rushdb.com/blog/rdf-a-comprehensive-guide-to-semantic-web-data-modeling Published: 2025-07-07T05:19:01.163Z Updated: 2025-07-07T15:42:51.816Z # RDF: A Comprehensive Guide to Semantic Web Data Modeling ## Introduction Resource Description Framework (RDF) represents a fundamental paradigm shift in how we model and represent knowledge on the web. As the cornerstone of the Semantic Web, RDF provides a standardized method for describing resources and their relationships in a way that is both machine-readable and semantically rich. Unlike traditional data models that focus on storage and retrieval efficiency, RDF prioritizes meaning, interoperability, and automated reasoning. Developed by the World Wide Web Consortium (W3C) as a standard for data interchange on the web, RDF transforms the web from a collection of documents into a vast, interconnected knowledge graph. This approach enables machines to understand and process information contextually, opening possibilities for advanced applications in artificial intelligence, data integration, and knowledge discovery. ## Understanding RDF ### Core Components **1. Subject-Predicate-Object Triples** - **Subject**: The resource being described (URI or blank node) - **Predicate**: The property or relationship (URI) - **Object**: The value or another resource (URI, literal, or blank node) **2. URIs (Uniform Resource Identifiers)** - **Global Identification**: Every resource has a unique, globally accessible identifier - **Namespace Management**: Organized through namespace prefixes - **Dereferenceable**: URIs can be resolved to provide more information **3. Literals** - **Typed Data**: Values with specific datatypes (string, integer, date, etc.) - **Language Tags**: Support for multilingual content - **Custom Datatypes**: Extensible type system **4. Blank Nodes** - **Anonymous Resources**: Resources without explicit URIs - **Structural Elements**: Used for complex value structures - **Temporary Identifiers**: Local scope within a graph ### RDF Data Model Structure | Component | Example | Description | |-----------|---------|-------------| | **Subject** | `` | The resource being described | | **Predicate** | `` | The property or relationship | | **Object** | `"Alice Johnson"` | The value or related resource | | **Complete Triple** | ` "Alice Johnson"` | Complete statement | ## Advantages of RDF ### 1. Universal Interoperability RDF's standardized approach enables seamless data integration across different systems and organizations: ```turtle # Organization A's data @prefix ex: . @prefix foaf: . ex:alice foaf:name "Alice Johnson" ; foaf:email "alice@company.com" . # Organization B's data (automatically compatible) ex:alice foaf:knows ex:bob ; ex:position "Senior Engineer" . ``` ### 2. Semantic Richness and Reasoning RDF enables sophisticated reasoning through formal semantics: ```turtle # Define relationships ex:alice a ex:Employee ; ex:worksFor ex:TechCorp . ex:Employee rdfs:subClassOf ex:Person . # Automatic inference: alice is a Person # Reasoning engine can derive: ex:alice a ex:Person ``` ### 3. Schema Flexibility and Evolution RDF supports dynamic schema evolution without breaking existing data: ```turtle # Original schema ex:Person a rdfs:Class . ex:name a rdf:Property ; rdfs:domain ex:Person . # Later extension (non-breaking) ex:Employee rdfs:subClassOf ex:Person . ex:salary a rdf:Property ; rdfs:domain ex:Employee . ``` ### 4. Linked Data Capabilities RDF enables the creation of interconnected knowledge graphs: ```turtle # Internal data ex:alice ex:worksFor ex:TechCorp . # Links to external data ex:TechCorp owl:sameAs . ex:alice foaf:knows . ``` ### 5. Multilingual Support Native support for multiple languages: ```turtle ex:alice foaf:name "Alice Johnson"@en ; foaf:name "Alice Johnson"@fr ; foaf:name "アリス・ジョンソン"@ja . ``` ## Disadvantages and Limitations ### 1. Complexity and Learning Curve RDF introduces significant conceptual complexity: - **Triple Thinking**: Requires fundamental shift from tabular to graph thinking - **URI Management**: Complex namespace and identifier management - **Query Language**: SPARQL has steeper learning curve than SQL - **Reasoning Overhead**: Understanding inference rules and their implications ### 2. Performance Challenges RDF databases face inherent performance limitations: - **Triple Store Overhead**: Each fact requires minimum three storage elements - **Join-Heavy Queries**: Complex queries require multiple triple pattern joins - **Indexing Complexity**: Multiple index strategies needed for different access patterns - **Reasoning Cost**: Inference can be computationally expensive ### 3. Tooling and Ecosystem Maturity Compared to relational databases, RDF has: - **Limited Tooling**: Fewer mature development and administration tools - **Smaller Community**: Less widespread adoption and community support - **Integration Challenges**: More complex integration with existing systems - **Debugging Difficulty**: Harder to debug and troubleshoot issues ### 4. Data Quality and Consistency Open World Assumption creates challenges: - **Incomplete Data**: Missing information is assumed unknown, not false - **Inconsistency Detection**: Harder to identify and resolve data conflicts - **Validation Complexity**: Schema validation more complex than traditional approaches ## RDF Serialization Formats ### 1. Turtle (Terse RDF Triple Language) ```turtle @prefix ex: . @prefix foaf: . ex:alice a foaf:Person ; foaf:name "Alice Johnson" ; foaf:age 30 ; foaf:knows ex:bob . ``` ### 2. RDF/XML ```xml Alice Johnson 30 ``` ### 3. JSON-LD ```json { "@context": { "foaf": "http://xmlns.com/foaf/0.1/", "ex": "http://example.org/" }, "@id": "ex:alice", "@type": "foaf:Person", "foaf:name": "Alice Johnson", "foaf:age": 30 } ``` ### 4. N-Triples ``` . "Alice Johnson" . "30"^^ . ``` ## Real-World Data Modeling Example ### Enterprise Knowledge Graph ```turtle @prefix ex: . @prefix foaf: . @prefix org: . @prefix time: . @prefix schema: . @prefix dc: . # Company ex:TechCorp a org:Organization, schema:Corporation ; foaf:name "TechCorp" ; org:hasUnit ex:EngineeringDept, ex:ProductDept ; schema:foundingDate "2010-01-01"^^xsd:date ; schema:numberOfEmployees 1250 ; schema:address ex:SFAddress . # Departments ex:EngineeringDept a org:OrganizationalUnit ; foaf:name "Engineering" ; org:hasHeadquarters ex:BuildingA ; org:headOf ex:bob . ex:ProductDept a org:OrganizationalUnit ; foaf:name "Product" ; org:hasHeadquarters ex:BuildingB ; org:headOf ex:carol . # Employees ex:alice a foaf:Person, ex:Employee, ex:SoftwareEngineer ; foaf:name "Alice Johnson" ; foaf:mbox ; ex:employeeId "emp_001" ; ex:hireDate "2021-03-15"^^xsd:date ; ex:salaryGrade "L6" ; org:memberOf ex:EngineeringDept ; ex:hasSkill ex:JavaSkill, ex:PythonSkill, ex:KubernetesSkill . ex:bob a foaf:Person, ex:Employee, ex:Manager ; foaf:name "Bob Smith" ; foaf:mbox ; ex:employeeId "emp_002" ; ex:hireDate "2019-07-22"^^xsd:date ; ex:salaryGrade "M3" ; org:memberOf ex:EngineeringDept ; org:headOf ex:EngineeringDept ; ex:manages ex:alice . ex:carol a foaf:Person, ex:Employee, ex:ProductManager ; foaf:name "Carol Davis" ; foaf:mbox ; ex:employeeId "emp_003" ; ex:hireDate "2020-11-10"^^xsd:date ; ex:salaryGrade "L7" ; org:memberOf ex:ProductDept ; org:headOf ex:ProductDept ; ex:hasCertification ex:PMPCertification, ex:ScrumMasterCertification . # Projects ex:APIGatewayProject a ex:Project ; dc:title "API Gateway Redesign" ; ex:status "active" ; ex:budget 500000 ; ex:priority "high" ; ex:startDate "2024-01-15"^^xsd:date ; ex:expectedCompletion "2024-12-31"^^xsd:date ; ex:assignedTo ex:alice . ex:DataPipelineProject a ex:Project ; dc:title "Data Pipeline Optimization" ; ex:status "planning" ; ex:budget 300000 ; ex:priority "medium" ; ex:startDate "2024-09-01"^^xsd:date ; ex:expectedCompletion "2025-03-31"^^xsd:date ; ex:assignedTo ex:carol . # Skills and Certifications ex:JavaSkill a ex:TechnicalSkill ; foaf:name "Java" ; ex:skillLevel "Expert" . ex:PythonSkill a ex:TechnicalSkill ; foaf:name "Python" ; ex:skillLevel "Advanced" . ex:KubernetesSkill a ex:TechnicalSkill ; foaf:name "Kubernetes" ; ex:skillLevel "Intermediate" . ex:PMPCertification a ex:Certification ; foaf:name "Project Management Professional" ; ex:issuedBy "PMI" ; ex:validUntil "2025-12-31"^^xsd:date . # Locations ex:SFAddress a schema:PostalAddress ; schema:streetAddress "123 Tech Street" ; schema:addressLocality "San Francisco" ; schema:addressRegion "CA" ; schema:postalCode "94105" . # Ontology Definitions ex:Employee rdfs:subClassOf foaf:Person . ex:Manager rdfs:subClassOf ex:Employee . ex:SoftwareEngineer rdfs:subClassOf ex:Employee . ex:ProductManager rdfs:subClassOf ex:Employee . ex:manages a rdf:Property ; rdfs:domain ex:Manager ; rdfs:range ex:Employee . ex:hasSkill a rdf:Property ; rdfs:domain ex:Employee ; rdfs:range ex:Skill . ``` ## Advanced SPARQL Query Examples ### 1. Hierarchical Organization Queries ```sparql PREFIX ex: PREFIX foaf: PREFIX org: # Find all employees and their management chain SELECT ?employee ?manager ?managerName WHERE { ?employee a ex:Employee ; foaf:name ?employeeName . OPTIONAL { ?employee ex:reportsTo+ ?manager . ?manager foaf:name ?managerName . } } ORDER BY ?employeeName ``` ### 2. Skill Gap Analysis ```sparql PREFIX ex: PREFIX foaf: # Find departments lacking specific skills SELECT ?dept ?deptName (COUNT(?employee) AS ?employeeCount) WHERE { ?dept a org:OrganizationalUnit ; foaf:name ?deptName . ?employee org:memberOf ?dept . FILTER NOT EXISTS { ?employee ex:hasSkill ?skill . ?skill foaf:name "Kubernetes" . } } GROUP BY ?dept ?deptName ``` ### 3. Cross-Department Collaboration ```sparql PREFIX ex: PREFIX foaf: PREFIX org: # Find projects with team members from multiple departments SELECT ?project ?projectName (COUNT(DISTINCT ?dept) AS ?deptCount) WHERE { ?project a ex:Project ; dc:title ?projectName ; ex:assignedTo ?employee . ?employee org:memberOf ?dept . } GROUP BY ?project ?projectName HAVING (?deptCount > 1) ``` ### 4. Temporal Analysis ```sparql PREFIX ex: PREFIX foaf: PREFIX xsd: # Find employees hired in the last 3 years SELECT ?employee ?name ?hireDate WHERE { ?employee a ex:Employee ; foaf:name ?name ; ex:hireDate ?hireDate . FILTER (?hireDate >= "2021-01-01"^^xsd:date) } ORDER BY DESC(?hireDate) ``` ## RDF Schema and Ontology Design ### 1. RDFS (RDF Schema) ```turtle # Class hierarchy ex:Person a rdfs:Class . ex:Employee rdfs:subClassOf ex:Person . ex:Manager rdfs:subClassOf ex:Employee . # Property definitions ex:manages a rdf:Property ; rdfs:domain ex:Manager ; rdfs:range ex:Employee ; rdfs:label "manages" . ex:hasSkill a rdf:Property ; rdfs:domain ex:Employee ; rdfs:range ex:Skill ; rdfs:label "has skill" . ``` ### 2. OWL (Web Ontology Language) ```turtle # More expressive constraints ex:Employee a owl:Class ; owl:equivalentClass [ a owl:Restriction ; owl:onProperty ex:worksFor ; owl:someValuesFrom ex:Organization ] . # Cardinality constraints ex:hasManager a owl:ObjectProperty ; rdfs:domain ex:Employee ; rdfs:range ex:Manager ; owl:maxCardinality 1 . # Inverse relationships ex:manages owl:inverseOf ex:managedBy . ``` ### 3. SHACL (Shapes Constraint Language) ```turtle # Data validation constraints ex:EmployeeShape a sh:NodeShape ; sh:targetClass ex:Employee ; sh:property [ sh:path foaf:name ; sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string ] ; sh:property [ sh:path ex:employeeId ; sh:minCount 1 ; sh:maxCount 1 ; sh:pattern "^emp_[0-9]+$" ] . ``` ## Performance Optimization Strategies ### 1. Index Design ```sparql # Create indexes for common query patterns CREATE INDEX ON triples (subject, predicate, object); CREATE INDEX ON triples (predicate, object, subject); CREATE INDEX ON triples (object, subject, predicate); ``` ### 2. Query Optimization ```sparql # Use specific patterns first SELECT ?employee ?name WHERE { ?employee a ex:Employee . # Specific type first ?employee foaf:name ?name . # Then properties ?employee ex:department "Engineering" . # Then filters } # Avoid Cartesian products SELECT ?emp1 ?emp2 WHERE { ?emp1 a ex:Employee . ?emp2 a ex:Employee . FILTER (?emp1 != ?emp2) # Add constraints early } ``` ### 3. Data Partitioning ```turtle # Use named graphs for data organization GRAPH ex:EmployeeGraph { ex:alice a ex:Employee ; foaf:name "Alice Johnson" . } GRAPH ex:ProjectGraph { ex:project1 a ex:Project ; dc:title "API Gateway" . } ``` ## Industry Applications and Use Cases ### 1. Healthcare and Life Sciences - **Medical Knowledge Graphs**: Connect diseases, treatments, and research - **Patient Data Integration**: Unified view across healthcare systems - **Drug Discovery**: Model molecular interactions and pathways - **Clinical Trial Management**: Track patient eligibility and outcomes ### 2. Financial Services - **Regulatory Compliance**: Model complex financial regulations - **Risk Management**: Represent interconnected financial risks - **Know Your Customer (KYC)**: Integrate customer data across sources - **Market Data Integration**: Combine diverse financial data sources ### 3. Government and Public Sector - **Open Government Data**: Publish government datasets as Linked Data - **Policy Modeling**: Represent complex policy relationships - **Citizen Services**: Integrate service delivery across agencies - **Transparency Initiatives**: Enable data discovery and analysis ### 4. Media and Publishing - **Content Management**: Semantic content organization and discovery - **Rights Management**: Track intellectual property and licensing - **Personalization**: Model user preferences and content relationships - **Archive Integration**: Connect historical and modern content ### 5. Research and Academia - **Scientific Literature**: Model research papers and citations - **Collaboration Networks**: Track researcher collaborations - **Grant Management**: Connect funding, projects, and outcomes - **Institutional Knowledge**: Preserve and share institutional memory ## Best Practices for RDF Implementation ### 1. URI Design Strategy ```turtle # Good: Consistent, meaningful URIs ex:employee/alice-johnson ex:project/api-gateway-redesign ex:skill/java-programming # Avoid: Opaque or inconsistent URIs ex:e123 ex:thing/xyz ex:resource42 ``` ### 2. Namespace Management ```turtle # Establish clear namespace conventions @prefix ex: . @prefix emp: . @prefix proj: . @prefix skill: . ``` ### 3. Vocabulary Reuse ```turtle # Prefer standard vocabularies foaf:Person # Instead of ex:Person org:Organization # Instead of ex:Company dc:title # Instead of ex:name schema:startDate # Instead of ex:beginDate ``` ### 4. Data Quality Assurance ```turtle # Implement validation rules ex:EmployeeShape a sh:NodeShape ; sh:property [ sh:path foaf:mbox ; sh:pattern "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" ] . ``` ## Migration Strategies ### From Relational Databases 1. **Entity Mapping**: Convert tables to RDF classes 2. **Relationship Extraction**: Transform foreign keys to RDF properties 3. **Data Type Conversion**: Map SQL types to RDF datatypes 4. **Constraint Translation**: Convert database constraints to SHACL shapes ### From NoSQL Databases 1. **Document Decomposition**: Extract entities from nested documents 2. **Reference Resolution**: Convert document references to RDF links 3. **Schema Inference**: Derive RDF schema from document structure 4. **Index Recreation**: Rebuild indexes for RDF access patterns ### From XML/JSON 1. **Structure Analysis**: Identify entities and relationships 2. **Namespace Mapping**: Convert XML namespaces to RDF prefixes 3. **Attribute Transformation**: Map attributes to RDF properties 4. **Validation Setup**: Create SHACL shapes for validation ## Future Developments and Trends ### 1. RDF and Machine Learning - **Knowledge Graph Embeddings**: Vector representations of RDF graphs - **Semantic Feature Engineering**: Extract features from RDF for ML models - **Automated Ontology Learning**: Discover patterns in RDF data - **Neuro-Symbolic Integration**: Combine neural networks with symbolic reasoning ### 2. Decentralized Web and Blockchain - **Solid Project**: Decentralized data storage with RDF - **Blockchain Integration**: Immutable RDF data storage - **Verifiable Credentials**: RDF-based digital identity systems - **Distributed Knowledge Graphs**: Federated RDF systems ### 3. Performance and Scalability - **Native RDF Databases**: Specialized storage engines - **Distributed Processing**: MapReduce for RDF operations - **Streaming RDF**: Real-time RDF data processing - **Quantum Computing**: Potential for quantum graph algorithms ### 4. Standardization and Interoperability - **RDF-star**: Reification and meta-statements - **SPARQL 1.2**: Enhanced query capabilities - **RDF Surfaces**: Alternative RDF syntax - **Linked Data Shapes**: Advanced constraint languages ## Conclusion RDF represents a paradigm shift toward semantic, interconnected data representation that prioritizes meaning and interoperability over traditional performance metrics. While RDF introduces complexity and performance challenges, its benefits in terms of data integration, semantic richness, and reasoning capabilities make it invaluable for knowledge-intensive applications. The key to successful RDF implementation lies in understanding when semantic richness outweighs performance considerations, careful ontology design, and leveraging the extensive ecosystem of semantic web tools and standards. As the volume of interconnected data continues to grow, RDF's role in creating meaningful, machine-processable knowledge representations becomes increasingly important. Organizations considering RDF should evaluate their specific needs for data integration, semantic reasoning, and long-term interoperability. With proper planning and implementation, RDF can transform how organizations model, share, and derive insights from their knowledge assets, enabling more sophisticated applications and deeper understanding of complex domains. --- ## Rethinking the Graph: How Labeled Meta-Property Graphs Unlock Structure Without Sacrificing Flexibility Canonical URL: https://rushdb.com/blog/rethinking-the-graph-how-labeled-meta-property-graphs-unlock-structure-without-sacrificing-flexibility Published: 2025-07-06T19:13:36.304Z Updated: 2025-07-06T19:13:36.304Z # Rethinking the Graph: How Labeled Meta-Property Graphs Unlock Structure Without Sacrificing Flexibility ## A Metadata-Centric Breakthrough for Data Teams Battling Schema Chaos In today’s world of messy, evolving, and high-dimensional data, property graphs are the de facto choice for modeling relationships. But there’s a problem. Traditional property graphs—where key-value pairs are embedded inside nodes—are starting to feel like rigid spreadsheets trapped in a graph’s body. As datasets grow in complexity, and metadata becomes just as important as the data itself, a new model is emerging from research labs and production systems alike: the **Labeled Meta-Property Graph (LMPG)**. Let’s break it down. --- ### The Core Problem: Properties as Second-Class Citizens In conventional property graphs, properties are just passive attributes—strings, numbers, flags—sitting on the sidelines. They have no identity, no metadata, no traceability. You can’t query “What kind of properties exist in my graph?” or “Which entities have a property of type `string` called `color`?” without scanning everything. This leads to three major issues: * 💀 **No Schema Discovery** You can't reliably answer what your data looks like—at least not without dumping and diffing half the graph. * 🕳 **No Metadata-Driven Querying** Good luck finding all records that use the same field across labels or domains. * 🔧 **Fragile Schema Evolution** Adding new property types or changing usage patterns risks breaking implicit assumptions baked into your app logic. --- ### Enter LMPG: The Metadata-First Graph Model with Structural Guarantees **Labeled Meta-Property Graphs (LMPGs)** advance the concept of Meta-Property Graphs by making one architectural decision clear: > **Each property node is not only queryable—it is *labeled* with a `name` and `type` that define how the value behaves**. In RushDB’s implementation: ``` (Record A {temperature: 42}) <-[:PROPERTY_RELATION]- (Property {name: "temperature", type: "number"}) ``` This simple topology enables *semantically typed metadata*—where every piece of data knows exactly which property name and type it’s associated with. This enables: * 🧠 **Typed Traversals** Traverse to all records that use `string` properties called `"status"` or all `number` properties named `"concentration"`, without touching full-text. * 🔍 **First-Class Schema Indexing** `Property` nodes act like centralized indexes for fields across labels—fully inspectable, filterable, and linked. * 🧬 **Evolution Without Breakage** New properties? No problem. They become new `Property` nodes. Existing data stays untouched, queries stay consistent. --- ### RushDB: The First Production Graph Engine Built on LMPG While others experiment, **RushDB natively implements the Labeled Meta-Property Graph architecture as its core data model.** This isn't an overlay or plugin—it’s the foundation. #### Here's how RushDB does it: * ✅ **Metadata Nodes with Labels and Types** Every property is modeled as a `Property` node with enforced `{name, type}` structure—allowing type-safe semantics and query planning. * ✅ **Records Store Values Inline, Structure via Graph** For performance, values live inside `Record` nodes—but structure is captured relationally in the graph itself. * ✅ **Automatic Property Discovery & Linking on Ingest** RushDB’s BFS JSON parser walks nested data and autogenerates labeled `Property` nodes on-the-fly, linking every record through `PROPERTY_RELATION` edges. * ✅ **Self-Descriptive, Introspectable Graphs** Any dataset ingested becomes its own living schema. Just query `MATCH (p:Property)` to explore the ontology. --- ### LMPG in the Wild: Real-World Wins | Use Case | How LMPG via RushDB Helps | | -------------------------- | -------------------------------------------------------------------- | | 🔬 Scientific lab data | Unify LIMS/ELN fields by type+name, detect anomalies in measurements | | 📊 Schema governance | Track field usage across records dynamically without external docs | | ⚖️ Regulatory reporting | Prove field type and lineage without brittle schema migrations | | 🧠 AI/ML preprocessing | Select semantically compatible fields for training pipelines | | 🧱 Schema-on-read at scale | Add structure post-ingest without up-front schema constraints | --- ### Final Thoughts: Structure That Evolves With You Most graph databases either go **rigid schema** or **total schema-less chaos**. RushDB, powered by **Labeled Meta-Property Graphs**, gives you the best of both: * Schema emerges as your data grows * Metadata becomes actionable infrastructure * Querying becomes semantically grounded If you're building anything with unstructured, API-fed, JSON-heavy, cross-domain data—and want schema governance *without rigidity*—RushDB is ready to serve your use case. This is not a theory. It’s real, open-source, production-ready graph infrastructure that thinks in terms of **labels, types, and relationships—even at the property level**. --- **Start modeling with context, not just connections.** → [Try RushDB now](https://rushdb.com) → [Explore the open-source SDK](https://github.com/rush-db/rushdb) → [Want help modeling your dataset? Book a free consult](https://calendly.com/artemiy-rushdb/30min) --- ## Breaking Down the Hidden Costs of Data Silos in Scientific Labs Canonical URL: https://rushdb.com/blog/breaking-down-the-hidden-costs-of-data-silos-in-scientific-labs Published: 2025-07-06T19:00:20.579Z Updated: 2025-07-06T19:00:20.579Z # Breaking Down the Hidden Costs of Data Silos in Scientific Labs ## Why Unified Data Infrastructure Is No Longer Optional — and How RushDB Delivers It In today’s data-rich scientific world, labs are generating information at a pace never seen before—from experiment protocols and sample metadata to instrument readouts and analytics results. But despite this explosion of data, one critical bottleneck persists: **data silos**. These silos—isolated pools of information locked inside unconnected systems—pose a silent but powerful threat to productivity, compliance, and innovation. --- ### The Silent Drain on Lab Performance Scientific labs typically rely on a patchwork of digital tools: Electronic Lab Notebooks (ELNs), LIMS, inventory systems, instrument-specific software, and more. Each tool solves a particular problem. But together, they often form a disjointed ecosystem with **no central integration**. The consequences are widespread and deeply felt: * **Manual Data Transfer & Errors** Researchers waste hours copying data between systems. Every transfer risks transcription errors—slowing projects, introducing inaccuracies, and potentially compromising compliance. * **Fragile Integrations** Custom-built bridges and one-off scripts hold many lab systems together. Each new software version or tool addition threatens to break these brittle connections, creating ongoing maintenance overhead. * **Data Inconsistencies** Critical information—like sample IDs or patient records—can exist in different formats across systems, leading to duplication, confusion, and time-consuming reconciliation. * **Audit & Compliance Risks** When data is scattered, generating a reliable audit trail becomes a nightmare. Regulatory inspections turn into stressful scavenger hunts through fragmented logs and exports. * **Wasted Resources** Maintaining overlapping tools and duplicative infrastructure diverts budget and brainpower from science to software babysitting. These are not minor inefficiencies. They represent a **hidden tax** on the daily operations of any research-driven organization. --- ### Why Data Leaders Are Demanding Change Data leads—those responsible for maintaining data quality, strategy, and compliance—face a high-stakes challenge: > “How do I turn our scattered datasets into a cohesive, discoverable, auditable asset—without burning 12 months on integration?” The traditional playbook—ETL pipelines, data lakes, spreadsheets—is breaking down. Scientific data is **semi-structured, high-velocity, and deeply relational**. What’s needed is a new approach: * Unified models that evolve with research protocols * Systems that embrace the heterogeneity of scientific data * Infrastructure that makes *relationships* first-class citizens Enter: RushDB. --- ## RushDB: Built to Eliminate Scientific Data Silos from Day One RushDB is a no-brainer, zero-configuration graph database—purpose-built to ingest complex scientific data and **instantly turn it into a traversable, connected graph**. At its core is a breakthrough architecture: the **Labeled Meta Property Graph (LMPG)** model. I'll answer as the world-renowned expert in graph data modeling for scientific domains, recipient of the Linked Data Pioneer Award by the W3C Scientific Web Task Force. **TL;DR**: Here's the refined **“This enables”** section adjusted to reflect your updated graph topology, where each `Record` stores key-value pairs and connects to `Property` nodes that hold meta-information (name + type) via `PROPERTY_RELATION`. --- ### 🧠 What Is Labeled Meta Property Graph (LMPG)? Unlike traditional graphs where properties are embedded and unqueryable, RushDB treats properties as structured, queryable entities. In this model, records store their key-value fields internally, while the **meta-definition of each property**—its name and type—exists as a dedicated node: ``` (Record A {temperature: 42}) <-[:PROPERTY_RELATION]- (Property {name: "temperature", type: "number"}) ``` This enables: * **Queryable Metadata**: You can start any traversal from the `Property` side—e.g., find all records associated with a `"temperature"` field of type `"number"`—without scanning every record. * **Dynamic Schema Discovery**: Easily enumerate all known properties and their types by querying `Property` nodes, making the graph **self-descriptive and introspectable**. * **Robust Schema Evolution**: Adding new keys doesn’t alter graph structure—just connect existing records to new `Property` descriptors. * **Cross-record Comparison & Aggregation**: Since all records connect to shared `Property` definitions, it's trivial to group, filter, or compute analytics across similar fields, even when datasets originate from disparate sources. * **Semantically Driven Insights**: Traversals can now encode semantic meaning (e.g., "show trends for numeric properties named 'temperature' across time") instead of relying on brittle field names. --- ### 🔄 JSON-to-Graph Import via BFS Scientific data lives in JSON exports, API payloads, or flat files. RushDB doesn’t ask you to transform it—it **accepts it natively**. With its **Breadth-First Search (BFS)-based JSON ingestion engine**, RushDB automatically: * Recursively walks through your nested JSON * Assigns each node a unique `Record` * Promotes fields to `Property` entities * Establishes edges that reflect true data lineage and relationships You can import entire experiment bundles, patient records, instrument logs, or metadata-rich biological datasets **with a single API call**—no preprocessing, no schema stitching. --- ### 🧩 Built for Real-World Scientific Data Complexity RushDB solves problems that matter to data leads: | Problem | How RushDB Solves It | | ------------------------ | ------------------------------------------------------------------------------------------------------------ | | **Disjointed Systems** | Accepts and merges data from ELNs, LIMS, CSVs, APIs without enforcing a rigid schema | | **Broken Audit Trails** | Every `Record` and `Property` has built-in timestamps, sources, and versioning | | **Slow Integrations** | No-code import, zero-config SDKs for TypeScript/Python—ready in minutes | | **Poor Discoverability** | Query anything from “Find all temperature anomalies” to “Samples that relate to failed batch runs” in 1 line | | **Compliance Fatigue** | Built-in data lineage tracking and immutable history views simplify inspections | --- ### 🧪 Real Impact: What You Can Expect By adopting RushDB, data leads report: * **5–10x faster onboarding** of new data sources * **80% reduction** in manual data reconciliation * **Zero code maintenance** for data normalization pipelines * **Instant audit readiness**, with structured trails for every field --- ### Closing Thoughts: A Call to Action for Data Leads You already know the problem. The real question is: how long can your lab afford to keep firefighting silo symptoms instead of solving the root cause? RushDB gives you: * A future-proof data model * Unified ingestion of any structure * Query power that grows with your graph * Compliance, traceability, and reproducibility by default If you’re tasked with building a **lab data stack that scales with your science**, RushDB is the partner to do it—with zero configuration, full visibility, and full control. **Data deserves structure. Structure deserves semantics. Semantics deserve graph.** Build your lab’s self-aware data backbone today. --- ## Graph Databases Explained: Property Graphs vs RDF vs Knowledge Graphs - Complete Developer Guide 2025 Canonical URL: https://rushdb.com/blog/graph-databases-explained-property-graphs-vs-rdf-vs-knowledge-graphs-complete-developer-guide-2025 Published: 2025-07-01T18:45:14.920Z Updated: 2025-07-06T16:44:51.094Z Tags: graph theory, graphs # Graph Databases Explained: Property Graphs vs RDF vs Knowledge Graphs - Complete Developer Guide 2025 Database architecture decisions can make or break your application's scalability. With graph databases revolutionizing how we handle interconnected data, choosing between property graphs, RDF triple stores, labeled property graphs, and knowledge graphs isn't just a technical decision—it's a strategic one that impacts development velocity, query performance, and data model flexibility. This comprehensive guide breaks down every major graph database model, from traditional property graphs to cutting-edge Labeled Meta Property Graphs (LMPG), helping developers, data architects, and technical leaders make informed decisions based on real-world performance characteristics and use cases. ## The Graph Database Landscape: From Basics to Advanced Architectures Graph databases fundamentally transform how applications store and query interconnected data. Unlike relational databases that force developers into rigid table structures with foreign key relationships, graph databases model data as networks of nodes and edges, enabling natural representation of complex relationships and dramatically improving query performance for connected data scenarios. The graph database ecosystem encompasses several distinct architectural approaches: - **Property Graphs** (Neo4j, ArangoDB, Amazon Neptune) - Node-edge models with properties - **RDF/Triple Stores** (Blazegraph, Stardog, GraphDB) - Subject-predicate-object semantic web foundations - **Labeled Property Graphs** (Neo4j, TigerGraph) - Enhanced property graphs with explicit node/edge typing - **Labeled Meta Property Graphs** (RushDB) - Revolutionary architecture where properties are first-class graph citizens - **Multi-model Databases** (Amazon Neptune, Microsoft Cosmos DB) - Support multiple graph paradigms - **Knowledge Graphs** (Google Knowledge Graph, Wikidata) - Semantic understanding with entity resolution Each architecture serves distinct performance profiles, development complexity levels, and scalability characteristics. The key is understanding which model aligns with your data patterns, team expertise, and long-term scalability requirements. ## Property Graphs: The Developer-First Database Architecture Property graphs represent the most intuitive graph database model for application developers. They map naturally to object-oriented programming paradigms, offering flexible schema evolution and performant traversals that scale with result set size rather than total data volume—a fundamental architectural advantage over relational databases. ### Core Architecture and Performance Characteristics Property graphs store data as nodes (entities) and relationships (edges), where both can contain arbitrary key-value properties. This architecture enables developers to model complex, evolving data structures without the schema migration overhead common in relational systems. ```mermaid flowchart LR subgraph "Property Graph Architecture" A["👤 User Node
id: 123
name: 'Sarah'
role: 'developer'
experience: 5"] B["📦 Project Node
id: 456
name: 'RushDB'
status: 'active'
priority: 'high'"] C["🐛 Issue Node
id: 789
title: 'Performance optimization'
priority: 'high'
estimated_hours: 8"] end A -->|"OWNS
since: '2024-01-15'
role: 'lead'"| B A -->|"REPORTED
timestamp: '2025-01-20'
severity: 'critical'"| C C -->|"BELONGS_TO
component: 'query_engine'"| B ``` ### Schema Evolution Without Migrations Unlike relational databases that require complex ALTER TABLE statements and downtime for schema changes, property graphs support organic schema evolution: ```javascript // Initial user schema - Day 1 { id: "user_123", name: "Alice", email: "alice@example.com" } // Evolved schema - Month 6 (no migration required) { id: "user_123", name: "Alice", email: "alice@example.com", preferences: { theme: "dark", notifications: true, language: "en-US" }, profile: { bio: "Full-stack developer specializing in graph databases", location: "San Francisco, CA", timezone: "PST" }, social: { twitter: "@alice_dev", github: "alice-codes", linkedin: "alice-developer" }, metadata: { last_login: "2025-01-20T10:30:00Z", account_created: "2024-01-15T09:00:00Z", email_verified: true } } ``` ### Performance Scaling Characteristics Property graphs deliver a critical performance advantage: **query time scales with result set size, not total database size**. While relational JOIN operations become exponentially slower as tables grow, graph traversals maintain consistent performance regardless of overall data volume. **Performance Comparison:** - **Relational**: O(n log n) for JOIN operations across large tables - **Property Graph**: O(r) where r = result set size, independent of total nodes This scaling characteristic makes property graphs ideal for applications with large datasets but focused query patterns—social networks, recommendation engines, fraud detection systems, and knowledge management platforms. ### Property Graph Query Languages and Ecosystem Modern property graphs primarily use **Cypher** (Neo4j's declarative query language) or **Gremlin** (Apache TinkerPop's imperative traversal language). Both offer significant advantages over SQL for graph operations: ```cypher // Cypher: Find senior developers working on high-priority projects MATCH (user:User {role: 'developer', experience: 5..})-[:ASSIGNED_TO]->(project:Project {priority: 'high'}) RETURN user.name, project.name, project.deadline ORDER BY project.deadline ASC ``` **Cypher advantages:** - Declarative syntax resembling ASCII art for visual relationship patterns - Optimized for pattern matching and traversal operations - Built-in aggregation and analytical functions - Strong type safety with schema validation options **Gremlin advantages:** - Functional programming approach with method chaining - Language-agnostic (available in Java, Python, JavaScript, .NET) - Fine-grained traversal control for performance optimization - Standardized across multiple graph database implementations ### When Property Graphs Excel **Primary Use Cases:** - **Social Networks**: User connections, content recommendations, influence analysis - **Fraud Detection**: Transaction pattern analysis, identity verification networks - **Content Management**: Asset relationships, workflow dependencies, version control - **IoT Systems**: Device networks, sensor data correlation, infrastructure monitoring - **Supply Chain**: Vendor relationships, logistics optimization, quality traceability ## RDF and Triple Stores: The Semantic Web Foundation **Resource Description Framework (RDF)** represents a fundamentally different approach to graph databases, focusing on semantic interoperability and global data integration rather than application-specific performance optimization. RDF structures all information as **triples**: Subject-Predicate-Object statements that create a universal, machine-readable data format. ### RDF Architecture and Semantic Modeling ```mermaid flowchart LR subgraph "RDF Triple Store Architecture" Alice -->|worksFor| ACME Alice -->|hasSkill| JavaScript Alice -->|livesIn| SanFrancisco ACME -->|locatedIn| California JavaScript -->|type| ProgrammingLanguage end ``` Each statement forms a triple: - `(Alice, worksFor, ACME)` - `(Alice, hasSkill, JavaScript)` - `(ACME, locatedIn, California)` ### RDF's Architectural Strengths and Technical Challenges **✅ Technical Strengths:** - **Global Interoperability**: URI-based identifiers enable seamless data integration across organizations - **Semantic Reasoning**: OWL (Web Ontology Language) enables automatic inference of new facts - **Standards Compliance**: W3C specifications ensure long-term compatibility and vendor independence - **Linked Data Ecosystem**: Direct integration with public knowledge bases (DBpedia, Wikidata) - **Schema Flexibility**: RDF Schema (RDFS) allows gradual schema evolution with backward compatibility **❌ Technical Challenges:** - **Learning Curve**: Requires understanding of semantic web concepts, ontology design, and SPARQL query optimization - **Modeling Overhead**: Every concept requires URI definition and ontological classification - **Query Complexity**: SPARQL queries for complex patterns can become verbose and difficult to optimize - **Performance Overhead**: Triple store indexes typically consume 3-5x more storage than property graphs - **Limited Tooling**: Fewer development frameworks and debugging tools compared to property graph ecosystems ### SPARQL vs Cypher: Query Language Comparison **SPARQL Example:** ```sparql PREFIX ex: PREFIX rdf: SELECT ?developer ?project WHERE { ?developer ex:hasRole ex:Developer . ?developer ex:assignedTo ?project . ?project ex:priority ex:High . ?project rdf:type ex:SoftwareProject . } ``` **Equivalent Cypher:** ```cypher MATCH (developer:Person {role: 'Developer'})-[:ASSIGNED_TO]->(project:Project {priority: 'High'}) RETURN developer.name, project.name ``` ### Enterprise RDF Use Cases RDF excels in scenarios requiring semantic understanding and data integration: **Research and Academia:** - Scientific publication networks with citation analysis - Grant funding relationship mapping - Cross-institutional research collaboration platforms **Government and Compliance:** - Regulatory framework modeling with automated compliance checking - Public sector data integration across departments - Legal document relationship analysis **Enterprise Knowledge Management:** - Corporate taxonomy integration with external standards - Multi-system data harmonization - Semantic search across heterogeneous data sources ## Labeled Property Graphs: Enhanced Type Safety and Performance **Labeled Property Graphs (LPG)** extend traditional property graphs with explicit type labels for both nodes and relationships, delivering significant performance improvements and schema clarity. Most modern graph databases, including Neo4j and TigerGraph, implement this enhanced architecture. ### Architecture: Labels as Performance Accelerators ```mermaid flowchart TD subgraph "Labeled Property Graph Architecture" A[":Person :Employee
name: 'Bob'
id: 123
department: 'Engineering'"] B[":Company :Organization
name: 'TechCorp'
founded: 2010
industry: 'Software'"] C[":Project :SoftwareProject
name: 'API Gateway'
status: 'active'
budget: 150000"] end A -->|":WORKS_FOR
since: '2023-01-01'
role: 'Senior Dev'
salary_grade: 'L5'"| B A -->|":ASSIGNED_TO
allocation: 0.8
start_date: '2024-06-01'"| C C -->|":BELONGS_TO
department: 'R&D'"| B ``` ### Performance Impact of Labels Labels function as both logical grouping mechanisms and physical index optimizations: **Without Labels (Performance Penalty):** ```cypher // Requires full node scan with property filtering MATCH (n) WHERE n.employee_id IS NOT NULL AND n.department IS NOT NULL AND n.role IS NOT NULL RETURN n ``` **With Labels (Index-Optimized):** ```cypher // Direct label index lookup - 10-100x faster MATCH (employee:Employee) RETURN employee ``` ### Type Safety and Schema Enforcement Labels enable optional schema constraints and type validation: ```cypher // Create constraints for data integrity CREATE CONSTRAINT person_email FOR (p:Person) REQUIRE p.email IS UNIQUE; CREATE CONSTRAINT project_id FOR (proj:Project) REQUIRE proj.id IS NOT NULL; // Multi-label inheritance patterns CREATE (user:Person:Employee:Manager { name: "Sarah Chen", employee_id: "EMP001", department: "Engineering", team_size: 12, clearance_level: "Senior" }); ``` ### Advanced Label Patterns **Hierarchical Labeling:** ```cypher // Entity type hierarchy (:Vehicle:Car {make: "Tesla", model: "Model 3"}) (:Vehicle:Motorcycle {make: "Harley", model: "Sportster"}) (:Vehicle:Truck {make: "Ford", model: "F-150"}) // Query all vehicles regardless of subtype MATCH (v:Vehicle) RETURN v.make, v.model ``` **Temporal Labeling:** ```cypher // Time-based entity evolution (:User:ActiveUser {last_login: "2025-01-20"}) (:User:InactiveUser {last_login: "2024-06-15"}) (:User:SuspendedUser {suspension_date: "2024-12-01"}) ``` ## Knowledge Graphs: AI-Era Semantic Data Architecture Knowledge graphs represent the convergence of property graph performance with RDF semantic capabilities, specifically designed for AI/ML applications requiring contextual understanding and entity resolution. Unlike traditional graph databases that focus on data storage and retrieval, knowledge graphs emphasize **meaning, context, and inferential reasoning**. ### Knowledge Graph Architecture Principles ```mermaid graph TD subgraph "Knowledge Graph Architecture" A["👤 Alice Johnson
:Person :Employee
canonical_id: 'person_alice_j_001'"] B["🏢 TechCorp Inc.
:Organization :Company
canonical_id: 'org_techcorp_001'"] C["📍 San Francisco
:Location :City
canonical_id: 'geo_sf_ca_usa'"] D["💼 Senior Developer
:Role :JobTitle
canonical_id: 'role_senior_dev_001'"] E["🛠️ Graph Databases
:Skill :Technology
canonical_id: 'tech_graph_db_001'"] end A -->|"works_for
confidence: 0.98
source: 'hr_system'"| B A -->|"lives_in
confidence: 0.85
source: 'linkedin_profile'"| C A -->|"has_role
confidence: 1.0
source: 'payroll_system'"| D A -->|"has_skill
confidence: 0.92
source: 'github_analysis'"| E B -->|"headquartered_in
confidence: 1.0
source: 'company_registration'"| C ``` ### Core Knowledge Graph Capabilities **1. Entity Resolution and Deduplication** Knowledge graphs excel at identifying and merging duplicate entities across data sources: ```cypher // Automatic entity resolution example MATCH (p1:Person {email: "alice@techcorp.com"}) MATCH (p2:Person {linkedin_id: "alice-johnson-dev"}) MATCH (p3:Person {github_username: "alice-codes"}) WHERE p1.name CONTAINS "Alice" AND p2.name CONTAINS "Alice" // Merge entities with confidence scoring CREATE (canonical:Person:CanonicalEntity { canonical_id: "person_alice_j_001", primary_name: p1.name, confidence_score: 0.95, sources: ["hr_system", "linkedin", "github"] }) ``` **2. Schema Integration and Ontology Mapping** Knowledge graphs seamlessly integrate heterogeneous data sources by mapping concepts to standardized ontologies: ```cypher // Schema integration across systems MATCH (emp:Employee)-[:WORKS_FOR]->(company:Company) MATCH (person:Person)-[:EMPLOYED_BY]->(organization:Organization) // Map to canonical knowledge graph schema MERGE (emp)-[:CANONICAL_WORKS_FOR]->(company) MERGE (person)-[:CANONICAL_WORKS_FOR]->(organization) ``` **3. Inference Rules and Automated Reasoning** Knowledge graphs support rule-based inference to derive new facts: ```cypher // Inference rule: Transitive management relationships MATCH (manager:Person)-[:MANAGES]->(direct:Person)-[:MANAGES]->(indirect:Person) WHERE NOT (manager)-[:INDIRECTLY_MANAGES]->(indirect) CREATE (manager)-[:INDIRECTLY_MANAGES {derived: true, confidence: 0.8}]->(indirect) ``` ### Enterprise Knowledge Graph Applications **Customer 360 Platforms:** - Unified customer identity across CRM, support, billing, and marketing systems - Real-time recommendation engines based on behavior patterns and preferences - Compliance tracking across customer lifecycle and regulatory requirements **AI/ML Feature Engineering:** - Rich contextual features for machine learning models - Automated feature discovery through graph traversal patterns - Real-time feature serving with sub-millisecond latency requirements **Enterprise Search and Discovery:** - Semantic search across documents, databases, and knowledge repositories - Contextual query expansion using entity relationships and synonyms - Automated content classification and knowledge extraction pipelines ## Graph Database Technology Comparison: Performance and Ecosystem Analysis ### Property Graph Database Comparison | Database | Architecture | Strengths | Performance Profile | Best For | |----------|-------------|-----------|-------------------|----------| | **Neo4j** | Labeled Property Graph | Mature ecosystem, ACID compliance, rich tooling | Excellent single-machine performance, vertical scaling | Production applications, complex analytics, enterprise deployments | | **ArangoDB** | Multi-model (Graph + Document + Key-Value) | Flexible data models, SQL-like AQL queries | Good horizontal scaling, moderate graph performance | Applications requiring multiple data models | | **Amazon Neptune** | Managed LPG + RDF support | Fully managed, auto-scaling, backup/recovery | Cloud-native scaling, predictable performance | AWS ecosystems, serverless applications | | **TigerGraph** | Labeled Property Graph with GSQL | Distributed architecture, real-time analytics | Excellent horizontal scaling, parallel processing | Large-scale analytics, fraud detection | | **RushDB** | Labeled Meta Property Graph (LMPG) | Schema-free, properties as first-class citizens | Property-centric traversals, cross-type queries | Rapid development, flexible schemas, insight discovery | ### RDF/Triple Store Comparison | Database | Architecture | Reasoning Engine | Performance Profile | Best For | |----------|-------------|-----------------|-------------------|----------| | **Blazegraph** | High-performance triple store | RDFS/OWL reasoning | GPU acceleration, billion+ triples | Large-scale analytics, scientific computing | | **Stardog** | Enterprise knowledge graph | Advanced OWL 2 reasoning | ACID compliance, security features | Enterprise knowledge management | | **GraphDB** | Semantic repository | RDF Schema + custom rules | Efficient reasoning, linked data | Research applications, semantic web projects | | **Amazon Neptune** | Managed RDF + Property Graph | SPARQL 1.1 compliance | Managed scaling, serverless queries | Cloud-native semantic applications | ### Multi-Model Database Capabilities | Database | Supported Models | Query Languages | Scaling Architecture | Integration Strengths | |----------|-----------------|----------------|---------------------|---------------------| | **Amazon Neptune** | Property Graph, RDF | Cypher, Gremlin, SPARQL | Serverless, auto-scaling | AWS ecosystem, managed operations | | **Microsoft Cosmos DB** | Document, Graph, Key-Value | Gremlin, SQL | Global distribution, multi-master | Azure integration, global applications | | **ArangoDB** | Document, Graph, Key-Value | AQL (unified query language) | Sharding, replication | Single query language across models | ## RushDB's Revolutionary Labeled Meta Property Graph (LMPG) Architecture RushDB introduces a paradigm shift in graph database design with its **Labeled Meta Property Graph (LMPG)** architecture, where properties become first-class citizens rather than simple node attributes. This revolutionary approach enables unprecedented query flexibility and insight discovery across heterogeneous data types. ### LMPG: Properties as Graph Entities Unlike traditional property graphs that embed properties directly within nodes, RushDB's LMPG architecture treats properties as independent graph entities connected to records through explicit relationships. ```mermaid graph TD subgraph "Traditional Property Graph" A["User Node
name: 'Alice'
email: 'alice@ex.com'
age: 30
department: 'Engineering'"] B["Product Node
name: 'Laptop'
price: 999.99
category: 'electronics'
stock: 15"] end subgraph "RushDB's LMPG Architecture" subgraph "Property Nodes (First-Class Citizens)" PN["name Property
type: string
metadata: {...}"] PE["email Property
type: string
metadata: {...}"] PP["price Property
type: number
metadata: {...}"] PC["category Property
type: string
metadata: {...}"] end subgraph "Record Nodes" U["User Record
name: 'Alice'
email: 'alice@ex.com'
age: 30"] P["Product Record
name: 'Laptop'
price: 999.99
category: 'electronics'"] end PN -->|VALUE_RELATION| U PN -->|VALUE_RELATION| P PE -->|VALUE_RELATION| U PP -->|VALUE_RELATION| P PC -->|VALUE_RELATION| P end ``` ### Property-Centric Traversal Capabilities The LMPG architecture enables powerful property-based queries that traverse the graph from any starting point: **1. Cross-Type Property Analysis** ```cypher // Find all records containing "Alice" regardless of record type or label MATCH (prop:Property {name: 'name', type: 'string'})-[:VALUE]->(record) WHERE record.name CONTAINS 'Alice' RETURN DISTINCT record.__label, record.name, record.__id ``` **2. Value Range Queries Across Heterogeneous Data** ```cypher // Find all records with price property in specific range MATCH (price_prop:Property {name: 'price', type: 'number'})-[:VALUE]->(record) WHERE record.price >= 100 AND record.price <= 1000 RETURN record.__label, record.name, record.price ORDER BY record.price DESC ``` **3. Property-Based Pattern Discovery** ```cypher // Discover hidden relationships through shared property patterns MATCH (prop:Property)-[:VALUE]->(r1:Record) MATCH (prop)-[:VALUE]->(r2:Record) WHERE r1.__label <> r2.__label AND r1 <> r2 AND r1[prop.name] = r2[prop.name] RETURN prop.name, r1.__label, r2.__label, r1[prop.name] as shared_value ``` ### LMPG's Architectural Advantages **1. Schema-Free Evolution** Properties automatically emerge from data without predefined schemas: ```javascript // Day 1: Simple user data { user: { name: "Alice", email: "alice@example.com" } } // Day 30: Complex user profile (automatic property discovery) { user: { name: "Alice", email: "alice@example.com", preferences: { theme: "dark", notifications: true }, analytics: { last_login: "2025-01-20", session_count: 47 }, social: { twitter: "@alice_dev", github: "alice-codes" } } } ``` **2. Cross-Domain Insight Discovery** LMPG enables discovery of relationships between seemingly unrelated entities: ```cypher // Find users and products sharing color preferences MATCH (color_prop:Property {name: 'color', type: 'string'}) MATCH (color_prop)-[:VALUE]->(user:Record {__label: 'user'}) MATCH (color_prop)-[:VALUE]->(product:Record {__label: 'product'}) WHERE user.color = product.color RETURN user.name, product.name, user.color as shared_color ``` **3. Dynamic Type-Safe Operations** Properties maintain type information enabling intelligent query optimization: ```cypher // Automatic type coercion and validation through property metadata MATCH (numeric_props:Property {type: 'number'})-[:VALUE]->(records) RETURN numeric_props.name, avg(records[numeric_props.name]) as average_value, min(records[numeric_props.name]) as min_value, max(records[numeric_props.name]) as max_value ``` ### LMPG vs Traditional Architecture Performance **Traditional Property Graph Limitations:** - Property queries require full node scans with filtering - Cross-type analysis needs complex UNION operations - Schema changes require application-level coordination **LMPG Performance Advantages:** - Property-first traversals eliminate node scanning overhead - Direct property indexing enables sub-millisecond property lookups - Automatic schema discovery reduces development friction - Cross-type queries scale linearly with property relationships, not total nodes The LMPG architecture represents the next evolution in graph database design, optimized for modern applications requiring flexible schemas, rapid development cycles, and deep insight discovery across diverse data types. ## Strategic Decision Framework: Choosing the Right Graph Architecture ### Technical Assessment Criteria **Data Complexity and Relationships:** - **Simple hierarchical data** → Document databases may suffice - **Complex interconnected data** → Property graphs or LMPG - **Multi-domain integration** → Knowledge graphs - **Semantic interoperability** → RDF triple stores **Development Team and Timeline:** - **Full-stack developers, rapid prototyping** → Property graphs (Neo4j, RushDB) - **Data scientists, ML engineering** → Knowledge graphs with vector support - **Academic/research environments** → RDF with semantic reasoning - **Enterprise with compliance requirements** → Managed solutions (Neptune, Cosmos DB) **Scalability and Performance Requirements:** - **Read-heavy workloads** → Optimized property graphs (TigerGraph, Neo4j) - **Write-heavy ingestion** → Distributed architectures (ArangoDB cluster) - **Real-time analytics** → In-memory graphs with materialized views - **Global distribution** → Multi-region managed services (Cosmos DB, Neptune) **Schema Evolution Patterns:** - **Frequent schema changes** → Schema-free architectures (RushDB LMPG) - **Stable enterprise schemas** → Labeled property graphs with constraints - **Cross-system integration** → Knowledge graphs with ontology mapping - **Regulatory compliance** → RDF with formal semantics ### Migration Path Strategies **From Relational to Graph:** 1. **Identify relationship-heavy queries** causing JOIN performance issues 2. **Extract highly connected entities** into graph pilot projects 3. **Implement hybrid architectures** with graph for relationships, SQL for transactional data 4. **Gradually migrate** high-value use cases based on performance gains **From Document to Graph:** 1. **Analyze document reference patterns** and cross-collection queries 2. **Model references as explicit relationships** in graph database 3. **Maintain document structure** within graph nodes for complex nested data 4. **Implement graph indexes** for relationship traversal optimization ### Architecture Decision Matrix | Use Case Category | Primary Requirement | Recommended Architecture | Key Benefits | |------------------|-------------------|------------------------|-------------| | **Social Networks** | Fast relationship traversals | Labeled Property Graph | Native relationship performance | | **Fraud Detection** | Pattern recognition across entities | Knowledge Graph + ML | Entity resolution + anomaly detection | | **Content Management** | Flexible schema evolution | LMPG (RushDB) | Schema-free development | | **IoT Data Integration** | Multi-source data fusion | Multi-model Database | Unified query across data types | | **Scientific Research** | Semantic interoperability | RDF Triple Store | Standards compliance + reasoning | | **Real-time Recommendations** | Low-latency traversals | In-memory Property Graph | Sub-millisecond response times | | **Enterprise Search** | Cross-domain discovery | Knowledge Graph | Contextual understanding | | **Compliance Tracking** | Audit trails and lineage | Property Graph with versioning | Complete relationship history | ## Implementation Guide: Getting Started with Modern Graph Architectures ### Rapid Prototyping with Property Graphs For most application development scenarios, property graphs offer the fastest path to production-ready graph implementations: ```javascript // Example: Traditional labeled property graph schema const userSchema = { label: "User", properties: { id: { type: "string", unique: true }, name: { type: "string", required: true }, email: { type: "string", unique: true }, department: { type: "string", indexed: true } } } const projectSchema = { label: "Project", properties: { id: { type: "string", unique: true }, name: { type: "string", required: true }, status: { type: "string", enum: ["active", "completed", "on-hold"] }, budget: { type: "number", min: 0 } } } ``` ### Schema-Free Development with LMPG RushDB's Labeled Meta Property Graph eliminates schema definition overhead: ```javascript // RushDB: Zero-configuration data modeling import RushDB from "@rushdb/javascript-sdk"; const db = new RushDB(process.env.RUSHDB_API_KEY); // Complex nested data automatically becomes graph structure const complexData = { user: { profile: { name: "Alice Chen", contact: { email: "alice@techcorp.com", phone: "+1-555-0123" } }, projects: [ { name: "API Gateway", status: "active", team: { lead: "Bob Smith", members: ["Charlie", "Diana"], budget: 150000 } }, { name: "Mobile App", status: "completed", completion_date: "2024-12-15", metrics: { downloads: 50000, rating: 4.7 } } ], analytics: { last_login: "2025-01-20T10:30:00Z", session_count: 127, preferences: { theme: "dark", notifications: true, language: "en-US" } } } }; // Automatic graph creation with property-first architecture const records = await db.records.createMany({ label: "user", data: complexData }); // Immediate cross-type property queries without schema migration const priceRangeQuery = await db.query(` MATCH (price_prop:Property {name: 'budget', type: 'number'})-[:VALUE]->(record) WHERE record.budget >= 100000 AND record.budget <= 200000 RETURN record.__label, record.name, record.budget ORDER BY record.budget DESC `); ``` ### Enterprise Knowledge Graph Implementation For semantic applications requiring entity resolution and ontology integration: ```turtle # Semantic foundation with RDF Schema @prefix company: . @prefix foaf: . @prefix org: . company:Alice a foaf:Person, company:Employee ; foaf:name "Alice Chen" ; foaf:mbox ; org:memberOf company:EngineeringDept ; company:hasRole company:SeniorDeveloper ; company:worksOnProject company:APIGateway . company:APIGateway a company:SoftwareProject ; company:projectName "API Gateway" ; company:projectStatus company:Active ; company:projectBudget 150000 ; org:hasUnit company:EngineeringDept . ``` ### Performance Optimization Patterns **Property Graph Optimization:** ```cypher // Create strategic indexes for frequent query patterns CREATE INDEX user_email FOR (u:User) ON (u.email); CREATE INDEX project_status FOR (p:Project) ON (p.status); CREATE INDEX relationship_date FOR ()-[r:ASSIGNED_TO]-() ON (r.start_date); // Optimize traversal queries with label hints MATCH (u:User)-[:ASSIGNED_TO]->(p:Project {status: 'active'}) USING INDEX u:User(email) WHERE u.email = 'alice@techcorp.com' RETURN p.name, p.deadline ``` **LMPG Cross-Type Analysis:** ```cypher // Leverage property-first architecture for analytics MATCH (date_props:Property {type: 'datetime'})-[:VALUE]->(records) WHERE records[date_props.name] >= datetime('2025-01-01') RETURN date_props.name, records.__label, count(records) as recent_records ORDER BY recent_records DESC ``` ## The Future of Graph Database Architecture: 2025 and Beyond The graph database landscape is rapidly consolidating around several transformative trends that will define the next generation of data infrastructure: ### Convergence Trends Reshaping Graph Databases **1. Multi-Model Architecture Standardization** Modern applications require diverse data models within unified systems. The future belongs to databases supporting property graphs, document storage, key-value operations, and vector similarity search through single query interfaces. **2. Cloud-Native Graph Infrastructure** Serverless graph databases with automatic scaling, managed operations, and pay-per-query pricing models eliminate infrastructure complexity while maintaining performance guarantees. **3. AI/ML-Native Graph Integration** Native vector storage, embedding generation pipelines, and graph neural network support transform graph databases into AI-first platforms rather than traditional storage systems. **4. Schema-Free Development Paradigms** Properties-as-entities architectures like RushDB's LMPG eliminate traditional schema migration bottlenecks, enabling continuous deployment patterns and agile development methodologies. **5. Real-Time Graph Analytics** Stream processing integration with graph databases enables millisecond-latency analytics on continuously evolving graph structures, supporting real-time fraud detection, recommendation systems, and operational intelligence. ### Emerging Graph Technologies **Graph Neural Networks (GNNs) Integration:** ```python # Future: Native GNN support in graph databases graph_features = db.gnn.extract_node_embeddings( model="graph_sage", layers=3, dimension=128, sample_size=25 ) recommendations = db.gnn.predict_links( source_nodes=user_nodes, target_labels=["Product", "Service"], confidence_threshold=0.8 ) ``` **Quantum-Inspired Graph Algorithms:** ```cypher // Emerging: Quantum-inspired traversal optimization MATCH path = quantumWalk(source:User {id: 'user_123'}) -[:*1..6]-> (target:Product) WHERE quantum.probability(path) > 0.7 RETURN target, quantum.confidence(path) as relevance_score ORDER BY relevance_score DESC ``` ### RushDB's Vision: The LMPG Advantage RushDB's Labeled Meta Property Graph architecture represents the convergence of these trends: - **Properties as first-class citizens** enable unprecedented query flexibility - **Automatic schema discovery** eliminates development friction - **Cross-type analytics** reveal hidden insights across heterogeneous data - **Vector-ready architecture** supports AI/ML integration out-of-the-box - **Neo4j foundation** ensures enterprise-grade performance and reliability This architecture positions applications for future scalability challenges while maintaining development velocity—a critical balance for modern data-driven applications. ### Industry Impact and Adoption Patterns **Enterprise Adoption Drivers:** - **Digital transformation initiatives** requiring flexible data models - **Real-time personalization** demanding sub-second query performance - **Regulatory compliance** needing complete data lineage and audit trails - **AI/ML integration** requiring rich contextual features for model training **Technology Integration Trends:** - **Graph + Vector databases** for semantic search and recommendation systems - **Graph + Time series** for IoT and operational analytics platforms - **Graph + Document stores** for content management and knowledge systems - **Graph + Event streaming** for real-time fraud detection and monitoring ## Key Takeaways: Graph Database Architecture Selection Guide ### Architecture-Specific Recommendations **1. Property Graphs: The Application Developer's Choice** - **Ideal for**: Web applications, mobile backends, content management systems - **Key advantage**: Intuitive data modeling matching object-oriented programming - **Performance profile**: Scales with query complexity, not database size - **Development velocity**: Rapid prototyping with flexible schema evolution **2. RDF Triple Stores: The Semantic Integration Standard** - **Ideal for**: Research platforms, government data, enterprise knowledge management - **Key advantage**: Global interoperability through standardized ontologies - **Performance profile**: Optimized for reasoning and inference operations - **Development complexity**: Higher learning curve but standards-compliant outcomes **3. Knowledge Graphs: The AI/ML Data Foundation** - **Ideal for**: Recommendation engines, fraud detection, customer 360 platforms - **Key advantage**: Entity resolution and contextual understanding - **Performance profile**: Balanced read/write with inference capabilities - **Integration strength**: Native support for machine learning feature engineering **4. Labeled Property Graphs: The Enterprise Performance Choice** - **Ideal for**: High-scale transactional systems, real-time analytics platforms - **Key advantage**: Type safety with index optimization through labels - **Performance profile**: Excellent query performance with constraint enforcement - **Operational benefits**: Clear schema governance and data quality controls **5. Labeled Meta Property Graphs (LMPG): The Schema-Free Innovation** - **Ideal for**: Rapid development, cross-domain analytics, insight discovery platforms - **Key advantage**: Properties as first-class citizens enabling unprecedented query flexibility - **Performance profile**: Property-centric traversals with automatic optimization - **Development benefits**: Zero-configuration schema evolution with cross-type analysis ### Selection Decision Matrix | Factor | Property Graph | RDF/Triple Store | Knowledge Graph | LPG | LMPG (RushDB) | |--------|---------------|------------------|-----------------|-----|---------------| | **Development Speed** | ⭐⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | | **Schema Flexibility** | ⭐⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | | **Query Performance** | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | | **Semantic Reasoning** | ⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ | | **AI/ML Integration** | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | | **Standards Compliance** | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | | **Enterprise Readiness** | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ### Strategic Implementation Recommendations **For Startups and Rapid Development:** - Start with LMPG (RushDB) for maximum development velocity - Migrate to LPG (Neo4j) as schemas stabilize and performance requirements increase - Consider knowledge graphs for AI-driven features and recommendation systems **For Enterprise Applications:** - Begin with Labeled Property Graphs for proven scalability and operational maturity - Integrate RDF for semantic interoperability and compliance requirements - Implement knowledge graphs for customer intelligence and advanced analytics **For Research and Academic Projects:** - Prioritize RDF triple stores for semantic web compatibility and reasoning capabilities - Use knowledge graphs for multi-institutional data sharing and collaboration - Consider property graphs for performance-critical computational research The graph database revolution represents more than a technology shift—it's a fundamental reimagining of how applications model, store, and query interconnected data. Whether you choose traditional property graphs, semantic RDF systems, or innovative LMPG architectures, you're positioning your applications for a future where data relationships drive business value and competitive advantage. The days of forcing graph-like data into relational table structures are ending. Modern graph databases offer the performance, flexibility, and semantic understanding required for next-generation applications. Choose the architecture that aligns with your team's expertise, development timeline, and long-term scalability requirements—then start building the connected future your data deserves. --- ## Backendless Fullstack Development: React useForm + RushDB Canonical URL: https://rushdb.com/blog/backendless-fullstack-development-react-useform-rushdb Published: 2025-06-26T15:42:00.000Z Updated: 2026-11-06T05:23:15.092Z Tags: tutorial, typesript, fullstack, useForm, ReactJS, React, React Hook Form # Backendless Fullstack Development: React useForm + RushDB > **TL;DR:** This example shows how to build a full-stack application using React Hook Form + RushDB with zero schema setup, backend efforts or data normalization. [View the complete source code](https://github.com/rush-db/examples/tree/main/v2/vite-react-useForm). In modern web development, we often spend more time dealing with data modeling, normalization, and database migrations than on the actual business logic that drives our applications. What if we could skip all of that and focus solely on the shape of our data and the user experience? This article explores how combining React Hook Form with RushDB creates a powerful, backendless approach to fullstack development that eliminates the traditional complexity of working with form data. ## The Traditional Form Submission Flow Let's consider what typically happens when building a form in a web application: 1. Define database schema/migrations 2. Create models with proper validation 3. Build controllers to handle data transformation 4. Set up services to process business logic 5. Design a REST API to connect your frontend 6. Implement API calls from your frontend form 7. Normalize nested data before storing it This approach requires maintaining multiple data representations across your stack, writing repetitive boilerplate code, and continuously synchronizing changes between layers. Even with ORMs and other tools, the complexity remains significant. ## The Backendless Approach with RushDB RushDB offers a radically different approach by providing a graph database that: 1. Accepts any JSON structure directly 2. Automatically normalizes nested objects into a graph 3. Requires zero schema setup or migrations 4. Preserves the exact shape of your data This means you can take your form data exactly as it is structured in your frontend and store it directly without any transformation or normalization. ## Let's See It In Action Let's examine a comprehensive form implementation using React Hook Form with Zod validation and RushDB for storage. ### 1. Setting Up RushDB First, we initialize the RushDB client: ```typescript // db.ts import { RushDB } from "@rushdb/javascript-sdk"; // Initialize RushDB export const db = new RushDB(env.RUSHDB_API_TOKEN); ``` That's it! No schema definitions, no models, no complex setup. You can get a free API token by signing up at [app.rushdb.com](https://app.rushdb.com). For more information on getting started, see the [official documentation](https://docs.rushdb.com/get-started/get-api-token). ### 2. Defining Our Form Schema We use Zod to define the validation schema for our form: ```typescript // Form validation schema const formSchema = z.object({ // Personal Information firstName: z.string().min(2, "First name must be at least 2 characters"), lastName: z.string().min(2, "Last name must be at least 2 characters"), email: z.string().email("Invalid email address"), phone: z.string().min(10, "Phone number must be at least 10 digits"), dateOfBirth: z.string().min(1, "Date of birth is required"), // Address Information (nested object) address: z.object({ street: z.string().min(5, "Street address is required"), city: z.string().min(2, "City is required"), state: z.string().min(2, "State is required"), zipCode: z.string().min(5, "ZIP code must be at least 5 characters"), country: z.string().min(2, "Country is required"), }), // Professional Information company: z.string().min(2, "Company name is required"), position: z.string().min(2, "Position is required"), experience: z.enum(["entry", "junior", "mid", "senior", "lead", "executive"]), salary: z.number().min(0, "Salary must be a positive number"), skills: z.array(z.string()).min(1, "At least one skill is required"), // Preferences (nested object with boolean values) preferences: z.object({ newsletter: z.boolean(), notifications: z.boolean(), publicProfile: z.boolean(), dataSharing: z.boolean(), }), // Additional Information bio: z.string().max(500, "Bio must be less than 500 characters"), website: z.string().url("Invalid URL").optional().or(z.literal("")), linkedIn: z.string().url("Invalid LinkedIn URL").optional().or(z.literal("")), github: z.string().url("Invalid GitHub URL").optional().or(z.literal("")), }); type FormData = z.infer; ``` Notice how we naturally represent the form data with nested objects and arrays - this matches exactly how we think about the data in our application. ### 3. Submitting Form Data to RushDB The most remarkable part is how we handle form submission: ```typescript const onSubmit = async (data: FormData) => { try { // Save to RushDB await db.records.createMany({ label: "FORM_DATA", data }); reset(); // Reset form after successful submission } catch (error) { // .. } finally { // .. } }; ``` That's it! Just a single API call to store the entire form data, including nested objects and arrays, without any normalization or transformation. ![Network Request with Plain JSON Data - Send your complete form data directly to RushDB without any preprocessing or transformation steps](https://rushdb-public.s3.eu-central-1.amazonaws.com/blog/react-useForm-rushdb-example/plain-data-in-request-min.png) _Network request contains the raw form data that gets sent to RushDB. Notice how the nested structure stays intact with no transformation required._ ## What's Happening Behind the Scenes? When you submit the form data to RushDB: 1. The entire JSON structure is accepted as-is 2. Nested objects (like `address` and `preferences`) are automatically normalized into separate nodes in the graph 3. Array items (like `skills`) are stored as a normal [Property](https://docs.rushdb.com/concepts/properties) of `FORM_DATA` Record 4. The original structure is preserved for querying later RushDB handles all the complexity of storing a deeply nested object structure while maintaining the relationships between entities. ![3D Graph View of Form Data in RushDB - Each node represents a part of your form data with clear relationships between them](https://rushdb-public.s3.eu-central-1.amazonaws.com/blog/react-useForm-rushdb-example/graph-view-3d-min.png) _The 3D graph visualization shows how RushDB has automatically normalized your form data into a graph structure. Each node represents an entity from your form, and the edges show the relationships between them._ ![Table View of Form Data - The same information is also accessible in a familiar tabular format for easy querying](https://rushdb-public.s3.eu-central-1.amazonaws.com/blog/react-useForm-rushdb-example/table-view-min.png) _Despite being stored as a graph, RushDB also provides this familiar table view of your data. This makes it easy to query and analyze your data in a familiar way._ ## Benefits of This Approach ### 1. Zero Backend Complexity No need to: - Define schemas or migrations - Create models or DTOs - Build controllers and services - Normalize data manually ### 2. Preserve Natural Data Structures - Store data in the same shape as your application thinks about it - No need to flatten nested objects - Arrays are handled seamlessly ### 3. Full-Stack Type Safety - Your Zod schema generates TypeScript types that can be used throughout your application - The same types work for both form validation and data storage ### 4. Rapid Development - Focus on business logic and UX, not database structure - Iterate quickly without worrying about schema changes - Add new fields without migrations ## Querying the Data One of the most powerful aspects of RushDB is its ability to query this complex data structure easily. For example, finding all form submissions from senior engineers: ```typescript const seniorEngineers = await db.records.find({ labels: ["FORM_DATA"], where: { experience: "senior", position: { $contains: "Engineer" }, }, }); ``` Or finding all users who have subscribed to the newsletter and have JavaScript skills: ```typescript const subscribedJsDevelopers = await db.records.find({ labels: ["FORM_DATA"], where: { preferences: { newsletter: true, }, skills: { $contains: "JavaScript" }, }, }); ``` ## Conclusion The combination of React Hook Form for frontend validation and RushDB for data storage creates a powerful backendless approach to full-stack development. It allows you to focus on what really matters - the shape of your data and the user experience - without getting bogged down in database schemas, normalization, and complex backend architectures. This approach is particularly well-suited for: - Rapid prototyping and MVP development - Applications with complex, nested data structures - Teams looking to reduce backend complexity - Projects where the data model is evolving rapidly By removing the traditional backend complexity, you can build sophisticated applications faster and with less code. RushDB's ability to handle nested JSON structures directly means you can model your data in the most natural way for your application without worrying about how it will be stored. For more information about RushDB's capabilities, check out the [official documentation](https://docs.rushdb.com) and explore the [examples repository](https://github.com/rush-db/examples). --- **Source Code:** The complete example from this article is available at [github.com/rush-db/examples/tree/main/v2/vite-react-useForm](https://github.com/rush-db/examples/tree/main/v2/vite-react-useForm) --- ## Self-Hosted RushDB: Quick Setup Canonical URL: https://rushdb.com/blog/rushdb-selfhosted-quick-setup Published: 2025-02-22T06:49:00.000Z Updated: 2025-06-17T16:12:27.557Z Tags: database, graph database, neo4j, NoSQL, developer tools, docker, instant database, docker-compose # Self-Hosted RushDB: Quick Setup ## Introduction **RushDB** is an instant database that lets you work with any data structure without creating a schema first. You can push any data, and RushDB will automatically connect records, detect data types, and provide high-performance search. You can also create or manage relationships manually for more control. RushDB helps you focus on your application logic without worrying about a complex schema or table design. --- ### Key Features - **Zero Configuration** – Just push any JSON or CSV; RushDB automatically suggests types, normalizes data, and labels relationships - all on the fly. - **Graph-Powered Storage** – Automatically structures relationships between data. - **ACID Transactions** – Ensures consistency and reliability. - **Powerful Yet Simple Querying** – RushDB eliminates the gap between how you perceive data and how you query it, making data retrieval frictionless and natural - so you can focus on shipping products, not syntax. - **Self-Hosted or Cloud** – Deploy anywhere with ease, or choose RushDB Cloud. Start building in under 30 seconds. - **SDK-like DX Even for REST API** – Enjoy a seamless developer experience with an intuitive, structured API that feels like an SDK, minimizing boilerplate and complexity. --- ## Article Overview This article explains how to get started with **RushDB**. We will show two main ways to connect: - **Cloud**: The quickest method to start using RushDB. Ideal for trying out small projects or prototypes. - **Self-Hosted**: Gives you more control and is suitable for production environments. If you want to explore the **Cloud** option, follow a few steps in the [official docs](https://docs.rushdb.com/get-started/quick-tutorial). This guide will focus on the **Self-Hosted** setup. ## Before You Begin To run RushDB in **Self-Hosted** mode, we recommend using **Docker**. Docker helps you avoid manual installations or OS-related issues. 1. **Make sure Docker is installed** - For Windows or macOS, download [Docker Desktop](https://www.docker.com/get-started/). - For Linux, follow [these instructions](https://www.docker.com/get-started/). 2. **Verify Docker installation** - Run `docker --version` in your terminal to confirm Docker is working. ```bash $ docker --version Docker version 27.3.1, build ce12230 ``` ## Self-Hosted with Neo4j Aura RushDB stores data in [Neo4j](https://neo4j.com/). One simple option is **Neo4j Aura**, the cloud version of Neo4j. It has a free tier for small use. ### Steps to set up: 1. **Register an account on Neo4j Aura**\ Go to [Neo4j Aura](https://neo4j.com/product/auradb/) and create a free instance.\ For more details, see [Neo4j Aura docs](https://neo4j.com/docs/aura/classic/platform/create-account/) or this [Medium article](https://medium.com/@_jalakoo_/getting-started-with-neo4j-6bbeece974e3). 2. **Get your Neo4j credentials** - After creating your Aura instance, note the `username`, and `password`. ![Neo4j Aura Instance username & password](https://rushdb-public.s3.eu-central-1.amazonaws.com/blog/rushdb-selfhosted-quick-setup/neo4j-aura-instance.png) - After you download the credentials, the instance will be mounted, and you can copy instance `URI` or find it in the downloaded credentials from previous step: ![Neo4j instance url](https://rushdb-public.s3.eu-central-1.amazonaws.com/blog/rushdb-selfhosted-quick-setup/neo4j-aura-instance-url.png) 3. **Run RushDB in Docker**\ Replace the sample values with your credentials: ```bash docker run -p 3000:3000 \ --name rushdb \ -e NEO4J_URL='neo4j+s://1234567.databases.neo4j.io' \ -e NEO4J_USERNAME='neo4j' \ -e NEO4J_PASSWORD='password' \ rushdb/platform ``` `NEO4J_URL`, `NEO4J_USERNAME`, and `NEO4J_PASSWORD` must match your Aura instance settings. After installation, if you're using Docker Desktop, you can see installed container here: ![RushDB Container](https://rushdb-public.s3.eu-central-1.amazonaws.com/blog/rushdb-selfhosted-quick-setup/rushdb-container-added.png) You also can run some RushDB CLI commands inside docker container.\ [Learn more in the docs](https://docs.rushdb.com/tutorials/local-setup) 3. **Access RushDB** - RushDB will be available at http://localhost:3000. - Go there to open the RushDB Dashboard. 4. **Create a project and get an API token** - In the Dashboard, make a new user, and a new project. - Copy the generated API token for later use.\ [Learn more in the docs](https://docs.rushdb.com/tutorials/local-setup) 5. **Use the token in your code**\ Below is an example using Python and JavaScript/TypeScript SDKs. ```sdk from rushdb import RushDB db = RushDB( "RUSHDB_API_TOKEN", base_url="http://localhost:3000" ) db.records.create_many( "COMPANY", { "name": "Google LLC", "address": "1600 Amphitheatre Parkway, Mountain View, CA 94043, USA", "foundedAt": "1998-09-04T00:00:00.000Z", "rating": 4.9, "DEPARTMENT": [ { "name": "Research & Development", "description": "Innovating advanced technologies for AI and cloud computing.", "PROJECT": [ { "name": "Bard AI", "description": "A cutting-edge model for language understanding.", "active": True, "budget": 1200000000, "EMPLOYEE": [ { "name": "Jeff Dean", "position": "Head of AI Research", "email": "jeff@google.com", "salary": 3000000 } ] } ] } ] } ) ___SPLIT___ import RushDB from '@rushdb/javascript-sdk'; const db = new RushDB("RUSHDB_API_TOKEN", { url: "http://localhost:3000", }); await db.records.createMany({ label: "COMPANY", data: { name: 'Google LLC', address: '1600 Amphitheatre Parkway, Mountain View, CA 94043, USA', foundedAt: '1998-09-04T00:00:00.000Z', rating: 4.9, DEPARTMENT: [{ name: 'Research & Development', description: 'Innovating advanced technologies for AI and cloud computing.', PROJECT: [{ name: 'Bard AI', description: 'A cutting-edge model for language understanding.', active: true, budget: 1200000000, EMPLOYEE: [{ name: 'Jeff Dean', position: 'Head of AI Research', email: 'jeff@google.com', salary: 3000000 }] }] }] } }); ``` ## Local Neo4j Container If you do not want to use Neo4j Aura, you can launch Neo4j locally: 1. **Create a Docker network (optional, for easy linking):** ```bash docker network create rushdb-service ``` 2. **Start Neo4j:** ```bash docker run -d --name neo4j \ --network rushdb-service \ -p 7474:7474 \ -p 7687:7687 \ -e NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \ -e NEO4J_AUTH=neo4j/password \ -e NEO4J_PLUGINS='["apoc"]' \ --health-cmd="wget --no-verbose --tries=1 --spider localhost:7474 || exit 1" \ --health-interval=5s \ --health-retries=30 \ --health-start-period=10s \ neo4j:5.25.1 ``` 3. **Run RushDB:** ```bash docker run -d --name rushdb \ --network rushdb-service \ -p 3000:3000 \ -e NEO4J_URL=bolt://neo4j \ -e NEO4J_USERNAME=neo4j \ -e NEO4J_PASSWORD=password \ rushdb/platform ``` 4. **Docker Compose (recommended)**\ - You can use a docker-compose.yml file to run both Neo4j and RushDB together: ```yaml version: '3.8' services: rushdb: image: rushdb/platform container_name: rushdb depends_on: neo4j: condition: service_healthy ports: - "3000:3000" environment: - NEO4J_URL=bolt://neo4j - NEO4J_USERNAME=neo4j - NEO4J_PASSWORD=password neo4j: image: neo4j:5.25.1 healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1" ] interval: 5s retries: 30 start_period: 10s ports: - "7474:7474" - "7687:7687" environment: - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes - NEO4J_AUTH=neo4j/password - NEO4J_PLUGINS=["apoc"] ``` - Then start everything with: ```bash docker-compose up -d ``` 5. **Check RushDB Dashboard:** - By default, RushDB is on http://localhost:3000. - You can create a project, generate a token, and use it the same way as before. [Learn more how to set up Docker Compose](https://docs.docker.com/compose/install/) ## Conclusion In this article, we learned how to run RushDB Self-Hosted in two ways: - **With Neo4j Aura** (a hosted cloud database with a free tier) - **With a local Neo4j container** (complete control in your environment) Self-hosting is useful for full-scale projects and production scenarios. You have more flexibility and can customize your environment. For smaller or hobby projects, you can try RushDB Cloud, which is the fastest way to start with RushDB without managing Neo4j yourself. ## Useful Links - [Official RushDB Documentation](https://docs.rushdb.com/) - [Neo4j Aura Free Tier](https://neo4j.com/product/auradb/) - [Docker Setup and Installation](https://www.docker.com/get-started/) - [Docker Compose Documentation](https://docs.docker.com/compose/install/) - [RushDB GitHub Issues](https://github.com/rush-db/rushdb/issues) --- ## Introducing RushDB: Zero-Config Instant Database for Modern Apps & AI Era Canonical URL: https://rushdb.com/blog/rushdb-the-zero-config-database-for-modern-apps-and-ai-solutions Published: 2025-02-17T13:57:00.000Z Updated: 2025-06-22T12:29:17.170Z Tags: database, graph database, NoSQL, developer tools, data normalization, instant database # Introducing RushDB: Zero-Config Instant Database for Modern Apps & AI Era In today's fast-paced development landscape, managing databases shouldn't slow you down. **RushDB** is a **zero-config, graph-powered instant database** designed to streamline data ingestion, normalization, and querying. Built for **modern apps, AI, and DS/ML workflows**, it offers automatic schema handling, ACID compliance, and a seamless developer experience. Forget rigid schemas and manual indexing - RushDB lets you **push raw JSON or CSV**, automatically structures relationships, and optimizes queries **on the fly**. Whether you're building SaaS, AI models, or large-scale data applications, RushDB accelerates your workflow so you can focus on innovation, not infrastructure. ## Why RushDB? Traditional databases slow teams down with complex setup, rigid schemas, and manual optimizations. We've seen firsthand how data management creates unnecessary friction, delaying feature development and forcing engineers to wrestle with infrastructure instead of shipping great products. RushDB removes these barriers entirely by blending the best of both worlds - the freedom of writing data like MongoDB and the structured flattening of SQL. It automates data normalization, optimizes queries on the fly, and eliminates the need for manual indexing or schema design. The result? A frictionless developer experience that lets you focus on building, scaling, and delivering value—without getting stuck in database operations. ### How RushDB Unlocks Developer Productivity - **Zero Configuration** – Just push any JSON or CSV; RushDB automatically suggests types, normalizes data, and labels relationships - all on the fly. - **Graph-Powered Storage** – Automatically structures relationships between data. - **ACID Transactions** – Ensures consistency and reliability. - **Powerful Yet Simple Querying** – RushDB eliminates the gap between how you perceive data and how you query it, making data retrieval frictionless and natural - so you can focus on shipping products, not syntax. - **Self-Hosted or Cloud** – Deploy anywhere with ease, or choose RushDB Cloud. Start building in under 30 seconds. - **SDK-like DX Even for REST API** – Enjoy a seamless developer experience with an intuitive, structured API that feels like an SDK, minimizing boilerplate and complexity. ## Use Cases ### SaaS & Apps RushDB is perfect for modern SaaS applications requiring **fast, schema-less data ingestion and querying**. ### AI & ML Research With its **graph-powered** structure, RushDB simplifies working with interconnected datasets, making it ideal for **AI-driven applications**. ### IoT & Search Engines RushDB efficiently stores and retrieves **large-scale IoT data** and **searchable content** with built-in indexing. ## Key Features ### 1. Accepts Any JSON, JSONB, and CSV Data RushDB allows developers to push raw JSON or CSV data without worrying about schema definitions. RushDB **automatically normalizes data** and structures it as a graph, making queries fast and intuitive. #### Create Record ```sdk from rushdb import RushDB db = RushDB("RUSHDB_API_TOKEN") data = { "name": "Google LLC", "address": "1600 Amphitheatre Parkway, Mountain View, CA 94043, USA", "foundedAt": "1998-09-04T00:00:00.000Z", "rating": 4.9 } record = db.records.create("COMPANY", data) ___SPLIT___ const db = new RushDB('RUSHDB_API_TOKEN'); const data = { name: 'Google LLC', address: '1600 Amphitheatre Parkway, Mountain View, CA 94043, USA', foundedAt: '1998-09-04T00:00:00.000Z', rating: 4.9 } const record = await db.records.create({label: "COMPANY", data}) ``` #### Query Records ```sdk query = { "labels": ["COMPANY"], "where": { "name": {"$contains": "Goog"}, "rating": {"$gte": 4} } } records = db.records.find(query) ___SPLIT___ const records = await db.records.find({ labels: ['COMPANY'], where: { name: { $contains: 'Goog' }, rating: { $gte : 4 } } }) ``` [Learn more in the docs](https://docs.rushdb.com/concepts/search/introduction) ### 2. Automatic Data Normalization and Type Inference RushDB takes raw input data and **automatically structures it** into a connected graph, allowing for seamless navigation across relationships. #### Example JSON data ```json /* ORDER */ { "total": 109.98, <-- PROPERTY total:`number` "status": "processing", <-- PROPERTY status:`string` "placedAt": "2025-02-15T09:35:26+00:00", <-- PROPERTY placedAt:`datatime` "SHIPPING": { <-- RECORD :SHIPPING "address": "123 Main St, City, Country", <-- PROPERTY address:`string` "method": "express", <-- PROPERTY method:`string` "cost": 9.99 <-- PROPERTY cost:`number` } } ``` Above payload will be automatically normalized into separate **flat** Records. And relationship between ORDER and SHIPPING will be created automatically. [Learn more in the docs](https://docs.rushdb.com/concepts/properties) ### 3. Relationships RushDB automatically creates relationships between Records based on JSON input, which is normalized into separate flat Records. However, relationship creation isn't limited to data loading. You can also establish relationships between existing Records, providing a powerful tool to add more meaning to your data. Managing Relationships: ```sdk project = db.records.create( "PROJECT", {"name": "Secret Project", "budget": 1000000} ) employee = db.records.create( "EMPLOYEE", {"name": "Nikola Tesla"} ) options = RelationshipOptions(type="HAS_EMPLOYEE") # create Relationship project.attach(employee, options) # deleteById Relationship project.detach(employee) ___SPLIT___ const project = await db.records.create({ label: 'PROJECT', data: { name: 'Secret Project', budget: 1000000 } ) const employee = await db.records.create({ label: 'EMPLOYEE', data: { name: 'Nikola Tesla' } ) // create Relationship await project.attach(employee, { type: 'HAS_EMPLOYEE' }) // deleteById Relationship await project.detach(employee) ``` [Learn more in the docs](https://docs.rushdb.com/concepts/properties) ### 4. Query Smarter, Not Harder Effortlessly find exactly what you need. With automated, on-the-fly data normalization, you can query complex, deeply interconnected data without workarounds or unnecessary overhead - just clear, intuitive access to your data. #### Examples ```sdk db.records.find( { "labels": ["COMPANY"], "where": { "stage": "seed", "address": {"$contains": "USA"}, "foundedAt": {"$lte": {"$year": 2000}}, "rating": { "$or": [{"$lt": 2.5}, {"$gte": 4.5}] }, "EMPLOYEE": { "$relation": {"type": "HIRED", "direction": "out"}, "$alias": "$employee", "salary": { "$gte": 500_000 } }, }, "aggregate": { "employees": { "fn": "collect", "alias": "$employee", "limit": 10 } }, "skip": 0, "limit": 100 } ) ___SPLIT___ await db.records.find({ labels: ['COMPANY'], where: { stage: 'seed', address: { $contains: 'USA' }, foundedAt: { $lte: { $year: 2000 } }, rating: { $or: [{ $lt: 2.5 }, { $gte: 4.5 }] }, EMPLOYEE: { $relation: { type: 'HIRED', direction: 'out' }, $alias: '$employee', salary: { $gte: 500_000 } } }, aggregate: { employees: { fn: 'collect', alias: '$employee', limit: 10 } }, skip: 0, limit: 100 }) ``` Under the hood, RushDB transforms this into an optimized and powerful Cypher query. The query engine allows developers to think about data naturally, the way we intuitively use and perceive it, while RushDB handles the complexity behind the scenes: ```cypher MATCH (record:__RUSHDB__LABEL__RECORD__:COMPANY { __RUSHDB__KEY__PROJECT__ID__: $projectId }) WHERE (any(value IN record.stage WHERE value = "seed")) AND (any(value IN record.address WHERE value =~ "(?i).*USA.*")) AND (any(value IN record.foundedAt WHERE apoc.convert.fromJsonMap(`record`.`__RUSHDB__KEY__PROPERTIES__META__`).`foundedAt` = "datetime" AND datetime(value) <= datetime({year: 2000}))) AND ((any(value IN record.rating WHERE value < 2.5) OR any(value IN record.rating WHERE value >= 4.5))) ORDER BY record.`__RUSHDB__KEY__ID__` DESC SKIP 0 LIMIT 100 OPTIONAL MATCH (record)-[:HIRED]->(record1:EMPLOYEE) WHERE (any(value IN record1.salary WHERE value >= 500000)) WITH record, record1 WHERE record IS NOT NULL AND record1 IS NOT NULL WITH record, apoc.coll.sortMaps(collect(DISTINCT record1 { .*, __RUSHDB__KEY__LABEL__: [label IN labels(record1) WHERE label <> "__RUSHDB__LABEL__RECORD__"][0] }), "__RUSHDB__KEY__ID__")[0..10] AS `employees` RETURN collect(DISTINCT record { __RUSHDB__KEY__ID__: record.__RUSHDB__KEY__ID__, __RUSHDB__KEY__PROPERTIES__META__: record.__RUSHDB__KEY__PROPERTIES__META__, __RUSHDB__KEY__LABEL__: [label IN labels(record) WHERE label <> "__RUSHDB__LABEL__RECORD__"][0], `employees` }) AS records ``` [Learn more in the docs](https://docs.rushdb.com/concepts/search/introduction) ### 5. Transactions RushDB is fully ACID-compliant, providing robust tools to ensure data consistency and reliability. With the Transactions API, you can execute multiple operations confidently - either every request completes successfully, or all changes are rolled back, maintaining data integrity. Working with transactions in RushDB is seamless: ```sdk tx = db.transactions.begin() try: # Create some Records item = db.records.create( "ITEM", {"title": "Nike Air Max 270", "price": 150}, transaction=tx, ) owner = db.records.create( "OWNER", {"name": "Jane Smith", "email": "janesmith@example.com"}, transaction=tx ) options = RelationshipOptions(type="OWN", direction="out") # create Relationship owner.attach(item, options, transaction=tx) # Simulate an error raise ValueError("Simulated error") # Commit the Transaction if all operations succeed tx.commit(); except ValueError: # If any records or relationships creation failed, roll back the entire operation transaction.rollback() ___SPLIT___ const tx = await db.tx.begin(); try { // Create some Records const item = await db.records.create({ label: 'ITEM', data: { title: 'Nike Air Max 270', price: 150 } }, tx); const owner = await db.records.create({ label: 'OWNER', data: { name: 'Jane Smith', email: 'janesmith@example.com' } }, tx); // create Relationship await owner.attach(item, { type: 'OWN', direction: 'out', }, tx); // Simulate an error throw new Error('Simulated error') // Commit the Transaction if all operations succeed await tx.commit(); } catch (e) { // If any Records or Relationships creation failed, roll back the entire operation await tx.rollback(); } ``` [Learn more in the docs](https://docs.rushdb.com/concepts/transactions) ### 6. Properties: Lightweight Connectors That Unify Your Data Minimal data overhead, maximum impact—RushDB’s **Properties** system enables developers to build best-in-class search experiences while unlocking deeper insights from their data. Properties act as intelligent containers that links Records, connecting fields with the same name and type across different data entities. For example, if multiple Records - regardless of Label - share a `color` property with the value `red`, RushDB will automatically surface all relevant Records. It’s like querying across multiple SQL tables by a common field and value, but without the complexity. This makes **Properties** a powerful tool for data discovery, search, and seamless cross-entity relationships. #### Example ```sdk query = { "where": { "color": "red" } } records = db.records.find(query) ___SPLIT___ const records = await db.records.find({ where: { color: 'red' } }) ``` Moreover, with the Properties API, building advanced search experiences is straightforward. Developers can seamlessly query related Records across different entities without complex joins or manual indexing. Whether you're implementing faceted search, dynamic filtering, or personalized recommendations, RushDB ensures your data remains connected and instantly accessible. ```sdk # Property `name` [string] db.properties.values( "0192397b-8579-7ce2-a899-01c59bad63f8" ) # Response { "values": [ "Eleanor Whitaker", "Marcus Donovan", "Priya Kapoor", "Julian Alvarez" ], "type": "string" } # Property \`size\` [number] db.properties.values( "019412c0-2051-71fe-bc9d-26117b52c119" ) # Response { "min": 5.5, "max": 12.5, "values": [5.5, 6, 6.5, 7, 7.5, 8, 8.5, ...], "type": "number" } ___SPLIT___ // Property `name` [string] await db.properties.values( '0192397b-8579-7ce2-a899-01c59bad63f8' ) // Response { values: [ 'Eleanor Whitaker', 'Marcus Donovan', 'Priya Kapoor', 'Julian Alvarez' ], type: 'string' } // Property \`size\` [number] await db.properties.values( '019412c0-2051-71fe-bc9d-26117b52c119' ) // Response { min: 5.5, max: 12.5, values: [5.5, 6, 6.5, 7, 7.5, 8, 8.5, ...], type: 'number' } ``` [Learn more in the docs](https://docs.rushdb.com/concepts/properties) ### 7. A Universal API for the Entire Platform RushDB is built with a **query-centric** design, ensuring that most endpoints follow a consistent request format. This unified approach enhances developer experience by minimizing the learning curve - master one request structure, and you can apply it across the entire platform. At the core of RushDB are three key entities: **Record, Property, and Label**. All of them can be queried using the same **SearchQuery**, eliminating the need for backend data gymnastics. This means you can focus on building products without worrying about complex data handling - just query once and get exactly what you need, every time. ```sdk # Same DTO to rule them all query = { "where": { "$or": [{"stage": "seed"}, {stage: "roundA"}], "EMPLOYEE": { "salary": { "$gte": 500_000 } } } } # Find Labels of Records that match the criteria labels = db.labels.find(query) # Find Records that match the criteria records = db.properties.find(query) # Find Properties of Records that match the criteria properties = db.labels.find(query) ___SPLIT___ // Same DTO to rule them all const query = { where: { $or: [{ stage: 'seed' }, { stage: 'roundA' }], EMPLOYEE: { salary: { $gte: 500_000 } } } } // Find Labels of Records that match the criteria const labels = await db.labels.find(query) // Find Records that match the criteria const records = await db.records.find(query) // Find Properties of Records that match the criteria const properties = await db.properties.find(query) ``` ### 8. Powerful Dashboard: Control, Explore, and Query with Ease RushDB comes with a **feature-rich Dashboard** that gives you full control over your data, projects, and API access—all in an intuitive, developer-friendly UI. Whether you're a developer or a data-driven team, the dashboard makes exploring and managing your data effortless. #### **Key Features:** - **Intelligent Data Querying** – A seamless UI that fetches value variations for each filter, enabling precise searches—even for non-developers. Find exactly what you need with sniper precision. - **Graph View for Natural Exploration** – Visualize relationships the way you think about data, not just how it’s stored. Navigate your graph intuitively, without writing queries. - **Project-Based Isolation** – Each project is fully self-contained, allowing you to manage multiple independent datasets effortlessly. - **Instant Data Import** – Upload JSON or JSONB directly from the UI—no coding required. The fastest way to get started and familiarize yourself with RushDB. - **SearchQuery Preview** – Build queries visually with UI filters and easily reuse the generated configuration in your applications. - **More Features Coming Soon!** – We're continuously improving the dashboard to make data management even more seamless. ![RushDB Dashboard Graph View](https://rushdb-public.s3.eu-central-1.amazonaws.com/blog/rushdb-the-zero-config-database-for-modern-apps-and-ai-solutions/dashboard-preview-2.png) > records table view ![RushDB Dashboard Records](https://rushdb-public.s3.eu-central-1.amazonaws.com/blog/rushdb-the-zero-config-database-for-modern-apps-and-ai-solutions/dashboard-preview-1.png) > records graph view ### 9. Effortless Integration with REST API & SDKs RushDB offers a **powerful, intuitive REST API** that seamlessly integrates with your applications. The API is designed with **developer productivity** in mind, ensuring smooth interaction with your database using minimal code. Whether you're building a complex enterprise app or a lightweight microservice, the provided SDKs streamline operations, offering straightforward methods for creating, querying, and managing your graph data. The **SDK-level experience** allows developers to effortlessly connect to RushDB via popular programming languages, providing rich documentation and comprehensive examples to minimize friction during integration. ### 10. Flexible Deployment Options: Cloud or Self-Hosted RushDB is available in both **cloud** and **self-hosted setups**, giving you full control over your infrastructure while ensuring scalability and reliability. With the **cloud** version, you can quickly deploy and scale your database without worrying about maintenance, offering a fully managed, secure environment. Alternatively, the **self-hosted** version allows you to run RushDB on your own hardware, giving you the flexibility to customize configurations, maintain complete data control, and integrate with your existing infrastructure. ## Conclusion RushDB empowers developers by combining the best of both worlds—**zero-configuration graph databases** with **best-in-class developer experience**. Whether you're working with a cloud or self-hosted setup, RushDB offers unmatched flexibility, scalability, and ease of use, making it the go-to solution for modern applications. With an intuitive REST API and seamless SDK integration, you can focus on building innovative products, leaving the complexities of database management to RushDB. --- # CMS Pages ## RushDB Terms of Service Canonical URL: https://rushdb.com/terms-of-service Updated: 2026-11-02T18:49:39.115Z # RushDB Terms of Service Effective date: November 3, 2026 These Terms of Service ("Terms") govern your access to and use of RushDB websites, RushDB Cloud, app.rushdb.com, the RushDB API, SDKs, hosted MCP/OAuth functionality, and related services provided by Individual Entrepreneur Artemii Vereshchinskii, registered in the Republic of Armenia under state registration number 264.1331568, taxpayer identification number (TIN) 72997435 ("RushDB", "we", "us", or "our"). By using RushDB, you agree to these Terms. If you use RushDB on behalf of an organization, you represent that you have authority to bind that organization, and "you" includes that organization. ## 1. The Service RushDB is developer infrastructure for storing, indexing, querying, and managing connected data. The service may include: - hosted RushDB Cloud workspaces and projects; - APIs, SDKs, dashboard features, and project access controls; - records, labels, properties, relationships, search, semantic search, Smart Search, import/export, and graph features; - API tokens and OAuth/MCP authorization flows; - optional managed embeddings, relationship suggestions, and connector workflows; - billing, usage metering, spend caps, and account management features. Some features may be available only on certain plans, only in RushDB Cloud, only in self-hosted deployments, or only when configured with required third-party providers. ## 2. Accounts and Workspaces You must provide accurate account information and keep it current. You are responsible for: - maintaining the confidentiality of passwords, API keys, tokens, OAuth grants, and workspace invitations; - all activity under your account, workspace, projects, API keys, and authorized integrations; - ensuring that workspace members have appropriate roles and access; - promptly revoking access for users, agents, or integrations that no longer need it; - notifying us of unauthorized access or suspected credential compromise. We may require email confirmation or other verification before enabling some account features. ## 3. Customer Content "Customer Content" means data, records, text, files, labels, properties, relationships, embeddings, queries, connector data, prompts, outputs, and other materials that you submit to or generate through RushDB. You retain ownership of your Customer Content. You grant RushDB the rights necessary to host, process, transmit, store, index, analyze, query, display, and otherwise handle Customer Content solely to provide, secure, support, and improve the service and as otherwise permitted by these Terms. You are responsible for Customer Content, including: - ensuring you have the rights and legal basis to submit and process it; - ensuring it does not violate law, third-party rights, or these Terms; - deciding whether it contains personal data, confidential data, regulated data, or sensitive data; - configuring access controls, API keys, OAuth grants, connectors, and self-hosted infrastructure appropriately; - complying with your own privacy, security, retention, and compliance obligations. ## 4. Data Processing and Privacy Our Privacy Policy explains how we collect, use, share, and protect information. It is part of these Terms. For Customer Content that contains personal data, you are generally the controller or business, and RushDB is generally the processor or service provider when operating RushDB Cloud on your behalf. If you need a data processing addendum or subprocessor information for procurement or compliance review, contact us at hi@rushdb.com. ## 5. Acceptable Use You may not use RushDB to: - violate applicable law or third-party rights; - upload, store, process, or distribute unlawful, harmful, abusive, or infringing content; - attempt unauthorized access to RushDB, other customers' data, systems, networks, or accounts; - bypass authentication, authorization, rate limits, concurrency limits, spend caps, usage limits, or security controls; - probe, scan, or test the vulnerability of RushDB except through authorized security testing or responsible disclosure; - run denial-of-service attacks, spam, phishing, credential harvesting, malware, or abusive automation; - use the service to develop or operate systems that make unlawful or harmful decisions about people; - use RushDB in high-risk environments where failure could cause death, personal injury, or severe property or environmental damage unless we have agreed in writing; - resell, sublicense, or provide access to RushDB as a managed service for third parties unless your plan or written agreement allows it; - reverse engineer hosted service components except where applicable law prohibits this restriction. ## 6. API Keys, OAuth, MCP, and Integrations RushDB supports project API keys and OAuth/MCP flows. You are responsible for integrations you authorize and for all actions taken with your credentials or grants. You should: - use the least privileged access available; - rotate and revoke credentials when needed; - store credentials securely; - monitor integrations that can read from or write to projects; - ensure agents and external clients operate within your intended permissions. RushDB may revoke or disable credentials, sessions, OAuth grants, or integrations that appear compromised, abusive, expired, misconfigured, or in violation of these Terms. ## 7. Optional AI, Embedding, and Connector Features RushDB may support optional features that use embedding providers, language-model providers, or connector workers, including Smart Search and managed embeddings. These features may send selected Customer Content, schema metadata, labels, property names, relationship metadata, queries, or configuration details to the provider or worker needed to perform the requested operation. You are responsible for enabling these features only when you have the right to send the relevant data to the configured provider. In self-hosted deployments, you control the provider and connector configuration. RushDB does not guarantee that AI-generated queries, relationship suggestions, embeddings, summaries, or outputs will be accurate, complete, or suitable for your use case. You are responsible for reviewing outputs before relying on them. ## 8. Self-Hosted Deployments RushDB may provide open-source software, deployment templates, Docker images, Helm charts, documentation, and other materials for self-hosted use. The RushDB engine is licensed under Apache-2.0 and is free to self-host. For self-hosted deployments: - you are responsible for infrastructure, TLS, secrets, backups, access control, updates, monitoring, compliance, and provider configuration; - RushDB Cloud operational controls do not automatically apply to your self-hosted environment; - you must comply with the applicable open-source license and any separate commercial terms that apply; - we are not responsible for data loss, security incidents, or downtime caused by your self-hosted configuration. ## 9. Plans, Billing, and Usage RushDB Cloud offers a Free plan, paid plans (currently Pro and Team), and custom Enterprise contracts. Each plan includes allowances for stored data, Smart Searches, and managed-embedding tokens, plus limits on projects, seats, concurrent queries, and request rate. Current prices, allowances, and overage rates are published at https://rushdb.com/pricing and may change over time. We will give notice before a price change applies to an existing subscription. **Payments.** Our order process is conducted by our online reseller Paddle.com. Paddle.com is the Merchant of Record for all our orders. Paddle provides all customer service inquiries and handles returns. Purchases are also subject to Paddle's Checkout Buyer Terms. **Subscriptions.** Paid plans are billed in advance, monthly or annually, and renew automatically until cancelled. Extra seats and projects are billed as add-ons. Plan and add-on changes are prorated. You can cancel at any time from Billing in the dashboard; your plan stays active until the end of the paid period, then the workspace moves to the Free plan. **Usage beyond allowances.** On paid plans, usage above the included allowances (storage averaged over the usage window, Smart Searches, and managed-embedding tokens) is charged after each monthly usage window at the published rates. Each workspace has a spend cap, by default twice the monthly plan fee plus add-ons, which you can change or turn off. When the cap is reached, writes and AI actions pause until you raise the cap or the next window starts; reads keep working. On the Free plan, writes pause when storage is full and AI actions pause when their allowance is used; nothing is charged. **Taxes.** Prices are in USD and exclude taxes. Paddle adds VAT, sales tax, or similar taxes at checkout where applicable. **Refunds.** Refunds are governed by our Refund Policy at https://rushdb.com/refund-policy. Unless otherwise stated in a separate written agreement: - failure to pay may result in AI actions being paused, downgrade to the Free plan, suspension, or termination; - usage data shown in the dashboard may be delayed or approximate; the billed amount is calculated from our usage records at the end of each window. ## 10. Trials, Free Plans, and Beta Features Free plans, trials, previews, beta features, experimental features, and early-access functionality may be changed, limited, suspended, or discontinued at any time. We do not delete Free plan workspaces for inactivity. Beta and experimental features may be incomplete, unstable, inaccurate, or unsupported. Use them at your own risk and do not rely on them for critical production workloads unless we have agreed otherwise in writing. ## 11. Service Changes and Availability We may modify, suspend, discontinue, limit, or replace parts of the service. We may perform maintenance, apply updates, enforce limits, change APIs, or alter feature availability. We work to operate RushDB reliably, but we do not guarantee uninterrupted service unless a separate written agreement or a plan's published service level says otherwise. ## 12. Security RushDB uses technical and organizational measures designed to protect the hosted service. You are responsible for secure use of the service, including protecting credentials, configuring access, reviewing authorized integrations, and limiting sensitive Customer Content to what is appropriate for your use case. If you discover a vulnerability, contact hi@rushdb.com with enough information to reproduce and evaluate the issue. Do not access, modify, delete, or exfiltrate data that is not yours. Do not run denial-of-service testing or social engineering. ## 13. Compliance RushDB provides security and privacy information to support customer review. RushDB does not claim GDPR certification, SOC 2 certification, ISO 27001 certification, or EU AI Act certification unless we expressly publish that status or provide a report under a separate written agreement. You are responsible for determining whether RushDB is suitable for your legal, regulatory, procurement, and compliance requirements. Unless we agree in writing, you may not use RushDB to store or process data subject to specialized regulatory regimes requiring specific contractual terms or certifications, including protected health information under HIPAA, cardholder data under PCI DSS, classified information, export-controlled technical data, or government-regulated workloads. ## 14. Third-Party Services RushDB may interoperate with third-party services such as cloud infrastructure providers, OAuth providers, email providers, analytics providers, Paddle (payments), embedding providers, language-model providers, connector sources, and developer tools. Third-party services are governed by their own terms and policies. We are not responsible for third-party services, and we do not control their security, availability, processing, or output. ## 15. Intellectual Property RushDB and its software, websites, product designs, documentation, trademarks, logos, and service materials are owned by RushDB or its licensors and are protected by intellectual property laws. Subject to these Terms, we grant you a limited, non-exclusive, non-transferable right to use RushDB Cloud for your internal business or development purposes. Open-source components are licensed under their applicable open-source licenses. You may provide feedback or suggestions. We may use feedback without restriction or obligation to you. ## 16. Suspension and Termination You may stop using RushDB at any time. You may delete projects or request account or workspace deletion, subject to legal, security, billing, backup, and operational retention requirements. We may suspend or terminate access if: - you violate these Terms; - your use creates security, legal, operational, or abuse risk; - payment is overdue; - we must comply with law or third-party requirements; - continuing to provide the service would create risk for RushDB, customers, or the public. After termination, your access to the service may stop immediately. Customer Content may be deleted or retained according to our Privacy Policy, backup practices, and legal obligations. ## 17. Disclaimers RushDB is provided "as is" and "as available" except where a separate written agreement says otherwise. To the maximum extent permitted by law, we disclaim all warranties, express or implied, including warranties of merchantability, fitness for a particular purpose, title, non-infringement, availability, accuracy, and security. We do not warrant that: - the service will be uninterrupted, error-free, or free from vulnerabilities; - data will never be lost or corrupted; - search, semantic search, Smart Search, AI-assisted features, relationship suggestions, or connector outputs will be accurate or complete; - RushDB will satisfy every legal, regulatory, or procurement requirement for your use case. ## 18. Limitation of Liability To the maximum extent permitted by law, RushDB will not be liable for indirect, incidental, special, consequential, exemplary, or punitive damages; loss of profits, revenue, business, goodwill, data, or use; or the cost of substitute services. To the maximum extent permitted by law, RushDB's total liability for all claims relating to the service or these Terms will not exceed the greater of: - the amount you paid for the service giving rise to the claim during the three months before the event giving rise to liability; or - USD $100. Some jurisdictions do not allow certain limitations, so some of these limitations may not apply to you. ## 19. Indemnity You will defend, indemnify, and hold harmless RushDB from claims, damages, liabilities, losses, costs, and expenses, including reasonable attorneys' fees, arising from: - your Customer Content; - your use of RushDB in violation of these Terms or law; - your products, services, integrations, agents, or self-hosted deployments; - your violation of third-party rights; - your security, privacy, or compliance obligations. ## 20. Governing Law These Terms are governed by the laws of the Republic of Armenia, without regard to conflict-of-law rules. If you are a consumer, this does not deprive you of the protection of mandatory laws of the country where you live. The parties will try to resolve disputes informally first. If a dispute cannot be resolved informally, it will be brought before the competent courts of Yerevan, Armenia, unless applicable law requires another forum. ## 21. Changes to These Terms We may update these Terms from time to time. If we make material changes, we will update the effective date and provide notice where required. Your continued use of RushDB after changes become effective means you accept the updated Terms. ## 22. Contact Individual Entrepreneur Artemii Vereshchinskii State registration number: 264.1331568 TIN: 72997435 Republic of Armenia Email: hi@rushdb.com Billing: billing@rushdb.com Website: https://rushdb.com --- ## RushDB Privacy Policy Canonical URL: https://rushdb.com/privacy-policy Updated: 2026-11-02T18:49:32.483Z # RushDB Privacy Policy Effective date: November 3, 2026 This Privacy Policy explains how Individual Entrepreneur Artemii Vereshchinskii ("RushDB", "we", "us", or "our") collects, uses, shares, and protects information when you visit rushdb.com, use RushDB Cloud, use app.rushdb.com, interact with the RushDB API, or contact us. RushDB is developer infrastructure for storing and querying connected application data, graph records, semantic indexes, and agent memory. This policy describes how RushDB handles account data, workspace data, project data, customer content, product telemetry, and billing information. If you use self-hosted RushDB, you control the infrastructure where your self-hosted instance runs. This policy applies to RushDB-hosted websites and cloud services, not to data processing that happens only inside your own self-hosted deployment. ## Who We Are RushDB is operated by Individual Entrepreneur Artemii Vereshchinskii, registered in the Republic of Armenia under state registration number 264.1331568, taxpayer identification number (TIN) 72997435. Contact: hi@rushdb.com For security or privacy review requests, include your company name, workspace or project context if applicable, and the request type. ## Information We Collect ### Account information When you create or use a RushDB account, we may collect: - email address or login; - first and last name, when provided; - password hash for email/password accounts; - OAuth identifiers for Google or GitHub login, when you use those login methods; - email confirmation, password reset, and account status metadata; - account creation, edit, and last activity timestamps. RushDB does not store your plain-text account password. Passwords are hashed before storage. ### Workspace and project information RushDB Cloud stores information needed to operate workspaces and projects, including: - workspace names, member roles, and membership metadata; - workspace invitations and invited email addresses; - project names, descriptions, status, timestamps, and access lists; - API token metadata, including token name, description, scope or access level, expiration, and project association; - OAuth client, authorization request, consent, code, and refresh-token metadata for MCP/OAuth flows; - connector configuration and status metadata, when connectors are enabled. API token values are stored encrypted at rest in the platform database. OAuth refresh-token records are stored as hashed token identifiers. OAuth access tokens are time-limited. ### Customer content When you use RushDB Cloud or the RushDB API, you may submit, create, import, query, or delete records, labels, properties, relationships, files, text fields, semantic indexes, relationship suggestions, connector data, and other content inside a project ("Customer Content"). Customer Content may include personal data if you choose to store personal data in RushDB. You are responsible for deciding what Customer Content you submit to the service and for ensuring that you have the rights and legal basis to process it. RushDB processes Customer Content to provide the service, including: - storing and retrieving records; - creating and querying relationships; - indexing selected fields for search or semantic retrieval; - maintaining project schema metadata; - running customer-requested imports, exports, connector workflows, and deletion operations; - supporting MCP/OAuth access that you authorize for a project. ### Search, embedding, and AI-related processing RushDB supports optional Smart Search (natural-language queries), managed embeddings, semantic search, and relationship suggestions. When these features are used, the request text, project schema metadata (labels, property names, types, relationship metadata), selected text fields, or query context may be sent to the configured language-model or embedding provider to perform the requested operation. These features are optional and depend on the project, plan, or deployment configuration. In self-hosted deployments, the deployment operator controls the provider configuration. ### Billing and usage information For RushDB Cloud, we process the billing and usage information needed to manage plans, limits, subscriptions, usage charges, and customer support. This may include: - workspace ID and workspace name; - account or requester email; - plan, billing interval, subscription status, extra seats and projects, and spend-cap settings; - usage records: stored data size per project (sampled hourly), counts of Smart Searches, managed-embedding token counts, relationship-analysis runs, and the model token counts of AI requests; - the usage charges calculated for each usage window; - billing inquiry messages. Usage records contain counts and sizes, not the content of your records. **Payments.** Payments are handled by Paddle.com, which acts as Merchant of Record for our orders. When you subscribe, Paddle collects and processes your payment details, billing address, and tax information under its own privacy policy. We receive from Paddle the customer and subscription identifiers, the plan purchased, transaction status and amounts, and the country and email associated with the purchase. RushDB does not receive or store full payment card numbers. Billing records from subscriptions created before November 10, 2026 may include Stripe identifiers; we keep them only for accounting and legal purposes. ### Website and product analytics We use website and product analytics to understand how visitors and customers use RushDB, improve the product, measure conversion, and debug user flows. The website uses Google Tag Manager and Google Analytics-style events only after consent where required by our cookie banner and consent mode implementation. Analytics events may include page views, CTA clicks, documentation clicks, pricing plan clicks, signup-start events, blog interactions, language-switch events, and limited code-copy previews. We avoid intentionally sending sensitive Customer Content in analytics events. ### Cookies and local storage We use cookies and browser storage for authentication, administration sessions, preferences, consent choices, and analytics consent. Paddle uses cookies in checkout and its customer portal. For more detail, see our Cookie Policy at https://rushdb.com/cookie-policy. ### Communications If you contact us, request support, submit a billing inquiry, report a security issue, join a waitlist, or respond to our emails, we process the contact details and message content you provide. ## How We Use Information We use information to: - provide, operate, secure, and improve RushDB; - create and authenticate accounts; - manage workspaces, projects, roles, tokens, OAuth consents, and access control; - process Customer Content according to your API, dashboard, connector, or MCP/OAuth instructions; - measure usage, apply plan limits and spend caps, calculate usage charges, and provide billing, support, and administrative workflows; - send account, security, billing, product, and service communications; - detect, prevent, and investigate abuse, fraud, security incidents, and service misuse; - comply with legal obligations and enforce our Terms of Service; - analyze website and product usage, subject to consent where required. ## Legal Bases for Processing We process personal data in accordance with applicable data protection laws, including the Law of the Republic of Armenia on Protection of Personal Data and, where it applies, the GDPR. Our legal bases may include: - contract necessity, to provide RushDB Cloud and related services, including billing; - legitimate interests, such as securing the service, preventing abuse, improving the product, and communicating with customers; - consent, such as for optional analytics cookies or marketing communications where consent is required; - legal obligation, where we must retain or disclose information to comply with applicable law, including tax and accounting law. For Customer Content, RushDB usually acts as a processor or service provider on behalf of the customer. The customer is responsible for determining the lawful basis for the Customer Content they submit to RushDB. ## How We Share Information We do not sell Customer Content or personal data. We may share information with: - infrastructure, hosting, database, monitoring, analytics, email, authentication, and support providers used to operate RushDB; - Paddle, our payment provider and Merchant of Record, when you purchase or manage a paid plan; - OAuth providers such as Google or GitHub, when you choose those login methods; - language-model or embedding providers, only when optional features that require them are used; - professional advisors, auditors, accountants, or legal counsel where necessary; - authorities, courts, or other parties where required by law or necessary to protect rights, safety, security, or service integrity; - successors in connection with a merger, acquisition, financing, reorganization, or sale of assets. Current subprocessor details can be shared with customers during security or procurement review. ## International Data Transfers RushDB is operated from the Republic of Armenia. We and our service providers may process information in other countries, including countries outside your own. If personal data from the European Economic Area, United Kingdom, or Switzerland is transferred internationally, we use appropriate transfer mechanisms where required, such as standard contractual clauses or equivalent safeguards. ## Retention We retain information for as long as needed to provide RushDB, comply with legal obligations, resolve disputes, enforce agreements, prevent abuse, and maintain security. General retention practices include: - account, workspace, project, access, billing, and support records are retained while the account or workspace is active and for a reasonable period afterward; - Customer Content is retained until deleted by the customer, the project or workspace is deleted, or retention is otherwise required for legal, security, backup, or operational reasons; - usage records and calculated usage charges are retained as billing records; - expired OAuth authorization requests, codes, refresh tokens, and related temporary records are periodically cleaned up; - backups may retain deleted information for a limited period before normal backup expiration; - legal, tax, billing, fraud-prevention, and security records may be retained longer where required or reasonably necessary. ## Customer Controls Depending on your account, plan, and deployment mode, you may be able to: - access and update account information; - create, update, export, and delete Customer Content through the dashboard, API, SDK, or MCP tools; - create and revoke API tokens; - authorize and revoke OAuth/MCP consents; - manage workspace members and invitations; - view usage, change your plan, set a spend cap, and download invoices through Billing and the Paddle customer portal; - delete projects or request workspace/account deletion. If you need assistance with data export, deletion, access, correction, or privacy review, contact hi@rushdb.com. ## Your Privacy Rights Depending on your location, you may have rights to access, correct, delete, export, restrict, object to processing, or withdraw consent for personal data. You may also have the right to complain to a data protection authority, including the Personal Data Protection Agency of the Republic of Armenia or the authority in your country. If your personal data is contained in Customer Content controlled by a RushDB customer, we may refer your request to that customer or process the request on their instructions. For payment data held by Paddle, you can also contact Paddle directly. ## Security RushDB uses technical and organizational measures designed to protect information, including access controls, encrypted transport, password hashing, token protection, project/workspace access checks, backups, and security review processes. No system is perfectly secure. You are responsible for using strong credentials, protecting API keys and OAuth grants, limiting Customer Content to data you are authorized to process, and configuring self-hosted deployments securely. ## Children RushDB is not directed to children under 13, and we do not knowingly collect personal data from children under 13. If you believe a child has provided personal data to us, contact us so we can review and delete it where appropriate. ## Changes to This Policy We may update this Privacy Policy from time to time. If we make material changes, we will update the effective date and provide notice where required by law. ## Contact Individual Entrepreneur Artemii Vereshchinskii State registration number: 264.1331568 TIN: 72997435 Republic of Armenia Email: hi@rushdb.com Website: https://rushdb.com --- ## RushDB Cookie Policy Canonical URL: https://rushdb.com/cookie-policy Updated: 2026-11-02T18:43:43.266Z # RushDB Cookie Policy Effective date: November 3, 2026 This Cookie Policy explains how Individual Entrepreneur Artemii Vereshchinskii ("RushDB", "we", "us", or "our") uses cookies and similar technologies when you visit rushdb.com, use RushDB Cloud, use app.rushdb.com, or interact with related RushDB services. This policy should be read together with our Privacy Policy and Terms of Service. ## What Cookies Are Cookies are small text files placed on your device when you visit a website. Websites and applications use cookies, local storage, and similar browser technologies to remember information, keep sessions secure, measure usage, and improve product functionality. In this policy, "cookies" includes cookies, local storage, session storage, pixels, tags, SDK storage, and similar browser or device technologies. ## Types of Cookies and Storage We Use ### Necessary cookies Necessary cookies and storage are required to operate RushDB websites and cloud services. They may be used to: - keep you signed in to app.rushdb.com; - protect authentication, administration, and account sessions; - remember security, consent, and interface state; - route requests and maintain service reliability; - prevent fraud, abuse, or unauthorized access. These cookies are required for the service to work and cannot be disabled through our cookie banner. ### Preference and functional storage We may use browser storage to remember choices you make, such as: - theme preferences; - cookie consent choices; - interface preferences, such as the monthly or yearly billing view; - language or documentation display preferences. For example, rushdb.com stores cookie consent state in local storage and uses that choice to update analytics consent. ### Analytics cookies We use Google Tag Manager and Google Analytics-style events to understand website and product usage, improve pages, measure conversion, and debug user flows. Analytics may include events such as page views, CTA clicks, pricing plan clicks, signup-start events, documentation clicks, blog interactions, language-switch events, and limited code-copy events. Where required, analytics storage is denied by default until you accept cookies through the cookie banner. If you decline cookies, analytics storage remains denied. ### Error tracking and diagnostics We may use error tracking and diagnostics tools to identify errors, crashes, and performance issues. These tools help us improve reliability and troubleshoot technical problems. Diagnostic events may include technical information such as browser type, device information, page URL, error stack traces, timestamps, and limited context needed to reproduce or understand an issue. We do not intentionally send Customer Content to diagnostics providers. ### Payment and billing cookies Payments for RushDB Cloud are handled by Paddle.com, our Merchant of Record. When you open checkout, pay an invoice, or use the Paddle customer portal, Paddle sets cookies or uses similar technologies to: - process payments; - prevent fraud; - manage checkout and customer portal sessions; - comply with payment, tax, security, and legal requirements. Paddle's checkout may load payment partners it works with, such as card processors and wallet providers like Apple Pay, Google Pay, or PayPal, which may set their own cookies. Paddle and these providers process their cookies under their own policies. ## How We Use Cookies We use cookies and similar technologies to: - provide and secure RushDB websites and services; - authenticate users and maintain secure sessions; - remember consent, theme, and interface preferences; - measure website and product usage; - understand which pages, documentation, and pricing flows are useful; - improve performance, reliability, and user experience; - detect, troubleshoot, and fix errors; - support billing, checkout, and payment workflows. ## Third-Party Providers Cookies and similar technologies may be set by RushDB or by third-party providers we use to operate the service, including: - analytics and tag-management providers, such as Google Tag Manager and Google Analytics; - error tracking and diagnostics providers; - Paddle, our payment provider and Merchant of Record, and the payment partners used within Paddle checkout; - authentication or infrastructure providers used to provide RushDB Cloud. These providers may process information according to their own privacy and cookie policies. ## Your Choices When the cookie banner is shown, you can accept or decline non-essential cookies. If you accept, analytics consent is updated to allow analytics storage. If you decline or dismiss the banner, analytics storage remains denied. You can also control cookies through your browser settings. Most browsers allow you to block or delete cookies. If you block necessary cookies, some parts of RushDB may not work correctly, including account login, dashboard sessions, checkout, or security features. Browser cookie controls are usually available here: - [Google Chrome](https://support.google.com/chrome/answer/95647) - [Mozilla Firefox](https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop) - [Safari](https://support.apple.com/guide/safari/manage-cookies-and-website-data-sfri11471/mac) - [Microsoft Edge](https://support.microsoft.com/microsoft-edge/delete-cookies-in-microsoft-edge-63947406-40ac-c3b8-57b9-2a946a29ae09) You can also use the [Google Analytics Opt-out Browser Add-on](https://tools.google.com/dlpage/gaoptout) for supported browsers. ## Do Not Track Some browsers offer "Do Not Track" signals. There is no common industry standard for how websites should respond to these signals, so RushDB does not currently respond to them separately. We use the cookie banner and browser controls described above. ## Changes to This Policy We may update this Cookie Policy from time to time to reflect changes in our services, cookie practices, providers, legal requirements, or operational needs. If we make material changes, we will update the effective date and provide notice where required. ## Contact Individual Entrepreneur Artemii Vereshchinskii State registration number: 264.1331568 TIN: 72997435 Republic of Armenia Email: hi@rushdb.com Website: https://rushdb.com --- ## Refund policy Canonical URL: https://rushdb.com/refund-policy Updated: 2026-11-02T18:42:58.962Z # Refund Policy _Last updated: 3 November 2026_ RushDB Cloud is provided by Individual Entrepreneur Artemii Vereshchinskii ("RushDB", "we"). ## Who processes your payment Our order process is conducted by our online reseller Paddle.com. Paddle.com is the Merchant of Record for all our orders. Paddle handles payments, invoices, taxes and refunds on our behalf. Approved refunds are paid by Paddle to your original payment method. ## 14-day money-back guarantee You can request a full refund of any paid plan payment (Pro or Team) within **14 days** of the payment. This covers first payments, renewals and add-on charges for extra seats or projects. No reason is required. ## Usage charges Charges for usage above your plan's allowance (storage, Smart Search, managed embeddings) are refunded in these cases: - the charge was a billing error - it exceeded your workspace's spend cap - it was caused by a fault on our side Contact us within 14 days of the charge. ## Cancelling You can cancel any time from **Billing** in the RushDB dashboard. Your plan stays active until the end of the paid period. After that, the workspace moves to the Free plan. Your data is never deleted because you cancel or downgrade. ## Plan changes Upgrades, interval changes and added seats or projects are prorated and charged immediately. Downgrades and removed add-ons are credited against your next payment. ## Enterprise contracts Refunds for Enterprise contracts follow the contract terms. ## How to request a refund Email **billing@rushdb.com** from your account email with your workspace name. You can also contact Paddle via paddle.net. We reply within 2 business days. Refunds usually arrive within 5–10 business days. Nothing in this policy limits your rights under applicable consumer protection law. --- ## RushDB Agent Setup — Persistent Graph Memory for AI Agents Canonical URL: https://rushdb.com/agent-setup Updated: 2026-06-01T16:11:48.479Z # RushDB Agent Setup Give any AI agent persistent, graph-structured memory — sessions, decisions, tasks, entities, and preferences — stored in RushDB and queryable by meaning. Unlike flat key-value stores, RushDB memory auto-links nested JSON into a relationship graph, survives across conversations, and lets agents recall context by traversal or semantic similarity: _"What did we decide about auth? What's related to that service?"_ --- ## Step 1 — Connect the MCP Server ### Web clients (ChatGPT, Claude.ai) — no install required Use the hosted OAuth endpoint. No API key in config — you authenticate with your RushDB account. **ChatGPT:** Settings → Connectors → Add connector → `https://mcp.rushdb.com/mcp` **Claude.ai:** Settings → Integrations → Add integration → `https://mcp.rushdb.com/mcp` ### Local clients (Claude Desktop, Cursor, VS Code) Requires a RushDB API key → [app.rushdb.com](https://app.rushdb.com) **Claude Desktop** — edit `~/Library/Application Support/Claude/claude_desktop_config.json`: ```json { "mcpServers": { "rushdb": { "command": "npx", "args": ["-y", "@rushdb/mcp-server"], "env": { "RUSHDB_API_KEY": "your-api-key-here" } } } } ``` **Cursor** — add to `.cursor/mcp.json`: ```json { "mcpServers": { "rushdb": { "command": "npx", "args": ["-y", "@rushdb/mcp-server"], "env": { "RUSHDB_API_KEY": "your-api-key-here" } } } } ``` **VS Code** — add to `.vscode/mcp.json`: ```json { "servers": { "rushdb": { "type": "stdio", "command": "npx", "args": ["-y", "@rushdb/mcp-server"], "env": { "RUSHDB_API_KEY": "your-api-key-here" } } } } ``` --- ## Step 2 — Install Skills (recommended) Skills give your agent built-in knowledge of RushDB's query syntax, memory patterns, and data modeling conventions — so you don't have to explain them in every session. They work best alongside the MCP server: skills tell the agent _how_; the MCP server gives it the _tools_. ```bash npx skills add rush-db/rushdb --path packages/skills ``` Or via npm: ```bash npm install @rushdb/skills ``` Start a new agent session after installation so the skills are discovered. | Skill | What it enables | | ------------------------ | ---------------------------------------------------------------- | | `rushdb-agent-memory` | Session patterns, memory model, recall strategies | | `rushdb-query-builder` | Build `findRecords` filters, aggregations, and semantic searches | | `rushdb-data-modeling` | Design labels, properties, relationships, and nested schemas | | `rushdb-faceted-search` | Build faceted filter UIs from live property metadata | | `rushdb-domain-template` | Design a schema for any domain through guided conversation | --- ## Bootstrap Prompt > After the MCP server is connected, paste this prompt to your agent to initialize memory. ``` You are now connected to RushDB — a graph database for persistent agent memory. Follow these steps in order without waiting for confirmation between steps. INSPECT 1. Call getOntologyMarkdown. Note which labels exist and their record counts. 2. If SESSION records exist: call findRecords with {"labels":["SESSION"],"orderBy":{"startedAt":"desc"},"limit":1} and summarize the most recent session. 3. If no records exist: note that this is a fresh project and continue. INITIALIZE 4. Create a SESSION record for this conversation: { "label": "SESSION", "data": { "startedAt": "", "topic": "", "agentId": "" } } Note the returned $id — use it when linking records to this session. IMPORT PRIOR CONTEXT 5. If the user has existing notes, preference files, or prior decisions to import, extract and store them now using a single importJson call with nested labels: - User preferences → label "PREFERENCE" - Decisions made → label "DECISION" - People / services / projects → label "ENTITY" - Tasks → label "TASK" Nesting them inside the SESSION data object automatically links everything. SKILLS 6. Check if any of these skills are active in your context: rushdb-agent-memory, rushdb-query-builder, rushdb-data-modeling. If present, use them for query construction, memory patterns, and schema decisions throughout this session. CONFIRM 7. Call findRecords with {"labels":["SESSION"],"limit":5} and confirm results return. 8. Report: session ID created, prior context found (if any), skills active (if any), and that recall is working. ONGOING BEHAVIOR During this session, proactively store without being asked: - Decisions made → DECISION records - Entities mentioned → ENTITY records (type: "person" | "service" | "project" | "concept") - Tasks created/updated → TASK records - Preferences expressed → PREFERENCE records Use importJson with nested labels to create records and their relationships in one call. At session end or when asked, update the SESSION record with a summary and ask whether to save any outstanding context before closing. RECALL Use getOntologyMarkdown to inspect what is in memory at any time. Use findRecords with $contains for keyword recall. Use semanticSearch for meaning-based recall — this requires a one-time embedding index per label+property; ask the user before creating one. ``` --- ## Memory Model RushDB memory is a property graph. Each memory is a **Record** with a **Label** (type) and flat JSON properties (primitives and lists of primitives). Nested JSON is automatically normalized: each nested object becomes its own record, and parent → child relationships are created for you. ### Recommended Labels | Label | What it stores | | ------------- | ------------------------------------------------- | | `SESSION` | A conversation or work session | | `DECISION` | A decision made, with rationale and timestamp | | `ENTITY` | A named thing — person, service, project, concept | | `TASK` | A work item with status and assignee | | `PREFERENCE` | A persistent user preference or constraint | | `OBSERVATION` | A raw note or finding | | `PLAN` | A proposed sequence of steps | | `ARTIFACT` | A produced output — code, doc, design | ### Auto-linking Example A single `importJson` call with nested labels creates a full linked subgraph: ```json { "label": "SESSION", "data": [ { "sessionId": "sess_20260514_001", "startedAt": "2026-05-14T09:00:00Z", "topic": "authentication refactor", "DECISION": [ { "topic": "auth provider", "decision": "Switch from Auth0 to Clerk", "rationale": "Better Next.js App Router integration", "decidedAt": "2026-05-14T09:15:00Z", "status": "confirmed" } ], "ENTITY": [ { "name": "Clerk", "type": "service", "role": "new auth provider" }, { "name": "Auth0", "type": "service", "role": "deprecated" } ], "TASK": [ { "title": "Remove Auth0 dependency", "status": "pending", "priority": "high", "assignee": "Alice" } ] } ] } ``` RushDB creates 1 `SESSION`, 1 `DECISION`, 2 `ENTITY`, and 1 `TASK` record — all linked automatically. --- ## Recall Patterns **"What did we decide about X?"** ```json { "labels": ["DECISION"], "where": { "topic": { "$contains": "X" } }, "orderBy": { "decidedAt": "desc" }, "limit": 10 } ``` **"What sessions have we had?"** ```json { "labels": ["SESSION"], "orderBy": { "startedAt": "desc" }, "limit": 20 } ``` **"What do I prefer?"** ```json { "labels": ["PREFERENCE"], "orderBy": { "createdAt": "desc" } } ``` **"What happened in the last 7 days?"** ```json { "labels": ["SESSION", "DECISION", "TASK"], "where": { "createdAt": { "$gte": "<7-days-ago-ISO>" } }, "orderBy": { "createdAt": "desc" } } ``` --- ## Semantic Search (Memory by Meaning) `$contains` is exact substring match — fast, no setup. Use it for IDs, slugs, and known keywords. **Semantic search** finds memories by meaning even when exact words differ — _"auth system"_ matches a record that says _"we chose Clerk for login"_. It requires a one-time index setup per label + property. ### Create an index (one-time, per project) ``` Create a managed embedding index on the DECISION label for the "decision" property. Monitor it until status is "ready", then confirm semantic search works. ``` The agent calls `createEmbeddingIndex`, polls `getEmbeddingIndexStats` until `indexedRecords === totalRecords`, then runs a test `semanticSearch`. ### Query by meaning ```json { "tool": "semanticSearch", "propertyName": "decision", "labels": ["DECISION"], "query": "how did we handle authentication", "limit": 5 } ``` ### Combine with metadata filters ```json { "tool": "semanticSearch", "propertyName": "decision", "labels": ["DECISION"], "query": "database choice", "where": { "status": "confirmed", "decidedAt": { "$gte": "2026-01-01T00:00:00Z" } }, "limit": 5 } ``` Candidates are narrowed by metadata first, then ranked by similarity. --- ## End-of-Session Pattern Ask your agent to save the session before closing: ``` Save this session to RushDB memory. Store all decisions made, entities mentioned, tasks created or updated, and preferences I expressed. Link everything to today's SESSION record. Summarize what was stored. ``` --- ## Resources - **MCP Server** — `npx -y @rushdb/mcp-server` · [npm](https://www.npmjs.com/package/@rushdb/mcp-server) · [GitHub](https://github.com/rush-db/rushdb/tree/main/packages/mcp-server) - **Agent Memory Skill** — detailed patterns and query reference: [`packages/skills/rushdb-agent-memory/SKILL.md`](packages/skills/rushdb-agent-memory/SKILL.md) - **Query Builder Skill** — full SearchQuery syntax: [`packages/skills/rushdb-query-builder/SKILL.md`](packages/skills/rushdb-query-builder/SKILL.md) - **Docs** — [docs.rushdb.com](https://docs.rushdb.com) - **Dashboard** — [app.rushdb.com](https://app.rushdb.com) ---