# Graph Store

## Description

Graph stores register through `IFlexGraphStore`, providing a provider-agnostic API for node/edge CRUD and traversals.

## Configuration in DI

Register only the provider.

```csharp
// Pick ONE
services.AddFlexNeo4jGraphStore(configuration);
// services.AddFlexCosmosGremlinGraphStore(configuration);
```

## appsettings.json

Graph store configuration is read from `FlexBase:DataStores:Graph:<Provider>`.

```json
{
	"FlexBase": {
		"DataStores": {
			"Graph": {
				"Neo4j": {
					"Uri": "bolt://localhost:7687",
					"Username": "neo4j",
					"Password": "<store-in-secrets>"
				}
			}
		}
	}
}
```

## Sample usage ({YourApplication})

```csharp
public class ConnectionFinder
{
	private readonly IFlexGraphStore _graphStore;

	public ConnectionFinder(IFlexGraphStore graphStore)
		=> _graphStore = graphStore;

	public Task<IReadOnlyList<FlexGraphNode>> FindPeopleAsync(CancellationToken ct = default)
		=> _graphStore.FindNodesAsync(label: "Person", limit: 50, ct: ct);
}
```

## Provider pages

* Neo4j: `graph-store/neo4j.md`
* Cosmos Gremlin: `graph-store/cosmos-gremlin.md`

## Provider considerations

* Graph providers vary in query language; prefer the structured `IFlexGraphStore` APIs for portability.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flexbase.in/data-and-providers/data-stores/graph-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
