Skip to main content

LlamaIndex property graph store integration for SynapCores — for GraphRAG.

Project description

llama-index-graph-stores-synapcores

LlamaIndex property graph store integration for SynapCores. Use it as the backend for PropertyGraphIndex and GraphRAG workflows.

pip install llama-index llama-index-graph-stores-synapcores

Quickstart

from llama_index.core import PropertyGraphIndex
from llama_index.core.readers import SimpleDirectoryReader
from llama_index.graph_stores.synapcores import SynapCoresPropertyGraphStore

# 1. docker run -p 8080:8080 -e AIDB_ACCEPT_LICENSE=1 synapcores/community:latest
graph_store = SynapCoresPropertyGraphStore(
    uri="http://localhost:8080",
    graph_name="my_kb",
    embedding_dim=1536,
)

docs = SimpleDirectoryReader("./data").load_data()
index = PropertyGraphIndex.from_documents(
    docs,
    property_graph_store=graph_store,
)

retriever = index.as_retriever()
for node in retriever.retrieve("Who founded Acme and when?"):
    print(node.text)

Configuration

Argument Default Env fallback
uri http://localhost:8080 SYNAPCORES_URI
database default SYNAPCORES_DATABASE
auth_token None SYNAPCORES_AUTH_TOKEN
graph_name llama_graph
embedding_dim 1536
overwrite False

graph_name tags every node + relation so multiple logical graphs can coexist in one engine without colliding.

Storage model

LlamaIndex type Cypher label Notes
EntityNode (name + type, e.g. "PERSON Alice") :Entity {id, name, label, properties_json, graph_name, embedding?} Embedding stored when provided
ChunkNode (source text) :Chunk {id, text, label, properties_json, graph_name, embedding?}
Relation (typed edge with properties) [:RELATION {label, properties_json, graph_name}] label is the relation type — preserved as a property so filtering by type doesn't need to parse the edge label

Free-form properties are JSON-serialized into a single properties_json field on each node/relation. Round-tripping is reliable across every engine version (>=v1.7.0.2-ce) the package supports.

What works in v0.1.0

  • upsert_nodes, upsert_relations — bulk MERGE
  • get, get_triplets — filtered fetch by id / name / property
  • get_rel_map(graph_nodes, depth=2, limit=30, ignore_rels=…) — depth-bounded BFS expansion, the load-bearing GraphRAG retrieval primitive
  • structured_query(cypher, param_map) — pass-through Cypher with named-bind translation ($entity$1)
  • vector_query(VectorStoreQuery) — cosine similarity over Chunk-node embeddings (client-side; see Performance below)
  • delete(entity_names, relation_names, properties, ids) — selective delete; refuses to wipe the entire graph without at least one selector
  • aupsert_nodes, aupsert_relations, aget_*, astructured_query, avector_query — async via asyncio.to_thread

Performance

vector_query in v0.1.0 pulls every Chunk's embedding and scores client-side — O(N) in chunk count, fine for graphs up to ~thousands of chunks. The v0.2.0 path stores chunk embeddings in a parallel SQL table with HNSW for sub-linear lookup. Native get_rel_map via variable-length path matches (MATCH p = (a)-[*1..N]-(b)) is also queued for v0.2.0 — current path is single-hop Cypher in a Python BFS.

Engine requirements

  • synapcores/community:v1.7.0.2-ce or newer (needs Cypher on /v1/query/execute — fixed in #223)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_graph_stores_synapcores-0.1.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_graph_stores_synapcores-0.1.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_graph_stores_synapcores-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b32137cc6b59799872622b55110dfe357bc4cb38d03d7364cb7b0a1e943700fe
MD5 e692d49db761d08cde1eef83c1ee029a
BLAKE2b-256 9b80c0e269f79336b2242efbb70574c2be378142c47c4c47eac013cae092aebb

See more details on using hashes here.

File details

Details for the file llama_index_graph_stores_synapcores-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_graph_stores_synapcores-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fb594e00dd349ac0f1559f5663058344c5ef5f2d0190ab5eb3195b982b25e25
MD5 e77ea2c402a57b0304e391467fdcb130
BLAKE2b-256 5cefa7c9654bbe7f7ce2ea5bd0475470b0d87f93057709577d7a66c1c152235e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page