Find answers from the community

p
pcao
Offline, last seen 4 months ago
Joined September 25, 2024
How does the schema in SchemaLLMPathExtractor help in guiding it to extract the graph according to the schema? I look at the source code but the default prompt template doesn't pass any schema into it, then how the LLM know about the schema? https://github.com/run-llama/llama_index/blob/08c748f0111bfa1d772176e68532d1948b30a267/llama-index-core/llama_index/core/indices/property_graph/transformations/schema_llm.py

If I want to modify the prompt, which variables should I include?
7 comments
p
L
Do we have anyway to make the below code an asynchronous call?
Plain Text
index = PropertyGraphIndex.from_documents(documents=[document],
                                          llm=llm_model,
                                          embed_model=embedding_model,
                                          kg_extractors=[
                                          ImplicitPathExtractor(),
                                          LLM_extractor,
                                          ],
                                          show_progress=True,
                                          )
17 comments
p
L
p
pcao
·

azure

I use AzureOpenAIEmbedding to replace embedding model in Property Graph Index but got this error
Plain Text
AttributeError: 'AzureOpenAIEmbedding' object has no attribute '_async_http_client' 

Is there anyway I can fix this and proceed with using AzureOpenAIEmbedding for PropertyGraphIndex?
10 comments
L
N
p
m
Hi! I'm using PropertyGraphIndex and want to customize the chunking process. So the input would not be a document, but a dictionary of chunks instead and I want all the Chunk Nodes to be from this dictionary. However, I still want to use other functions of PropertyGraphIndex to extract EntityNodes and relationships with LLM, query, retrievals etc. Is that possible and how should I do that?
I looked at some directions with customizing NodeParser, but it seems that it will require me to extract EntityNodes on my own, which I don't want to.
3 comments
L
p
p
pcao
·

Retrieval

In llamaindex query engine, is it possible to use multiple retrieval calls to retrieve the EntityNodes and related ChunkNodes first then pass all to the LLM model, instead of just one retrieval then query?
1 comment
L
Hi! I'm trying to customize the query engine of a Property Graph Index to include an additional variable. Can you show how or point me to some documents I can take a look? I've tried:
https://docs.llamaindex.ai/en/stable/examples/query_engine/ensemble_query_engine/
https://docs.llamaindex.ai/en/stable/examples/response_synthesizers/custom_prompt_synthesizer/
But I don't see an appropriate way to add the additional variable to the query engine for knowledge graph.
4 comments
p
L
Hi, I'm using Llama_index Property Graph Index to generate a Knowledge Graph from a document. I use the code below to generate the graph.
Plain Text
index = PropertyGraphIndex.from_documents(
    documents,
    llm=llm,
    embed_model=ollama_embedding,
    show_progress=True,
)

I'm trying to get all nodes from the generated KG but can only find how to query a specific topic using retriever. Are there any ways I can retrieve all the nodes and relationships?
2 comments
p
L
Currently, I'm building a knowledge graph with entity using DynamicLLMPathExtractor and using Neo4j for graph store. When it comes to querying the graph, instead of using embedding to query the entire graph, I would like to just querying on the subgraph that only contains specific entity types. Is it possible to do that?
1 comment
L
For Llamaindex Knowledge Graph Extractors (SimpleLLMPathExtractor), as I understand, each chunk text will be fetched into the LLM model to extract triplets. Then, will this LLM extractions of each chunk be independent from each other, or how do they know information regarding previous LLM calls (eg: how do they know about the other chunks and triplets from them)?
If the calls are independent, then how does LlamaIndex ensure that there are no duplicate nodes / relationships in the knowledge graph, and how to deal with some information that is across chunks?
3 comments
p
L