Skip to main content
ladyGraph is one folder of packages. In the component diagram, an arrow means “uses at run time”. Separately, every package imports its types from core, and core imports no other package.
C4 component diagram with one box per ladyGraph package and arrows showing which package uses which at run time

Components, one per package

Packages

Dependency rules

  • core defines the interfaces (Source, Extractor, GraphStore, Embedder and Resolver, in core/pipeline.py). The other packages implement them.
  • llm/base.py defines LlmClient, decision/base.py defines Decider, and retrieval/searcher.py defines ConceptSource. Each interface is a Protocol, so a test can pass a fake.
  • Every external service sits behind one adapter: the database in sources/sql.py, models in llm/, embedding/ and decision/, and the index in stores/.
  • ner imports no other package of ours. Its interface and helpers import no model SDK. ner/litert_gliner.py imports numpy, and imports ai_edge_litert and tokenizers only when a real model is built. It does not import torch or gliner unless you ask for that fallback.
  • llm/litert.py imports litert_lm only when it first needs the engine.
  • authoring is a leaf: nothing imports it, and it imports no model or gateway library. It reaches a model only through the claude CLI and a URL you configure. You run that endpoint yourself, outside ladyGraph.
  • Each package that talks to a model or a database ships a fake (llm/fake.py, embedding/fake.py, decision/fake.py and stores/memory.py). That is how the test suite runs offline.

How it works

The indexing and search paths that these packages implement.