Find answers from the community

hi everyone! i have a llamaindex pipeline which tokenizes, extracts entities, etc from a list of documents and stores it in the vector_store; after that, how do i create a query engine on top of that vector store so that i can ask questions about the documents indexed in the vector store? that vector store already has embeddings from previous piplien runs, so i don't want to use VectorStoreIndex.from_documents(..) because the embeddings are already in the data store - what do i do?

pipeline = IngestionPipeline(
transformations=[
SummaryExtractor(summaries=["self"], llm=qa_llm),
QuestionsAnsweredExtractor(llm=qa_llm, questions=1),
EntityExtractor(label_entities=True, llm=qa_llm),
embed_model,
],
vector_store=vector_store,
)
is there any support coming for AWS valkye, as redis is not open source anymore?
https://aws.amazon.com/elasticache/what-is-valkey/
CC: @Logan M
1 comment
L
Hi everyone, I can not login to Liama Cloud, it shows this error (A network error has occurred Dismiss), is it for all or not
2 comments
L
A
Hi everyone,
I had the chance to watch this great video by Jerry (https://www.youtube.com/watch?v=L1o1VPVfbb0) and although Query Pipelines are now depricated and now replaced with Workflows, the same notebook has been updated with Workflows here (https://docs.llamaindex.ai/en/stable/examples/workflow/advanced_text_to_sql/) however, here is the catch:
  1. I tried to use Arize Pheonix to trace the execution of the last workflow and what I got was separate record for each step in the Workflow, not nested or linked together.
  2. There is a class called "NLSQLTableQueryEngine" which implements the first Workflow in the previous notebook, this one doesn't use Workflows and is tracked very well on Arize Pheonix.
So I wonder if the complete query-time row retrieved implementation can be implemented as a traceable class like "NLSQLTableQueryEngine" or if the Workflow can be traced using Arize Pheonix.

TBH, it's hard to read the source code and understand how everything works (I tried) to answer this question myself.
4 comments
L
O
Hey all, is strict = True default for structured outputs for function calling with openai (ex. FunctionCallingProgram)?
8 comments
L
D
if i ran workflow in a task asyncio.create_task(workflow.run()) how do i safely cancel it
7 comments
L
D
Hello everyone,
I'm encountering some problems with storing metadata in Neo4j using the VectorStoreIndex. I'm creating nodes with important metadata. Here is the relevant part of my code:
Plain Text
def get_metadata(filename):
   for item in metadata:
    if item["url"] == filename:
     return item
   return {}
documents = SimpleDirectoryReader(dir_documents, file_metadata=get_metadata).load_data()
node_parser = SentenceWindowNodeParser.from_defaults(window_size=3,window_metadata_key="window",original_text_metadata_key="original_text")
nodes = node_parser.get_nodes_from_documents(documents)
transformations = [title_extractor, qa_extractor]
neo4j_vector_store = Neo4jVectorStore(neo_username, neo_password, neo_url, embed_dim, hybrid_search=True, index_name=index_name)
storage_context = StorageContext.from_defaults(vector_store=neo4j_vector_store)
vector_index = get_vector_index(neo_username, neo_password, neo_url, embed_dim, index_name)
vector_index.insert_nodes(nodes, transformations=transformations, storage_context=storage_context)

I then built a query engine used by an agent. While the agent retrieves these nodes, the nodes do not have the metadata I imported previously. Upon checking the Neo4j created nodes, I noticed that not only do the nodes lack this metadata, but the metadata has also been vectorized as part of the content. Therefore, I don't have access to that metadata when retrieving normal chunks.
Here is the code for the query engine:
Plain Text
node_postprocessors = [MetadataReplacementPostProcessor(target_metadata_key="window"),SimilarityPostprocessor(similarity_cutoff=0.5)]
index_query_engine = index.as_query_engine(similarity_top_k=doc_similarity_top_k, node_postprocessors=node_postprocessors)

Is this an error? Is it a problem with using SentenceWindowNodeParser or how i include the metadata? What can I do to ensure that the metadata is stored correctly and can be retrieved as expected?
Any help or guidance would be greatly appreciated.
Thank you!
2 comments
L
d
hello there, i have some questions about preparing your knowledge base for a multimodal rag application.

referencing from this guide - https://github.com/run-llama/llama_parse/blob/main/examples/multimodal/multimodal_rag_slide_deck.ipynb
it iterates through each page and creates a TextNode, and at the same time, adds the page number and image path of the image as metadata.

For my case, I am using MarkdownElementNodeParser which separates texts and tables into IndexNode and BaseNode. Similarly I will like to add page number and image path into these nodes' metadata. But the sequence of the nodes are already jumbled up from line 2 onwards. So how can I still add the page number and image path in them? Thanks

Plain Text
[1] node_parser = MarkdownElementNodeParser(llm=llm)
[2] nodes = node_parser.get_nodes_from_documents([document])
[3] base_nodes, objects = node_parser.get_nodes_and_objects(nodes)
3 comments
L
g
what are the techniques i can use for unstructured pdf for my RAG chatbot?
4 comments
W
I
Hi all! I am new to llamaindex and am working on a slack bot. I want this bot to demonstrate personality when chatting in slack and to not disclose it’s an AI (this is an internal bot only so everyone knows). I am using the ReAct Agent as the agent that performs the chats. Does anyone have any advice for me?
1 comment
c
trying to build a customer/ prospect feedback slackbot for my company

prototyping based on dummy transcript/ notes data in notion

but one issue rn with the notion reader is that we only load the text and the page id

but would be quite helpful to also load other fields from the page as metadata e.g. if we can load organization/ date, then we can possibly get better answers e.g. give me top customer pain points from last week or give me top frustrations from 'Big Corporation'.

any ideas on how to do this?
2 comments
L
t
Hello, i'm facing a little issue with code that i use to index documents in my database. it returns the following error:
Traceback (most recent call last):
File "c:\Projets\test IA in DB\local index\LocalIndex.py", line 11, in <module>
from llama_index.llms.azure_openai import AzureOpenAI
File "C:\Users\sxd-i\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\llama_index\llms\azure_openai__init__.py", line 1, in <module>
from llama_index.llms.azure_openai.base import (
File "C:\Users\sxd-i\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\llama_index\llms\azure_openai\base.py", line 5, in <module>
from llama_index.core.bridge.pydantic import Field, PrivateAttr, root_validator
ImportError: cannot import name 'root_validator' from 'llama_index.core.bridge.pydantic' (C:\Users\sxd-i\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\llama_index\core\bridge\pydantic.py)

here is the code :
Plain Text
import os
import pymongo
import ModelDef
from llama_index.core import VectorStoreIndex, StorageContext, SimpleDirectoryReader, set_global_service_context
from llama_index.llms.azure_openai import AzureOpenAI
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding
from llama_index.core.indices.vector_store.base import VectorStoreIndex
from llama_index.vector_stores.mongodb import MongoDBAtlasVectorSearch
from llama_index.core import Settings
from llama_index.core.indices.vector_store import VectorStoreIndex
import os
import pymongo
import json
import ModelDef
from flask import Flask, request

# ---------------------------
# Constantes de l'application
# ---------------------------

# Définition des models de déploiement AI

_modelGPT4o = ModelDef.ModelGPT("gpt-4o", "gpt-4o", "2024-10-21")
_modelAda2 = ModelDef.ModelGPT("ada2", "text-embedding-ada-002", "2024-10-21")

_server4o = ModelDef.ServerGPT("gpt4o", "https://.azure.com", "26f3ea90247b1a9286057d53c2539", "c59f1006a64015a7b083ed29", "eastus2", _modelGPT4o, _modelAda2)

_models = [ _server4o]
_model = _models[0]

# Constants

_index = "LeJourSeLeveIFC"
_directory = "C:\\Projets\\ifcdoctest"
_mongoURI = os.environ["MONGO_URI"] = "url of mongo data base"

# ----------------------
# Démarrage du programme
# ----------------------

# Initialisation OpenAI

print("Initialisation OpenAI...")

llm = AzureOpenAI(
    #model=_model.ChatModel.Model,
    #deployment_name=_model.ChatModel.Name,
    api_key=_model.Key1,
    azure_endpoint=_model.Server,
    api_version=_model.ChatModel.ApiVersion,
)

embed_model = AzureOpenAIEmbedding(
    model=_model.LearningModel.Model,
    deployment_name=_model.LearningModel.Name,
    api_key=_model.Key1,
    azure_endpoint=_model.Server,
    api_version=_model.LearningModel.ApiVersion,
)
#Settings.llm = AzureOpenAI(model=llm)
#Settings.embed_model = AzureOpenAIEmbedding(model=_modelAda2)
#service_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)
#set_global_service_context(service_context)
# Initialisation des paramètres pour les requètes sur MongoDB Atlas
print("Initialisation MongoDB...")

mongodb_client = pymongo.MongoClient(_mongoURI)
store = MongoDBAtlasVectorSearch(mongodb_client, db_name=_index)
storage_context = StorageContext.from_defaults(vector_store=store)

# On parcours chaque fichier
print("Démarrage de l'importation...")

reader = SimpleDirectoryReader(_directory, recursive=True, encoding="latin-1", required_exts=[".pdf", ".docx", ".pptx", ".csv", ".txt"])

for docs in reader.iter_data():
        print("F > " + docs[0].metadata['file_name'])
        VectorStoreIndex.from_documents(docs, storage_context=storage_context)
# Fin du programme

print("Terminée.")
6 comments
L
K
hello there, I have written 2 sets of tools for my agent using FunctionCallingAgentWorker. The first set of tool includes 3 QueryEngineTool and the second set includes 1 FunctionTool (pydantic base model, does simple addition on any numbers of input floats).

I put them all into a list and pass it to my agent. During query time, the agent is always using the first set of tools and not using the second set at all. In my prompt, do I need to include statements like "use this tool when doing this task" sort of sentence?
11 comments
L
g
Hey all, is cohere rerank 3.5 through bedrock available as a postprocessor? I can't seem to locate documentation for that
1 comment
L
I'm a new user and have a question regarding your new ColPali addition.
Does this mean if I process le't say e.g. a PDF, your system automatically/dynamically leverages ColPali (always or when it makes sense)?
Or is it like a standalone feature/process?
Or does it work completely different?
1 comment
M
Hi all, having an issue with a project I'm building for a RAG Pipeline with a single PDF as a knowledge store. For some reason when I ask it anything about food or macros and anything it says it doesn't have knowledge though it's in the PDF and should be loaded in the index.

This is my app.py
1 comment
W
So Maybe I get this all wrong, but Im banging my head around a simple example for days now...

I work on a M1 mac with 32GB ram.

IM trying to get this example to run:

https://github.com/run-llama/python-agents-tutorial/blob/main/2_local_agent.py

But all I get is "Process finished with exit code 0"

I try to use a smaller model, but this als does not generate the response..

When I chat with the llm directy it does deliver output.

Are these example even ment to run on local machines?
12 comments
L
m
G
W
I'm facing an issue while trying to read a large CSV file (around 20M+ rows) using SimpleDirectoryReader. It seems to struggle with handling such a large file.

Is it possible to read this file using CSVReader? Or are there any other recommended approaches within LlamaIndex for efficiently handling large CSV files?
2 comments
W
L
hey. i want to use the seed mechanism of openai. but i use query engine with my data, and it sends some additional data that i don't want to send it in prompt so i can use the seed mechanism properly. how can i choose what data to send what data to exclude in query engine?
7 comments
L
b
We are randomly getting this error with the multimodal azure openai package:

Plain Text
vision_service-1        | pydantic_core._pydantic_core.ValidationError: 2 validation errors for ChatMessage
vision_service-1        | blocks.0
vision_service-1        |   Unable to extract tag using discriminator ‘block_type’ [type=union_tag_not_found, input_value={‘type’: ‘text’, ‘text’: ‘Describe what you see’}, input_type=dict]
vision_service-1        |     For further information visit https://errors.pydantic.dev/2.9/v/union_tag_not_found
vision_service-1        | blocks.1
vision_service-1        |   Unable to extract tag using discriminator ‘block_type’ [type=union_tag_not_found, input_value={‘type’: ‘image_url’, ‘im...gg==’, ‘detail’: ‘low’}}, input_type=dict]

Anyone has an idea what is up? Nothing changed in our code.
17 comments
L
N
C
Is there any human feedback loop possible such that it can understand what answers the chat engine gave were good and some were not so good and so should take care in future response. We are giving feedback of good and bad response based on like and dislike button for each response
@Logan M @WhiteFang_Jr
27 comments
W
P
L
Does anyone have any findings around switching from gpt 3.5 to gpt 4o mini? I'm finding that structured content is quite a bit worse for gpt 4o mini vs 3.5, often failing to return the values in the correct format. Also the speed is quite a bit slower... But I feel we have to switch as the pricing is so much better...
5 comments
L
M
Hey guys, is there a way to force JSON mode over function calling for JSON with Pydantic models (OpenAI)? We are noticing 4o-mini is way worse at function calling compared to 3.5-turbo (which we want to deprecate).

Also sources taking about this: https://news.ycombinator.com/item?id=41173223
9 comments
W
N
L
Hi @All

I have 2 documents as 2 guide files on different topics in one index. When querying a guide, both documents contain that guide, and when the source returns, it also provides nodes from those 2 documents. How can I select the node that best matches the answer?
4 comments
W
B
Is LlamaIndex SOC2 type II certified?
2 comments
J
L