No project description provided
Project description
Knowledge Graph RAG
Automatically create knowledge graphs + document networks to boost performance on RAG
1. Install Knowledge Graph RAG:
pip install knowledge_graph_rag
2. Create a Knowledge Graph or a Document Graph:
# Creating KG on medical documents
documents = ["Cardiovascular disease ...",
"Emerging therapeutic interventions ...",
"The epidemiological burden ...
"Cardiovascular disease also ...",
"Advanced imaging techniques, ...",
"Role of novel biomarkers ..."
]
knowledge_graph = KnowledgeGraph(documents)
knowledge_graph.create()
knowledge_graph.plot()
documents_graph = DocumentsGraph(documents=documents)
documents_graph.plot()
3. Search knowledge graph entities or find interconnected documents, to augment your LLM context:
knowledge_graph.search_document(user_query)
Entity: cardiovascular disease
-> antihypertensive agents (Relationship: involves treatment with)
-> statins (Relationship: used to modulate dyslipidemia)
-> antiplatelet therapy (Relationship: utilized to mitigate thrombosis risk)
-> biomarkers (Relationship: detection and prognostication of acute coronary syndromes and heart failure)
-> high-sensitivity troponins (Relationship: detection of acute coronary syndromes and heart failure)
-> natriuretic peptides (Relationship: prognostication of acute coronary syndromes and heart failure)
documents_containing_connected_terminology = documents_graph.find_connected_documents(vectordb_search_result)
documents_containing_connected_terminology
[{'document': 'emerging therapeutic intervention ...'},
{'document': 'management cardiovascular ...'},
{'document': 'role novel biomarkers ...'}]
Star History
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file knowledge_graph_rag-0.1.0.tar.gz
.
File metadata
- Download URL: knowledge_graph_rag-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7d0e9a91f9a2b32be6fd0c2cc763ccc65b64d9302df9ab40a5b49c30fd486b9 |
|
MD5 | 4c2a910a70275c1b7a92bdc2a25c1858 |
|
BLAKE2b-256 | ec90f1edc8f824eebd0b1b9e5573c547e2982b2e9fe9fc1ee3a02a8cafecc36e |
File details
Details for the file knowledge_graph_rag-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: knowledge_graph_rag-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e36e648020d3a1d33039b342672af5426dc67521492400adc1c268105ab99cbf |
|
MD5 | 52d67127689ffc2752b7519c8a5c5d33 |
|
BLAKE2b-256 | 247eebdf9f36353e181632dded270f2c2b17757e2a4135683a572c8792c27fde |