You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-1Lines changed: 50 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,55 @@ tags:
11
11
12
12
This project uses a [Concerto model](https://concerto.accordproject.org) to define the nodes and edges in a Neo4J graph database and uses the model to validate the properties on the nodes.
13
13
14
+

15
+
16
+
In a few lines of code you can define a Concerto data model validated graph and perform a vector similarity search over
17
+
nodes with text content.
18
+
19
+
Concerto model (snippet):
20
+
21
+
```
22
+
concept Movie extends GraphNode {
23
+
@vector_index("summary", 1536, "COSINE")
24
+
o Double[] embedding optional
25
+
@embedding
26
+
o String summary optional
27
+
@label("IN_GENRE")
28
+
--> Genre[] genres optional
29
+
}
30
+
```
31
+
32
+
TypeScript code:
33
+
34
+
```typescript
35
+
awaitgraphModel.mergeNode(transaction, `${NS}.Movie`, {identifier: 'Brazil', summary: 'The film centres on Sam Lowry, a low-ranking bureaucrat trying to find a woman who appears in his dreams while he is working in a mind-numbing job and living in a small apartment, set in a dystopian world in which there is an over-reliance on poorly maintained (and rather whimsical) machines'} );
content: 'The film centres on Sam Lowry, a low-ranking bureaucrat trying to find a woman who appears in his dreams while he is working in a mind-numbing job and living in a small apartment, set in a dystopian world in which there is an over-reliance on poorly maintained (and rather whimsical) machines',
58
+
score: 0.901830792427063
59
+
}
60
+
]
61
+
```
62
+
14
63
## Environment Variables
15
64
16
65
### GraphDB
@@ -19,4 +68,4 @@ This project uses a [Concerto model](https://concerto.accordproject.org) to defi
19
68
- NEO4J_PASS: <optional> the neo4j password.
20
69
21
70
### Text Embeddings
22
-
- OPENAI_API_KEY: <optional> the OpenAI API key. If not set embeddings are not computed and written to the agreement graph.
71
+
- OPENAI_API_KEY: <optional> the OpenAI API key. If not set embeddings are not computed and written to the agreement graph and similarity search is not possible.
0 commit comments