Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
26581db
Read only mode for unauthenticated users (#1046)
kartikpersistent Jan 30, 2025
449552d
langchain updates (#1048)
prakriti-solankey Jan 30, 2025
2d86c5c
testing script changed for better logging errors and results of vario…
kaustubh-darekar Jan 30, 2025
578efad
Deepseek models integration (#1051)
kaustubh-darekar Jan 30, 2025
339488a
fixed top-line of drop-area (#1049)
kartikpersistent Jan 30, 2025
1dbd902
Schema viz (#1035)
prakriti-solankey Jan 30, 2025
6f3f863
updated to new ndl minor version and fixed sources modal display for …
kartikpersistent Feb 3, 2025
38eb72e
Chunk size overlap config (#1059)
prakriti-solankey Feb 7, 2025
6e60361
fix-load-existing-schema (#1061)
dhiaaeddine16 Feb 10, 2025
228ab9b
added bug report feature request and format fixes
kartikpersistent Feb 11, 2025
fbd9d3e
configured dependenabot for python
kartikpersistent Feb 11, 2025
6893a26
configuration fix
kartikpersistent Feb 11, 2025
4b831df
Fixed the logging time issue
praveshkumar1988 Feb 11, 2025
d53ba43
Backend connection config (#1060)
prakriti-solankey Feb 11, 2025
71e013e
Unable to get the status of document node resolved due to leading spa…
kaustubh-darekar Feb 11, 2025
d9a89f8
updated dependency
kartikpersistent Feb 11, 2025
2c8fe2a
Merge branch 'dev' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Feb 11, 2025
192a1bc
always show schema button
prakriti-solankey Feb 11, 2025
e8e576f
always show schema button
prakriti-solankey Feb 11, 2025
ed69115
uri
prakriti-solankey Feb 11, 2025
3624feb
Update README.md
kartikpersistent Feb 11, 2025
738eecc
Update README.md
kartikpersistent Feb 11, 2025
69a1003
Update README.md
kartikpersistent Feb 12, 2025
4c48124
Update README.md
kartikpersistent Feb 12, 2025
bd917ae
Fixed the create community issue for backend connection configuration
praveshkumar1988 Feb 12, 2025
8b8368b
removal of unused code
prakriti-solankey Feb 12, 2025
5591741
Support added for gpt 3o mini & gemini flash 2.0 in dev (#1069)
kaustubh-darekar Feb 12, 2025
6762367
Cancelling the API's on Unmounting phase (#1068)
kartikpersistent Feb 13, 2025
7f075d5
Merge branch 'staging' into dev
prakriti-solankey Feb 13, 2025
6a6c82c
removed unused neo4j-driver
kartikpersistent Feb 13, 2025
f198ca5
added auth0 in the frame src
kartikpersistent Feb 13, 2025
a72f3cf
message change
prakriti-solankey Feb 14, 2025
43d3bed
Update docker-compose.yml
kartikpersistent Feb 16, 2025
7bd5dd3
Bump tailwindcss from 3.4.9 to 4.0.6 in /frontend (#1091)
dependabot[bot] Feb 17, 2025
c198260
message check
prakriti-solankey Feb 17, 2025
a0cd597
V0.7.1 documentation updates (#1094)
kartikpersistent Feb 17, 2025
1cc723c
Merge branch 'staging' into dev
kartikpersistent Feb 17, 2025
db20e29
Merge branch 'staging' into dev
prakriti-solankey Feb 17, 2025
896bdee
Bump react-dropzone from 14.2.3 to 14.3.5 in /frontend (#1084)
dependabot[bot] Feb 18, 2025
8938cd1
Bump @typescript-eslint/eslint-plugin from 6.21.0 to 7.0.0 in /fronte…
dependabot[bot] Feb 18, 2025
4ea5305
Bump eslint-plugin-react-hooks from 4.6.2 to 5.1.0 in /frontend (#1082)
dependabot[bot] Feb 18, 2025
74e8bdc
Bump typescript from 5.5.4 to 5.7.3 in /frontend (#1081)
dependabot[bot] Feb 18, 2025
5444e6b
fix-additional-instructions (#1089)
dhiaaeddine16 Feb 18, 2025
041837d
V0.7.1 minor fixes (#1097)
praveshkumar1988 Feb 19, 2025
e81655d
remove try except from llm.py
praveshkumar1988 Feb 19, 2025
78f1015
Remove example.env from main folder (#1099)
praveshkumar1988 Feb 19, 2025
fcb6bcc
moved to taulwind 3
kartikpersistent Feb 20, 2025
5c2029c
tailwind 4 migration
kartikpersistent Feb 20, 2025
36f2548
format fixes
kartikpersistent Feb 20, 2025
7e7a2c3
Source list api convert to post (#1102)
kartikpersistent Feb 20, 2025
7186ac4
Merge branch 'staging' into dev
prakriti-solankey Feb 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions backend/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,14 @@ async def create_source_knowledge_graph_url(
# Set the status "Success" becuase we are treating these error already handled by application as like custom errors.
json_obj = {'error_message':error_message, 'status':'Success','db_url':uri, 'userName':userName, 'database':database,'success_count':1, 'source_type': source_type, 'source_url':source_url, 'wiki_query':wiki_query, 'logging_time': formatted_time(datetime.now(timezone.utc)),'email':email}
logger.log_struct(json_obj, "INFO")
logging.exception(f'File Failed in upload: {e}')
return create_api_response('Failed',message=message + error_message[:80],error=error_message,file_source=source_type)
except Exception as e:
error_message = str(e)
message = f" Unable to create source node for source type: {source_type} and source: {source}"
json_obj = {'error_message':error_message, 'status':'Failed','db_url':uri, 'userName':userName, 'database':database,'failed_count':1, 'source_type': source_type, 'source_url':source_url, 'wiki_query':wiki_query, 'logging_time': formatted_time(datetime.now(timezone.utc)),'email':email}
logger.log_struct(json_obj, "ERROR")
logging.exception(f'Exception Stack trace:')
logging.exception(f'Exception Stack trace upload:{e}')
return create_api_response('Failed',message=message + error_message[:80],error=error_message,file_source=source_type)
finally:
gc.collect()
Expand Down Expand Up @@ -284,6 +285,7 @@ async def extract_knowledge_graph_from_file(
json_obj = {'api_name':'extract','message':error_message,'file_created_at':formatted_time(node_detail[0]['created_time']),'error_message':error_message, 'file_name': file_name,'status':'Completed',
'db_url':uri, 'userName':userName, 'database':database,'success_count':1, 'source_type': source_type, 'source_url':source_url, 'wiki_query':wiki_query, 'logging_time': formatted_time(datetime.now(timezone.utc)),'email':email}
logger.log_struct(json_obj, "INFO")
logging.exception(f'File Failed in extraction: {e}')
return create_api_response("Failed", message = error_message, error=error_message, file_name=file_name)
except Exception as e:
message=f"Failed To Process File:{file_name} or LLM Unable To Parse Content "
Expand All @@ -295,26 +297,32 @@ async def extract_knowledge_graph_from_file(
json_obj = {'api_name':'extract','message':message,'file_created_at':formatted_time(node_detail[0]['created_time']),'error_message':error_message, 'file_name': file_name,'status':'Failed',
'db_url':uri, 'userName':userName, 'database':database,'failed_count':1, 'source_type': source_type, 'source_url':source_url, 'wiki_query':wiki_query, 'logging_time': formatted_time(datetime.now(timezone.utc)),'email':email}
logger.log_struct(json_obj, "ERROR")
logging.exception(f'File Failed in extraction: {e}')
return create_api_response('Failed', message=message + error_message[:100], error=error_message, file_name = file_name)
finally:
gc.collect()

@app.get("/sources_list")
async def get_source_list(uri:str=None, userName:str=None, password:str=None, email:str=None, database:str=None):
@app.post("/sources_list")
async def get_source_list(
uri=Form(None),
userName=Form(None),
password=Form(None),
database=Form(None),
email=Form(None)):
"""
Calls 'get_source_list_from_graph' which returns list of sources which already exist in databse
"""
try:
start = time.time()
if password is not None and password != "null":
decoded_password = decode_password(password)
else:
decoded_password = None
userName = None
database = None
if " " in uri:
uri = uri.replace(" ","+")
result = await asyncio.to_thread(get_source_list_from_graph,uri,userName,decoded_password,database)
# if password is not None and password != "null":
# decoded_password = decode_password(password)
# else:
# decoded_password = None
# userName = None
# database = None
# if " " in uri:
# uri = uri.replace(" ","+")
result = await asyncio.to_thread(get_source_list_from_graph,uri,userName,password,database)
end = time.time()
elapsed_time = end - start
json_obj = {'api_name':'sources_list','db_url':uri, 'userName':userName, 'database':database, 'logging_time': formatted_time(datetime.now(timezone.utc)), 'elapsed_api_time':f'{elapsed_time:.2f}','email':email}
Expand Down
2 changes: 1 addition & 1 deletion backend/src/document_sources/gcs_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def merge_file_gcs(bucket_name, original_file_name: str, folder_name_sha1_hashed
if blob.exists():
logging.info(f'Blob Name: {blob.name}')
chunks.append(blob.download_as_bytes())
blob.delete()
blob.delete()

merged_file = b"".join(chunks)
file_name_with__hashed_folder = folder_name_sha1_hashed +'/'+original_file_name
Expand Down
7 changes: 4 additions & 3 deletions backend/src/graphDB_dataAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ def update_exception_db(self, file_name, exp_msg, retry_condition):
try:
job_status = "Failed"
result = self.get_current_status_document_node(file_name)
is_cancelled_status = result[0]['is_cancelled']
if bool(is_cancelled_status) == True:
job_status = 'Cancelled'
if len(result) > 0:
is_cancelled_status = result[0]['is_cancelled']
if bool(is_cancelled_status) == True:
job_status = 'Cancelled'
if retry_condition is not None:
retry_condition = None
self.graph.query("""MERGE(d:Document {fileName :$fName}) SET d.status = $status, d.errorMessage = $error_msg, d.retry_condition = $retry_condition""",
Expand Down
36 changes: 16 additions & 20 deletions backend/src/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,20 @@ async def get_graph_document_list(
return graph_document_list

async def get_graph_from_llm(model, chunkId_chunkDoc_list, allowedNodes, allowedRelationship, chunks_to_combine, additional_instructions=None):
try:
llm, model_name = get_llm(model)
combined_chunk_document_list = get_combined_chunks(chunkId_chunkDoc_list, chunks_to_combine)

llm, model_name = get_llm(model)
combined_chunk_document_list = get_combined_chunks(chunkId_chunkDoc_list, chunks_to_combine)

if allowedNodes is None or allowedNodes=="":
allowedNodes =[]
else:
allowedNodes = allowedNodes.split(',')
if allowedRelationship is None or allowedRelationship=="":
allowedRelationship=[]
else:
allowedRelationship = allowedRelationship.split(',')

if allowedNodes is None or allowedNodes=="":
allowedNodes =[]
else:
allowedNodes = allowedNodes.split(',')
if allowedRelationship is None or allowedRelationship=="":
allowedRelationship=[]
else:
allowedRelationship = allowedRelationship.split(',')

graph_document_list = await get_graph_document_list(
llm, combined_chunk_document_list, allowedNodes, allowedRelationship, additional_instructions
)
return graph_document_list
except Exception as e:
err = f"Error during extracting graph with llm: {e}"
logging.error(err)
raise
graph_document_list = await get_graph_document_list(
llm, combined_chunk_document_list, allowedNodes, allowedRelationship, additional_instructions
)
return graph_document_list
12 changes: 6 additions & 6 deletions backend/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async def extract_graph_from_file_local_file(uri, userName, password, database,
file_name, pages, file_extension = get_documents_from_file_by_path(merged_file_path,fileName)
if pages==None or len(pages)==0:
raise LLMGraphBuilderException(f'File content is not available for file : {file_name}')
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, True, merged_file_path)
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, True, merged_file_path, additional_instructions=additional_instructions)
else:
return await processing_source(uri, userName, password, database, model, fileName, [], allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, True, merged_file_path, retry_condition, additional_instructions=additional_instructions)

Expand All @@ -247,7 +247,7 @@ async def extract_graph_from_file_s3(uri, userName, password, database, model, s

if pages==None or len(pages)==0:
raise LLMGraphBuilderException(f'File content is not available for file : {file_name}')
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine)
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, additional_instructions=additional_instructions)
else:
return await processing_source(uri, userName, password, database, model, file_name, [], allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, retry_condition=retry_condition, additional_instructions=additional_instructions)

Expand All @@ -256,7 +256,7 @@ async def extract_graph_from_web_page(uri, userName, password, database, model,
file_name, pages = get_documents_from_web_page(source_url)
if pages==None or len(pages)==0:
raise LLMGraphBuilderException(f'Content is not available for given URL : {file_name}')
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine)
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, additional_instructions=additional_instructions)
else:
return await processing_source(uri, userName, password, database, model, file_name, [], allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, retry_condition=retry_condition, additional_instructions=additional_instructions)

Expand All @@ -266,7 +266,7 @@ async def extract_graph_from_file_youtube(uri, userName, password, database, mod

if pages==None or len(pages)==0:
raise LLMGraphBuilderException(f'Youtube transcript is not available for file : {file_name}')
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine)
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, additional_instructions=additional_instructions)
else:
return await processing_source(uri, userName, password, database, model, file_name, [], allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, retry_condition=retry_condition, additional_instructions=additional_instructions)

Expand All @@ -275,7 +275,7 @@ async def extract_graph_from_file_Wikipedia(uri, userName, password, database, m
file_name, pages = get_documents_from_Wikipedia(wiki_query, language)
if pages==None or len(pages)==0:
raise LLMGraphBuilderException(f'Wikipedia page is not available for file : {file_name}')
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine)
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, additional_instructions=additional_instructions)
else:
return await processing_source(uri, userName, password, database, model, file_name,[], allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, retry_condition=retry_condition, additional_instructions=additional_instructions)

Expand All @@ -284,7 +284,7 @@ async def extract_graph_from_file_gcs(uri, userName, password, database, model,
file_name, pages = get_documents_from_gcs(gcs_project_id, gcs_bucket_name, gcs_bucket_folder, gcs_blob_filename, access_token)
if pages==None or len(pages)==0:
raise LLMGraphBuilderException(f'File content is not available for file : {file_name}')
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine)
return await processing_source(uri, userName, password, database, model, file_name, pages, allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, additional_instructions=additional_instructions)
else:
return await processing_source(uri, userName, password, database, model, file_name, [], allowedNodes, allowedRelationship, token_chunk_size, chunk_overlap, chunks_to_combine, retry_condition=retry_condition, additional_instructions=additional_instructions)

Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ services:
# - LLM_MODEL_CONFIG_bedrock_claude_3_5_sonnet=${LLM_MODEL_CONFIG_bedrock_claude_3_5_sonnet-}
# - LLM_MODEL_CONFIG_fireworks_qwen_72b=${LLM_MODEL_CONFIG_fireworks_qwen_72b-}
- LLM_MODEL_CONFIG_ollama_llama3=${LLM_MODEL_CONFIG_ollama_llama3-}
# env_file:
# - ./backend/.env
container_name: backend
extra_hosts:
- host.docker.internal:host-gateway
Expand Down
36 changes: 0 additions & 36 deletions example.env

This file was deleted.

12 changes: 6 additions & 6 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.0.7",
"@types/node": "^20.11.10",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
"autoprefixer": "^10.4.17",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.3",
"postcss": "^8.4.33",
"prettier": "^2.7.1",
"react-dropzone": "^14.2.3",
"tailwindcss": "^4.0.6",
"typescript": "^5.0.2",
"react-dropzone": "^14.3.5",
"tailwindcss": "^4.0.7",
"typescript": "^5.7.3",
"vite": "^4.5.3"
}
}
3 changes: 1 addition & 2 deletions frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
'@tailwindcss/postcss': {},
},
}
7 changes: 6 additions & 1 deletion frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
.layout-wrapper{
display: grid;
grid-template-rows: auto;
grid-template-columns: 64px 1fr minmax(min-content,4fr) 1.4fr 64px;
grid-template-columns: 64px 1fr minmax(min-content,4fr) 1.1fr 64px;
max-height: calc(100vh - 58px);
max-width: 100%;
}
Expand All @@ -356,3 +356,8 @@
position: relative;
height: 100%;
}
.sidenav-container{
height: calc(100vh - 58px);
min-height: 200px;
display: flex
}
8 changes: 4 additions & 4 deletions frontend/src/components/ChatBot/Chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
className='-ml-4'
hasStatus
name='KM'
size='x-large'
size='large'
source={ChatBotAvatar}
status={connectionStatus ? 'online' : 'offline'}
shape='square'
Expand All @@ -447,7 +447,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
className=''
hasStatus
name='KM'
size='x-large'
size='large'
status={connectionStatus ? 'online' : 'offline'}
shape='square'
type='image'
Expand All @@ -457,7 +457,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
<Widget
header=''
isElevated={true}
className={`p-4 self-start ${isFullScreen ? 'max-w-[55%]' : ''} ${
className={`p-3! self-start ${isFullScreen ? 'max-w-[55%]' : ''} ${
chat.user === 'chatbot' ? 'n-bg-palette-neutral-bg-strong' : 'n-bg-palette-primary-bg-weak'
}`}
>
Expand Down Expand Up @@ -612,7 +612,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
}}
>
<ArrowDownTrayIconOutline className='n-size-token-7' />
<TextLink ref={downloadLinkRef} className='!hidden'>
<TextLink ref={downloadLinkRef} className='hidden!'>
""
</TextLink>
</IconButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ExpandedChatButtonContainer: React.FC<IconProps> = ({ closeChatBot, delete
menuAnchor={chatAnchor}
isRoot={false}
/>
<div className='!h-[48px] mx-2 flex items-center'>
<div className='h-[48px]! mx-2 flex items-center'>
<div ref={chatAnchor}>
<IconButtonWithToolTip
onClick={() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ChatBot/MultiModeMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default function MultiModeMetrics({
}}
isAutoResizingColumns={true}
isLoading={metricsLoading}
// rootProps={{ className: isWithAdditionalMetrics === false ? '!w-[465px]' : 'auto' }}
// rootProps={{ className: isWithAdditionalMetrics === false ? 'w-[465px]!' : 'auto' }}
components={{
Body: () => (
<DataGridComponents.Body
Expand Down
Loading
Loading