> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Graph retrieval

> Public graph retrieval signatures and configuration in @agentium/core 4.0.0.

Import these **21 exports** from `@agentium/core`. Read the [graph retrieval guide](/knowledge/graphrag) for setup and behavior, or return to the [package reference](/api-reference/core).

A `?` marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.

## CypherRecord

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/cypher-store.ts)

```typescript theme={null}
/**
 * Low-level Cypher execution API used by `GraphRAGRetriever`.
 *
 * Distinct from the existing `GraphStore` interface in `./types.ts`, which is
 * a higher-level semantic entity graph (nodes/edges by entity type, used by
 * `GraphMemory`). `CypherStore` exposes raw Cypher for LLM-to-Cypher use cases.
 */
export interface CypherRecord {
    values: Record<string, unknown>;
}
```

## CypherSchema

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/cypher-store.ts)

```typescript theme={null}
export interface CypherSchema {
    nodeLabels: string[];
    relationshipTypes: string[];
    propertyKeys?: string[];
}
```

## CypherStore

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/cypher-store.ts)

```typescript theme={null}
export interface CypherStore {
    readonly providerId: string;
    connect(): Promise<void>;
    runCypher(cypher: string, params?: Record<string, unknown>): Promise<CypherRecord[]>;
    getSchema(): Promise<CypherSchema>;
    close(): Promise<void>;
}
```

Related: [`CypherRecord`](/api-reference/core/graph#cypherrecord), [`CypherSchema`](/api-reference/core/graph#cypherschema).

## GraphEdge

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/types.ts)

```typescript theme={null}
export interface GraphEdge {
    id: string;
    sourceId: string;
    targetId: string;
    type: string;
    properties: Record<string, unknown>;
    weight?: number;
    validFrom: Date;
    invalidatedAt?: Date;
    createdAt: Date;
}
```

## GraphNode

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/types.ts)

```typescript theme={null}
export interface GraphNode {
    id: string;
    type: string;
    name: string;
    properties: Record<string, unknown>;
    validFrom: Date;
    invalidatedAt?: Date;
    createdAt: Date;
    updatedAt: Date;
}
```

## GraphNodeQuery

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/types.ts)

```typescript theme={null}
export interface GraphNodeQuery {
    type?: string;
    name?: string;
    properties?: Record<string, unknown>;
}
```

## GraphRAGResult

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/retriever.ts)

```typescript theme={null}
export interface GraphRAGResult {
    cypher: string;
    records: CypherRecord[];
    /** Plain-text rendering of the records, useful as RAG context. */
    text: string;
}
```

Related: [`CypherRecord`](/api-reference/core/graph#cypherrecord).

## GraphRAGRetriever

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/retriever.ts)

```typescript theme={null}
export declare class GraphRAGRetriever {
    constructor(config: GraphRAGRetrieverConfig);
    /** Translate a natural-language query to Cypher, run it, and return rows. */
    retrieve(query: string): Promise<GraphRAGResult>;
}
```

Related: [`GraphRAGResult`](/api-reference/core/graph#graphragresult), [`GraphRAGRetrieverConfig`](/api-reference/core/graph#graphragretrieverconfig).

## GraphRAGRetrieverConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/retriever.ts)

```typescript theme={null}
export interface GraphRAGRetrieverConfig {
    store: CypherStore;
    model: ModelProvider;
    /** Optional system prompt prepended to the LLM-to-Cypher call. */
    systemPrompt?: string;
    /** Max records returned from a single query (after `LIMIT` is appended if missing). */
    maxRecords?: number;
}
```

Related: [`CypherStore`](/api-reference/core/graph#cypherstore), [`ModelProvider`](/api-reference/core/models#modelprovider).

## GraphSearchOptions

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/types.ts)

```typescript theme={null}
export interface GraphSearchOptions {
    nodeTypes?: string[];
    limit?: number;
}
```

## GraphStore

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/types.ts)

