docs: add comprehensive database configuration instructions to README (#703)

* docs: add comprehensive database configuration instructions to README

Add detailed instructions for custom database configuration using graph drivers:
- Neo4j with custom database name
- FalkorDB with custom database name
- Best practices for using graph drivers
- Environment variable configuration examples

Resolves #702

Co-authored-by: Daniel Chalef <danielchalef@users.noreply.github.com>

* Update README.md

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Daniel Chalef <danielchalef@users.noreply.github.com>
This commit is contained in:
Daniel Chalef 2025-07-10 19:50:19 -07:00 committed by GitHub
parent 4b578c1d53
commit 71fca7fdd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,15 +220,46 @@ Database names are configured directly in the driver constructors:
- **Neo4j**: Database name defaults to `neo4j` (hardcoded in Neo4jDriver)
- **FalkorDB**: Database name defaults to `default_db` (hardcoded in FalkorDriver)
To use a different database name, pass the `database` parameter when creating the driver:
As of v0.17.0, if you need to customize your database configuration, you can instantiate a database driver and pass it to the Graphiti constructor using the `graph_driver` parameter.
#### Neo4j with Custom Database Name
```python
from graphiti_core import Graphiti
from graphiti_core.driver.neo4j_driver import Neo4jDriver
# Use custom database name
driver = Neo4jDriver(uri="bolt://localhost:7687", user="neo4j", password="password", database="my_db")
# Create a Neo4j driver with custom database name
driver = Neo4jDriver(
uri="bolt://localhost:7687",
user="neo4j",
password="password",
database="my_custom_database" # Custom database name
)
# Pass the driver to Graphiti
graphiti = Graphiti(graph_driver=driver)
```
#### FalkorDB with Custom Database Name
```python
from graphiti_core import Graphiti
from graphiti_core.driver.falkordb_driver import FalkorDriver
# Create a FalkorDB driver with custom database name
driver = FalkorDriver(
host="localhost",
port=6379,
username="falkor_user", # Optional
password="falkor_password", # Optional
database="my_custom_graph" # Custom database name
)
# Pass the driver to Graphiti
graphiti = Graphiti(graph_driver=driver)
```
### Performance Configuration
`USE_PARALLEL_RUNTIME` is an optional boolean variable that can be set to true if you wish