One database, several ways to ask a question
How Vimarsh brings relationships, documents, tables and images together in PostgreSQL.
How Vimarsh brings the data together
One PostgreSQL foundation
Each part stays connected to the data it came from
Graph
Apache AGE
How things connect
Vectors
pgvector
Similar meanings
Tables
PostgreSQL
Rows, columns and values
Text
Text search
Words and passages
Images
Document figures
Pictures kept with their text
A useful answer may depend on a sentence in a report, a relationship between two people and a value in a table. Vimarsh explores how to bring those different forms of information together, while keeping a path back to the material they came from.
One document can contain many kinds of information
A report may describe an organisation in prose, show its results in a table and illustrate its structure in a diagram. Each form answers a different kind of question. Text search can find a phrase, a table can provide an exact value, and a graph can show how entities are connected.
If each form lives in a separate system, bringing the answers back together can be difficult. Vimarsh explores a shared foundation in PostgreSQL, with extensions for graph relationships and vector search. A vector is a numerical representation that can help find passages with similar meaning, even when they use different words.
These methods complement rather than replace one another. A similar passage may help a reader discover a relevant discussion, while a precise table lookup can answer a question about a particular value. The source connection helps the reader inspect the context for either result.
Keeping the connections intact
The prototype represents entities, tables, columns, values and passages as connected records. Shared identifiers and metadata help connect those records to their source material. A graph relationship can link two entities, while information about a source table or column can connect a structural description to the data itself.
A shared identifier works like a record number. For example, a passage about an organisation can keep a reference to that organisation while also belonging to a document. A table entry or graph relationship can use the same reference. The connections give the system a way to move between these views without treating them as unrelated pieces of information.
A passage can hold its text, document identifiers, an embedding and an extracted image. This keeps a figure alongside the passage it came from. Storing the image in this way does not itself let the system search the contents of the image.
| Representation | Technology | What it helps with |
|---|---|---|
| Relationships | Apache AGE | Connect entities and document structure |
| Similar meaning | pgvector | Find related vector representations |
| Tables | PostgreSQL records | Keep rows, columns and values |
| Document text | PostgreSQL full-text search | Find and rank passages |
| Extracted images | Images stored with passages | Keep figures close to their context |
Following a question across representations
Imagine looking for a phrase in a report, following a connection from that passage to an organisation, and then checking a value in a table. Each step calls for a different way of working with information. The goal is to join those steps without losing the records that support the answer.
The prototype includes a document-search path that finds matching snippets and ranks them using PostgreSQL text search. The broader question is how well these pieces work together on questions that cross documents, relationships and tables.
What to test next
A useful next experiment would use a fixed set of questions that require more than one representation. It would compare answer quality, source accuracy and response time with a simpler approach, and examine where the joins fail.
That test would show when bringing these representations into one database makes information easier to find and understand.