```typescript theme={null}
export interface GraphStore {
    initialize(): Promise<void>;
    addNode(node: Omit<GraphNode, "createdAt" | "updatedAt">): Promise<GraphNode>;
    getNode(id: string): Promise<GraphNode | null>;
    updateNode(id: string, patch: Partial<Pick<GraphNode, "name" | "properties" | "invalidatedAt">>): Promise<void>;
    deleteNode(id: string): Promise<void>;
    findNodes(query: GraphNodeQuery): Promise<GraphNode[]>;
    addEdge(edge: Omit<GraphEdge, "id" | "createdAt">): Promise<GraphEdge>;
    getEdges(nodeId: string, direction?: "in" | "out" | "both"): Promise<GraphEdge[]>;
    deleteEdge(id: string): Promise<void>;
    traverse(startNodeId: string, options?: GraphTraversalOptions): Promise<{
        nodes: GraphNode[];
        edges: GraphEdge[];
    }>;
    search(query: string, options?: GraphSearchOptions): Promise<GraphNode[]>;
    close(): Promise<void>;
}
```

Related: [`GraphEdge`](/api-reference/core/graph#graphedge), [`GraphNode`](/api-reference/core/graph#graphnode), [`GraphNodeQuery`](/api-reference/core/graph#graphnodequery), [`GraphSearchOptions`](/api-reference/core/graph#graphsearchoptions), [`GraphTraversalOptions`](/api-reference/core/graph#graphtraversaloptions).

## GraphTraversalOptions

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/types.ts)

```typescript theme={null}
export interface GraphTraversalOptions {
    maxDepth?: number;
    edgeTypes?: string[];
    nodeTypes?: string[];
    includeInvalid?: boolean;
}
```

## HybridResult

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/hybrid.ts)

```typescript theme={null}
export interface HybridResult {
    /** Source label (which sub-retriever produced the row). */
    source: "vector" | "graph";
    /** Stable identifier. */
    id: string;
    /** Text rendering. */
    content: string;
    /** RRF / rerank score. */
    score: number;
}
```

## HybridRetriever

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/hybrid.ts)

```typescript theme={null}
/**
 * Compose vector retrieval + graph retrieval into a single pipeline:
 *
 *   1. Run both sub-retrievers in parallel.
 *   2. Fuse with reciprocal rank fusion (default k=60).
 *   3. Optionally rerank the top fused set.
 */
export declare class HybridRetriever {
    constructor(config: HybridRetrieverConfig);
    retrieve(query: string): Promise<HybridResult[]>;
}
```

