Data Model
Graph schema — nodes, relationships, and properties in MemNexus.
MemNexus stores all data in a Neo4j graph database. Understanding the graph schema helps you write better queries and build more effective integrations.
Node types
Memory
The fundamental unit of storage.
| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
content | string | The memory content |
memoryType | string | Type (default: episodic) |
importance | float | 0-1 significance score |
embedding | float[] | 1536-dimension OpenAI vector |
createdAt | datetime | When the memory was created |
updatedAt | datetime | When last modified |
Conversation
Groups related memories into logical sessions.
| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
title | string | Conversation title |
createdAt | datetime | When started |
updatedAt | datetime | When last memory was added |
Topic
Labels that emerge from memories for categorization.
| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
name | string | Topic name |
embedding | float[] | Topic vector for similarity |
Fact
Structured knowledge as subject-predicate-object triples.
| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
subject | string | Fact subject |
predicate | string | Relationship type |
object | string | Fact object |
confidence | float | 0-1 confidence score |
Entity
People, tools, projects, and concepts that appear across memories.
| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
name | string | Entity name |
type | string | Entity type (person, tool, project, concept) |
Community
Groups of related topics detected via graph algorithms.
| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
name | string | Community name |
algorithm | string | Detection algorithm used |
Relationships
Memory ──[HAS_TOPIC]──────→ Topic
Memory ──[MENTIONS]────────→ Entity
Memory ──[BELONGS_TO]──────→ Conversation
Memory ──[RELATED_TO]──────→ Memory
Fact ──[ABOUT]───────────→ Entity
Fact ──[HAS_SUBJECT]─────→ Entity
Fact ──[HAS_OBJECT]──────→ Entity
Topic ──[RELATED_TO]──────→ Topic
Topic ──[BELONGS_TO]──────→ Community
Entity ──[RELATED_TO]──────→ Entity
Indexes
Vector indexes
MemNexus creates vector indexes on Memory.embedding for semantic search using cosine similarity. Embeddings are generated using OpenAI's text-embedding-3-small model (1536 dimensions).
Full-text indexes
Full-text indexes are maintained on Memory.content for keyword search. These support the keyword component of hybrid search.
Standard indexes
Standard B-tree indexes on:
Memory.id,Memory.createdAtConversation.idTopic.id,Topic.nameFact.idEntity.id,Entity.name
Search pipeline
When you search, MemNexus runs:
- Semantic search — Embeds your query, finds nearest neighbors in vector space
- Keyword search — Full-text search across memory content
- Reciprocal Rank Fusion — Merges and re-ranks results from both searches
This hybrid approach means both "that deployment issue" (semantic) and "ECONNREFUSED" (keyword) return relevant results.