Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For authors
Description
I have migrated Talk2KGs agentic workflow to adopt LangGraph. Following are the detailed key updates:
aiagents4pharma/talk2knowledgegraphs/
, I includedagents
,state
, andtools
folder.agents/t2kg_agent.py
, we have onlyagent_t2kg
as a solely agent as of now.state/state_talk2knowledgegraphs.py
, we utilizeAgentState
of LangGraph inTalk2KnowledgeGraphs
to store variables and update it as we interact with agent.tools/*
, there are three tools that agent can invoke:tools/subgraph_extraction.py
to extract a subgraph using the PCST algorithm (G-Retriever approach).tools/subgraph_summarization.py
to summarize textual graph obtained from subgraph extraction process.tools/graphrag_reasoning.py
to perform reasoning in addition to RAG using a summarized subgraph and additional documents uploaded by the user.Streamlit-related codes are placed under
app/frontend/*
.In addition, we can set parameters configuration within
configs
that utilize Hydra library.2. Pytest: I updated Talk2KGs-related codes under
aiagents4pharma/talk2knowledgegraphs/tests/*
3. Tutorial Notebooks: I added an interactive notebook for showcasing Talk2KGs agentic tools in
docs/notebooks/talk2knowledgegraphs/tutorial_talk2kg_agentic_tools.ipynb
.4. Documentation: Finally, I updated the related documentation using mkdocs, which is available in
docs/talk2knowledgegraphs/*
.Notes:
As of now, I use a toy dataset for testing. I will open a separate issue related to this so that we can interact with public (e.g., subgraph of PrimeKG) and private KGs seamlessly.
I switch to Llama3.2:1b (~1.4 GB) for testing to make sure that it supports and can utilize LangGraph tools as well as understand the instructions from user queries.
Fixes #34
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests you conducted to verify your changes. These may involve creating new test scripts or updating existing ones.
tests
folderaiagents4pharma/talk2knowledgegraphs/tests/*
)Checklist
tests
folder) that prove my fix is effective or that my feature worksFor reviewers
Checklist pre-approval
Checklist post-approval
develop
intomain
? If so, please make sure to add a prefix (feat/fix/chore) and/or a suffix BREAKING CHANGE (if it's a major release) to your commit message.Checklist post-merge
develop
intomain
and is it suppose to run an automated release workflow (if applicable)? If so, please make sure to check under the "Actions" tab to see if the workflow has been initiated, and return later to verify that it has completed successfully.