Related: [`HybridResult`](/api-reference/core/graph#hybridresult), [`HybridRetrieverConfig`](/api-reference/core/graph#hybridretrieverconfig).

## HybridRetrieverConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/hybrid.ts)

```typescript theme={null}
export interface HybridRetrieverConfig {
    /** Vector backend (for semantic search). */
    vector?: {
        store: VectorStore;
        collection: string;
        topK?: number;
    };
    /** Graph backend (for structured reasoning). */
    graph?: {
        retriever: GraphRAGRetriever;
    };
    /** Optional reranker for the fused result set. */
    rerank?: Reranker;
    /** Max results returned from the fused pipeline. */
    topK?: number;
}
```

Related: [`GraphRAGRetriever`](/api-reference/core/graph#graphragretriever), [`Reranker`](/api-reference/core/rerank#reranker), [`VectorStore`](/api-reference/core/vector#vectorstore).

## InMemoryGraphStore

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/in-memory.ts)

```typescript theme={null}
export declare class InMemoryGraphStore implements GraphStore {
    initialize(): Promise<void>;
    addNode(node: Omit<GraphNode, "createdAt" | "updatedAt">): Promise<GraphNode>;
    getNode(id: string): Promise<GraphNode | null>;
    updateNode(id: string, patch: Partial<Pick<GraphNode, "name" | "properties" | "invalidatedAt">>): Promise<void>;
    deleteNode(id: string): Promise<void>;
    findNodes(query: GraphNodeQuery): Promise<GraphNode[]>;
    addEdge(edge: Omit<GraphEdge, "id" | "createdAt">): Promise<GraphEdge>;
    getEdges(nodeId: string, direction?: "in" | "out" | "both"): Promise<GraphEdge[]>;
    deleteEdge(id: string): Promise<void>;
    traverse(startNodeId: string, options?: GraphTraversalOptions): Promise<{
        nodes: GraphNode[];
        edges: GraphEdge[];
    }>;
    search(query: string, options?: GraphSearchOptions): Promise<GraphNode[]>;
    close(): Promise<void>;
}
```

Related: [`GraphEdge`](/api-reference/core/graph#graphedge), [`GraphNode`](/api-reference/core/graph#graphnode), [`GraphNodeQuery`](/api-reference/core/graph#graphnodequery), [`GraphSearchOptions`](/api-reference/core/graph#graphsearchoptions), [`GraphStore`](/api-reference/core/graph#graphstore), [`GraphTraversalOptions`](/api-reference/core/graph#graphtraversaloptions).

## MemgraphCypherStore

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/cypher-store.ts)

```typescript theme={null}
/**
 * Memgraph reuses the Bolt protocol so we just inherit Neo4jCypherStore.
 */
export declare class MemgraphCypherStore extends Neo4jCypherStore {
    readonly providerId = "memgraph";
    constructor(config?: Neo4jCypherStoreConfig);
}
```

Related: [`Neo4jCypherStore`](/api-reference/core/graph#neo4jcypherstore), [`Neo4jCypherStoreConfig`](/api-reference/core/graph#neo4jcypherstoreconfig).

## Neo4jCypherStore

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/cypher-store.ts)

```typescript theme={null}
/**
 * Neo4j-backed Cypher store. Lazily loads `neo4j-driver` (already an optional
 * peer dep on @agentium/core).
 */
export declare class Neo4jCypherStore implements CypherStore {
    readonly providerId: string;
    constructor(config?: Neo4jCypherStoreConfig);
    connect(): Promise<void>;
    runCypher(cypher: string, params?: Record<string, unknown>): Promise<CypherRecord[]>;
    getSchema(): Promise<CypherSchema>;
    close(): Promise<void>;
}
```

Related: [`CypherRecord`](/api-reference/core/graph#cypherrecord), [`CypherSchema`](/api-reference/core/graph#cypherschema), [`CypherStore`](/api-reference/core/graph#cypherstore), [`Neo4jCypherStoreConfig`](/api-reference/core/graph#neo4jcypherstoreconfig).

## Neo4jCypherStoreConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/cypher-store.ts)

```typescript theme={null}
export interface Neo4jCypherStoreConfig {
    uri?: string;
    username?: string;
    password?: string;
    database?: string;
}
```

## Neo4jGraphStore

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/neo4j.ts)

```typescript theme={null}
/**
 * Neo4j-backed graph store. Requires `neo4j-driver` as a peer dependency.
 *
 * Install: npm install neo4j-driver
 */
export declare class Neo4jGraphStore implements GraphStore {
    constructor(config: Neo4jGraphStoreConfig);
    initialize(): Promise<void>;
    addNode(node: Omit<GraphNode, "createdAt" | "updatedAt">): Promise<GraphNode>;
    getNode(id: string): Promise<GraphNode | null>;
    updateNode(id: string, patch: Partial<Pick<GraphNode, "name" | "properties" | "invalidatedAt">>): Promise<void>;
    deleteNode(id: string): Promise<void>;
    findNodes(query: GraphNodeQuery): Promise<GraphNode[]>;
    addEdge(edge: Omit<GraphEdge, "id" | "createdAt">): Promise<GraphEdge>;
    getEdges(nodeId: string, direction?: "in" | "out" | "both"): Promise<GraphEdge[]>;
    deleteEdge(id: string): Promise<void>;
    traverse(startNodeId: string, options?: GraphTraversalOptions): Promise<{
        nodes: GraphNode[];
        edges: GraphEdge[];
    }>;
    search(query: string, options?: GraphSearchOptions): Promise<GraphNode[]>;
    close(): Promise<void>;
}
```

Related: [`GraphEdge`](/api-reference/core/graph#graphedge), [`GraphNode`](/api-reference/core/graph#graphnode), [`GraphNodeQuery`](/api-reference/core/graph#graphnodequery), [`GraphSearchOptions`](/api-reference/core/graph#graphsearchoptions), [`GraphStore`](/api-reference/core/graph#graphstore), [`GraphTraversalOptions`](/api-reference/core/graph#graphtraversaloptions), [`Neo4jGraphStoreConfig`](/api-reference/core/graph#neo4jgraphstoreconfig).

## Neo4jGraphStoreConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/graph/neo4j.ts)

```typescript theme={null}
export interface Neo4jGraphStoreConfig {
    uri: string;
    username: string;
    password: string;
    database?: string;
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.