Knwl Examples

KnowledgeGraphs
GraphAI
Various use-cases and examples related to Knwl.

Charles Dickens

Knwl makes it particularly simple to explore articles from Wikipedia. For example, if you want to fetch the article related to Charles Dickens:

text = await get_library_article("literature", "Charles Dickens")

the first parameter being the category (directory) where the text will be stored for re-use (cache). To ingest, simply use:

kg = Knwl()
gr = await kg.ingest(text)
print_knwl(gr)

By default Kwnl uses Ollama with qwen2.5:7b but you get better results with slightly larger models, say gemma3:7b. You can set the model and lots of other parameters in the config. If you run this locally, it can take 10 minutes to output the knowledge graph. With the default settings (ie. NetworkX with GraphML output) you get a GraphML file you can open with yEd Live or the desktop version of yEd. With a bit of layout you get something like the adjacent image:

You can download the GraphML data here, if you wish.

It couldn’t be easier to turn Wikipedia into knowledge graphs. If you re-run the code above with different articles titles you agument the KG automatically. Consolidation of information and content happens automatically.