Skip to content

NeptuneDriver does not initialize _database, breaking add_episode (AttributeError) #1

@jhurliman

Description

@jhurliman

Summary

NeptuneDriver.__init__ never sets the base GraphDriver._database attribute, but Graphiti.add_episode reads self.driver._database (when mapping a group_id to a database):

# graphiti_core/graphiti.py (add_episode)
if group_id != self.driver._database:
    self.driver = self.driver.clone(database=group_id)

So any add_episode call against Neptune raises:

AttributeError: 'NeptuneDriver' object has no attribute '_database'

Repro

Construct a Graphiti(graph_driver=NeptuneDriver(host="neptune-db://...", aoss_host="...")) and call add_episode(...). (Neo4jDriver/FalkorDriver both set self._database in __init__; Neptune does not.)

Fix

Neptune is a single graph with no named databases, so default _database to '', consistent with get_default_group_id(GraphProvider.NEPTUNE) returning ''. The inherited with_database()/clone() (shallow copy reusing the same Neptune client) then works unchanged.

Environment: graphiti-core 0.29.2, Amazon Neptune Serverless (neptune-db://) + OpenSearch Serverless.

PR: fixes this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions