Quickstart
Install
Section titled “Install”uv add lexigram-graphAdd the optional Neo4j extra for production use:
uv add "lexigram-graph[neo4j]"The in-memory backend requires no extra dependencies.
Minimal Example
Section titled “Minimal Example”import asynciofrom lexigram import Applicationfrom lexigram.contracts.data.graph import GraphStoreProtocolfrom lexigram.graph import GraphModule, GraphConfig
async def main() -> None: async with Application.boot( name="graph-demo", modules=[ GraphModule.configure( GraphConfig(backend="memory") ), ], ) as app: graph = await app.container.resolve(GraphStoreProtocol) db = await graph.get_graph() node = await db.create_node(["Person"], {"name": "Alice"}) print(f"Created node: {node.id}")
asyncio.run(main())For Neo4j:
uv add "lexigram-graph[neo4j]"config = GraphConfig(backend="neo4j")How It Works
Section titled “How It Works”GraphModule.configure()creates aGraphProviderwith the given config.- The provider registers
GraphStoreProtocolandGraphProtocolin the container. - On boot, it connects to the configured backend (in-memory or Neo4j).
- Services receive graph handles via constructor injection.
Next Steps
Section titled “Next Steps”- Guide — mental model, core concepts, common patterns
- How-Tos — task-oriented recipes
- Configuration — every config key with env-var names