Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to staging #1005

Merged
merged 401 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
Show all changes
401 commits
Select commit Hold shift + click to select a range
d41a920
Post-Processing-Alerts (#758)
kartikpersistent Sep 24, 2024
5303f5c
added write access check
vasanthasaikalluri Sep 25, 2024
91a4d30
added write access param
vasanthasaikalluri Sep 25, 2024
2ab06d6
added fulltext creation
vasanthasaikalluri Sep 25, 2024
9414f31
disabled the write and delete actions for read only user mode
kartikpersistent Sep 26, 2024
85112a9
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Sep 26, 2024
f116300
modified query
vasanthasaikalluri Sep 26, 2024
dbb77d6
test updates
abhishekkumar-27 Sep 23, 2024
6d0e18b
test uupdated
abhishekkumar-27 Sep 26, 2024
db02bfa
Read Only User Support (#766)
kartikpersistent Sep 26, 2024
c7460de
storing the gds status and write access on refresh
kartikpersistent Sep 26, 2024
501ece4
Merge branch 'local_chat_history' of https://github.com/neo4j-labs/ll…
kartikpersistent Sep 26, 2024
ba6a9d2
Langchain libs update (#769)
aashipandya Sep 27, 2024
3c2e344
fixed the rerendering of the table while file status is processing
kartikpersistent Sep 27, 2024
292ae9e
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Sep 27, 2024
0d93f57
fix: Read Only User Fix
kartikpersistent Sep 27, 2024
dc994a2
Global search fulltext (#767)
prakriti-solankey Sep 27, 2024
1180406
Added elapsed time for extarction on each breakdown function
praveshkumar1988 Sep 27, 2024
9206fc8
lint and format fixes
prakriti-solankey Sep 27, 2024
34537f7
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
prakriti-solankey Sep 27, 2024
0405816
removed dev logs
kartikpersistent Sep 27, 2024
c9844b7
communities fix
prakriti-solankey Sep 27, 2024
e4c3349
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
prakriti-solankey Sep 27, 2024
085a0e4
disabled the generate graph for read only user
kartikpersistent Sep 27, 2024
7813750
format fixes
kartikpersistent Sep 27, 2024
7cb7957
graph labels change
prakriti-solankey Sep 27, 2024
b7559ac
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
prakriti-solankey Sep 27, 2024
e0e97fb
added the readonly check for already added waiting files
kartikpersistent Sep 27, 2024
42f4c82
Retriever evaluation using RAGAS
kaustubh-darekar Sep 27, 2024
c8e8387
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kaustubh-darekar Sep 27, 2024
e189ccd
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Sep 27, 2024
b663ff4
deleted unused file
kartikpersistent Sep 30, 2024
7c65344
code optimization using memo
kartikpersistent Sep 30, 2024
c69b708
Added elapsed_time on each api and getiing time per_entity
praveshkumar1988 Sep 30, 2024
393c53c
Added the post processing Alert showcasing the ongoing post processin…
kartikpersistent Oct 1, 2024
0dec005
fix: readonly user retry option disable
kartikpersistent Oct 1, 2024
ac3d88a
update script to get details of extarcted doc
abhishekkumar-27 Oct 3, 2024
83351ac
Issue fixed, Latency count per entity
praveshkumar1988 Oct 3, 2024
178dacb
Multiple chat modes selection (#780)
kartikpersistent Oct 4, 2024
1a33f0d
Fix: ChatModes DeSelection on FIle Selection
kartikpersistent Oct 7, 2024
e576055
Fix: Order of the chatmodes accordoing to selected chatmodes
kartikpersistent Oct 7, 2024
d1a56ca
Community optimization (#790)
vasanthasaikalluri Oct 9, 2024
7f255ee
Async way to create entities from multiple chunks (#788)
aashipandya Oct 9, 2024
943f539
fixed graph mode error (#792)
vasanthasaikalluri Oct 10, 2024
126dd48
Raga's Evaluation Metrics (#787)
kartikpersistent Oct 10, 2024
b8296e9
Openai gemini config (#794)
aashipandya Oct 10, 2024
b04f382
Added the user action for metrics table
kartikpersistent Oct 10, 2024
6aa84c7
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Oct 10, 2024
f97806c
Graph enhancements (#795)
prakriti-solankey Oct 10, 2024
ba95afd
format changes
prakriti-solankey Oct 10, 2024
0cc118d
Communities Bug fixes (#775)
prakriti-solankey Oct 10, 2024
fcb9ab5
llm name changes
kartikpersistent Oct 11, 2024
f505488
build fix
kartikpersistent Oct 11, 2024
37de220
default mode fix
kartikpersistent Oct 11, 2024
a538226
ragas model names update
kaustubh-darekar Oct 11, 2024
784caa6
lint fixes
kartikpersistent Oct 11, 2024
b814f71
Chunk Entities API condition
kartikpersistent Oct 11, 2024
69793a6
added the tooltip for unsupported lllms for ragas metric loading
kartikpersistent Oct 11, 2024
c5a3dbf
removed unused imports
kartikpersistent Oct 11, 2024
acdc886
multimode fix when we get error response
kartikpersistent Oct 11, 2024
2734c4a
mode changes for score display
prakriti-solankey Oct 11, 2024
cbd3f25
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
prakriti-solankey Oct 11, 2024
a12a6ab
fix: Fixed the details state handling between multiple chats
kartikpersistent Oct 15, 2024
ba091a0
Fix: Entity Mode Width Fix
kartikpersistent Oct 15, 2024
93c3dd3
diffbot fix for async (#797)
aashipandya Oct 15, 2024
821b0f4
Minor changes (#798)
vasanthasaikalluri Oct 15, 2024
702ebf7
New: Added the supported llm models for ragas evaluation
kartikpersistent Oct 15, 2024
3f1633c
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Oct 15, 2024
dcb3975
Fix: Communitites Tab is displayed based communitites length
kartikpersistent Oct 15, 2024
d3e5365
added the conversation download button (#800)
kartikpersistent Oct 15, 2024
0ff8bd1
model name correction
prakriti-solankey Oct 15, 2024
441908b
Merge branch 'STAGING' into DEV
prakriti-solankey Oct 15, 2024
09ea071
chatmode switch mode fix
kartikpersistent Oct 17, 2024
99dc052
Add API payload GCP logging (#805)
praveshkumar1988 Oct 18, 2024
a8f821a
Adding Links to get neighboring nodes (#796)
prakriti-solankey Oct 18, 2024
6c6da26
added error message for doc retriver (#807)
vasanthasaikalluri Oct 18, 2024
3d587f0
copy row (#803)
prakriti-solankey Oct 18, 2024
845bfb7
Raga's Evaluation For Multi Modes (#806)
kartikpersistent Oct 18, 2024
952291d
lint fixes
kartikpersistent Oct 18, 2024
f5a5edd
fix: multimode metrics state handling
kartikpersistent Oct 21, 2024
b3f1dd0
fix: Multimode metrics mode change state issue
kartikpersistent Oct 21, 2024
fb5e000
fix: list style fix
kartikpersistent Oct 21, 2024
fd224a1
Correct TYPO mistake
praveshkumar1988 Oct 21, 2024
cb77c18
added new env for ragas embedding model
vasanthasaikalluri Oct 21, 2024
986ae29
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
vasanthasaikalluri Oct 21, 2024
30d6ea8
Merge branch 'STAGING' into DEV
praveshkumar1988 Oct 21, 2024
5c0081e
Props name changes (#811)
kartikpersistent Oct 22, 2024
ee71002
test
prakriti-solankey Oct 22, 2024
c115014
view graph
prakriti-solankey Oct 22, 2024
c200b61
nodes count and relationshipcount updation fix
kartikpersistent Oct 22, 2024
1cc81ce
Merge branch 'STAGING' into DEV
kartikpersistent Oct 22, 2024
340679b
sourceUrl Fix
kartikpersistent Oct 22, 2024
055e40f
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Oct 22, 2024
fb35bda
empty string "" fix to keep the default values we should keep the val…
kartikpersistent Oct 23, 2024
ed18462
prop changes
kartikpersistent Oct 23, 2024
985993e
props changes
kartikpersistent Oct 23, 2024
220bee7
retry condition update for failed files (#820)
aashipandya Oct 23, 2024
0508585
Chat modes name changes (#815)
kartikpersistent Oct 23, 2024
9dba361
Youtube transcript fix with proxy (#822)
aashipandya Oct 23, 2024
6839e52
update script for async func
abhishekkumar-27 Oct 23, 2024
a5d29fa
ragas changes for graph retrieval mode. context added in api output (…
kaustubh-darekar Oct 24, 2024
cb59a2a
Remove extract latency from logging and add LIMIT in duplicate nodes
praveshkumar1988 Oct 24, 2024
93d7f3b
Document updates (#828)
kaustubh-darekar Oct 24, 2024
0d2882c
Update README.md
kartikpersistent Oct 24, 2024
6a6dc05
updated api structire in docs (#827)
vasanthasaikalluri Oct 24, 2024
29ef09b
Update backend_docs.adoc
karanchellani Oct 24, 2024
c5cd025
821 llm model listing (#823)
prakriti-solankey Oct 24, 2024
dfbb042
Merge branch 'STAGING' into DEV
kartikpersistent Oct 24, 2024
4bed352
Exclude session lable node from duplicate nodes list
praveshkumar1988 Oct 25, 2024
3dfb42b
Added the tooltip for disabled llm option (#835)
kartikpersistent Oct 25, 2024
4d795bf
node size changes
prakriti-solankey Oct 25, 2024
1fac375
mode removal of rows check
prakriti-solankey Oct 25, 2024
eb14fbe
formatting
prakriti-solankey Oct 25, 2024
0331cc7
Merge branch 'STAGING' into DEV
prakriti-solankey Oct 25, 2024
5cd9724
Exclude __Entity__ node label from duplicate node list
praveshkumar1988 Oct 25, 2024
70cb004
Update README.md
kartikpersistent Oct 28, 2024
bf51e78
Update README.md
kartikpersistent Oct 29, 2024
76b325c
Update README.md
kartikpersistent Oct 29, 2024
1d607bc
fixed the youtube link
kartikpersistent Oct 30, 2024
d8af5a5
Security header and GZIPMiddleware (#847)
praveshkumar1988 Nov 8, 2024
358d5a6
Chunk Text Details (#850)
kaustubh-darekar Nov 8, 2024
6d35a34
Communities Id to Title (#851)
prakriti-solankey Nov 8, 2024
cd6b4c2
disconnected nodes (#852)
prakriti-solankey Nov 8, 2024
282cfa0
loading changes
prakriti-solankey Nov 8, 2024
399785f
loading changes
prakriti-solankey Nov 8, 2024
686ed95
Update score.py
karanchellani Nov 11, 2024
4f1af18
added middleware
kartikpersistent Nov 12, 2024
1c29940
removed the unused state
kartikpersistent Nov 12, 2024
1d14749
Youtube timestamp (#877)
aashipandya Nov 14, 2024
d6f4ac6
Handled Nonetype error during global search. (#876)
kaustubh-darekar Nov 14, 2024
a5a989d
Additional metrics using ground truth (#855)
kartikpersistent Nov 15, 2024
f8a48d1
Url changes and state management (#870)
prakriti-solankey Nov 15, 2024
4da75b9
removed unused prop
kartikpersistent Nov 18, 2024
f143e9b
chat mode width fix
kartikpersistent Nov 18, 2024
8928ecb
Table selection Fix
kartikpersistent Nov 18, 2024
823faa0
Table issue (#885)
kartikpersistent Nov 18, 2024
ff63ca5
Logging properties update, remove payload json
praveshkumar1988 Nov 18, 2024
9a50138
fix: readme typos (#887)
marcoscannabrava Nov 19, 2024
cd6cbee
Break down nodes (#881)
kartikpersistent Nov 20, 2024
95eaf19
youtube url fix
kartikpersistent Nov 20, 2024
39e2807
Commented CSP middleware and added endpoint backend_connection_config…
praveshkumar1988 Nov 20, 2024
65c21ca
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
praveshkumar1988 Nov 20, 2024
c7b4dc0
added csp header
kartikpersistent Nov 20, 2024
f244b9f
removed the useEffect
kartikpersistent Nov 21, 2024
9d17ec1
Table issue (#888)
prakriti-solankey Nov 21, 2024
86c33ba
key fix
kartikpersistent Nov 21, 2024
09df9e6
Update README.md
kartikpersistent Nov 22, 2024
5610247
Update README.md
kartikpersistent Nov 22, 2024
a247d75
Update README.md
kartikpersistent Nov 22, 2024
69d46ab
removed extra document nodes and combine chunk logic (#894)
aashipandya Nov 22, 2024
4721318
Update README.md
prakriti-solankey Nov 22, 2024
ab0405f
Update README.md
kartikpersistent Nov 22, 2024
9628b6d
conditional deployment based on the enviornment
kartikpersistent Nov 22, 2024
009bc0c
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Nov 22, 2024
03526a4
Update README.md
kartikpersistent Nov 22, 2024
8562880
Update README.md
kartikpersistent Nov 22, 2024
c5603e6
removed the reference answer checkbox and textarea while additional m…
kartikpersistent Nov 22, 2024
7e8df27
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Nov 22, 2024
21e8855
LLM_MODELS
kartikpersistent Nov 22, 2024
33354f3
re process feature state renaming (#898)
kartikpersistent Nov 25, 2024
9e8ffca
Community Counts after post processing (#890)
kaustubh-darekar Nov 25, 2024
8af533c
format and checked fixes (#897)
prakriti-solankey Nov 25, 2024
4e20384
added info to show 50 chunks processing (#899)
prakriti-solankey Nov 26, 2024
b117df8
format and lint fixes
kartikpersistent Nov 26, 2024
f76d684
Env changes (#896)
prakriti-solankey Nov 26, 2024
63325f9
Update Content.tsx
kartikpersistent Nov 26, 2024
1992de7
Update Content.tsx
kartikpersistent Nov 26, 2024
3e34874
build fix
kartikpersistent Nov 27, 2024
22a57c5
communitifiles array check
kartikpersistent Nov 27, 2024
08a9755
combining one chunk (#901)
aashipandya Nov 28, 2024
3774a86
Delete query refined to delete all related nodes of file (#904)
kaustubh-darekar Nov 28, 2024
bf7b739
readonly change
prakriti-solankey Nov 28, 2024
f4e593e
Prod v6 fix (#909)
prakriti-solankey Dec 2, 2024
6b3c9c9
enable_communities flag removed in backend (#906)
kaustubh-darekar Dec 2, 2024
47a2db7
added multimode metrics for json and fix for gemini ground truth metrics
kartikpersistent Dec 3, 2024
40ac628
Enhancement default model selection (#911)
kartikpersistent Dec 3, 2024
9d023a4
Bug Fixing (#916)
prakriti-solankey Dec 3, 2024
b85d31e
Update documentation (#915)
kaustubh-darekar Dec 3, 2024
9784090
Updating langchain-neo4j package (#891)
kaustubh-darekar Dec 3, 2024
b09131e
gcs file existance check and reprocess from last processed position c…
aashipandya Dec 3, 2024
6e9edce
format and lint fixes
kartikpersistent Dec 4, 2024
c5d1532
Merge branch 'STAGING' into DEV
prakriti-solankey Dec 4, 2024
7dd80f9
Merge branch 'STAGING' of https://github.com/neo4j-labs/llm-graph-bui…
kartikpersistent Dec 4, 2024
a9420ae
updated requirements (#923)
aashipandya Dec 4, 2024
8ce1693
Update Constants.ts
kartikpersistent Dec 5, 2024
cc3dc3d
Metric table issues (#921)
kartikpersistent Dec 5, 2024
97990bd
test case updated
abhishekkumar-27 Dec 5, 2024
e8cc74b
updated test case
abhishekkumar-27 Dec 5, 2024
bad6389
elementid if no id is there
prakriti-solankey Dec 5, 2024
992fa9f
backenapi for all env
prakriti-solankey Dec 5, 2024
7b3b1b4
Bug fixing for Icon (#924)
prakriti-solankey Dec 5, 2024
fc85b45
diffbot placement
prakriti-solankey Dec 5, 2024
fac07e3
Update MultiModeMetrics.tsx
kartikpersistent Dec 5, 2024
0fa4d84
libmagic1 library added
aashipandya Dec 5, 2024
a86e07f
Document read me update (#926)
prakriti-solankey Dec 6, 2024
98cfc3c
metric table and default model fixes
kartikpersistent Dec 9, 2024
b671189
Updated code for duplicate nodes and index dimension mismatch (#929)
kaustubh-darekar Dec 10, 2024
c431903
Merge branch 'STAGING' into DEV
kartikpersistent Dec 10, 2024
01eb4a2
added autocomplete for better accessbility
kartikpersistent Dec 10, 2024
887e0b8
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Dec 10, 2024
1f74670
UX: improvement added deleteloader for chat
kartikpersistent Dec 11, 2024
e29ebb4
Merge branch 'STAGING' into DEV
kartikpersistent Dec 11, 2024
5d584f2
test updated
abhishekkumar-27 Dec 12, 2024
3c3a40d
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
abhishekkumar-27 Dec 12, 2024
44c183e
Integrate vector dimesion check in backend configuration API
praveshkumar1988 Dec 12, 2024
e4bf031
removed hardcoded CSS values (#934)
kartikpersistent Dec 13, 2024
4bfac7b
fixed responiveness of the table
kartikpersistent Dec 13, 2024
a67f918
Error & warning handling (#938)
kaustubh-darekar Dec 13, 2024
5a86987
Error handling for model format in backend & frontend env (#946)
kaustubh-darekar Dec 16, 2024
e954f99
Added the check to initilize DB connection when creds in env are not …
praveshkumar1988 Dec 16, 2024
2293ede
Correct TYPO mistake
praveshkumar1988 Dec 16, 2024
5b4fd5a
spell fix
kartikpersistent Dec 16, 2024
1ded64a
Handled EquivalentSchemaRuleAlreadyExist due to race condition (#949)
kaustubh-darekar Dec 17, 2024
b9a551a
added xlxs format support
kartikpersistent Dec 17, 2024
a69dca3
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Dec 17, 2024
20d1c3d
vector index name fixed (#950)
kaustubh-darekar Dec 17, 2024
c6ddc63
Update backend example.env
kaustubh-darekar Dec 18, 2024
633ed87
updated_libs (#955)
aashipandya Dec 18, 2024
41ae360
File expiration alert (#953)
kartikpersistent Dec 18, 2024
2ebfc2d
code simplification and warning fix
kartikpersistent Dec 19, 2024
dbe65a1
Put Grapd DB connection out of the loop to prevent pooling connection
praveshkumar1988 Dec 19, 2024
a05e87b
Merge branch 'STAGING' into DEV
prakriti-solankey Dec 19, 2024
60b4393
Resolved file not deleting in case of filesource missing. (#960)
kaustubh-darekar Dec 19, 2024
0f295e2
Update example.env
kaustubh-darekar Dec 23, 2024
b49fb9f
extracting entities from existing KG when certain nodes doesnt have i…
kaustubh-darekar Dec 23, 2024
f77893e
Issue fixed for web-URL when title and language not getting in metadata
praveshkumar1988 Dec 24, 2024
83d5a9d
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
praveshkumar1988 Dec 24, 2024
b4e242f
custom_change (#966)
prakriti-solankey Dec 26, 2024
e881915
Add loging for backend config API
praveshkumar1988 Dec 26, 2024
f08292c
GCS bucket file processing issue and custom exception for chunks alre…
aashipandya Dec 31, 2024
c8247f4
Removed commented code and unused library (#973)
praveshkumar1988 Dec 31, 2024
ef832d8
Changed delete query to delete documents in batches for efficient mem…
kaustubh-darekar Jan 2, 2025
fa25762
Title is blank from metadata then assingned from URL (#982)
praveshkumar1988 Jan 2, 2025
9655d1a
Added Effective search ratio (#981)
kaustubh-darekar Jan 2, 2025
edcce9e
Check chunks available to reprocess file (#984)
praveshkumar1988 Jan 2, 2025
1320884
Chunks Not created alert display
kartikpersistent Jan 3, 2025
320b975
Correct the message
praveshkumar1988 Jan 3, 2025
9e88b63
Update Content.tsx
kartikpersistent Jan 3, 2025
ec2055c
removed ready to reprocess check (#979)
prakriti-solankey Jan 7, 2025
894eb23
Removal of isSchema check for graphType post processing Job (#990)
prakriti-solankey Jan 8, 2025
117d287
Update README.md & FrontendDoc (#974)
prakriti-solankey Jan 8, 2025
5d0c8ec
Nova models trial. (#993)
kaustubh-darekar Jan 8, 2025
1732f2f
using hook for selectedNodes and Relation (#995)
prakriti-solankey Jan 8, 2025
8049c3d
Log entry error resolved (#994)
kaustubh-darekar Jan 14, 2025
1247a21
Spelling mistake fixed for condition of setting node_properties (#1004)
kaustubh-darekar Jan 14, 2025
e8a4617
Limit chunks to process (#1000)
praveshkumar1988 Jan 14, 2025
57a166d
Notebook for cleanup of graph model (#957)
aashipandya Jan 14, 2025
547c46e
check db version to execute admin command (#997)
praveshkumar1988 Jan 14, 2025
7f70fb9
custom error in extract and url_scan API as LLMGraphBuilderException.…
praveshkumar1988 Jan 14, 2025
e1db6ce
Merge branch 'STAGING' into DEV
kaustubh-darekar Jan 14, 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
Prev Previous commit
Next Next commit
added write access check
  • Loading branch information
vasanthasaikalluri committed Sep 25, 2024
commit 5303f5c132192569509a6e796388b0c3a890554c
6 changes: 4 additions & 2 deletions backend/score.py
Original file line number Diff line number Diff line change
@@ -296,7 +296,9 @@ async def chat_bot(uri=Form(),model=Form(None),userName=Form(), password=Form(),
graph = Neo4jGraph( url=uri,username=userName,password=password,database=database,sanitize = True, refresh_schema=True)
else:
graph = create_graph_database_connection(uri, userName, password, database)
result = await asyncio.to_thread(QA_RAG,graph=graph,model=model,question=question,document_names=document_names,session_id=session_id,mode=mode)
graph_DB_dataAccess = graphDBdataAccess(graph)
write_access = graph_DB_dataAccess.check_account_access(database=database)
result = await asyncio.to_thread(QA_RAG,graph=graph,model=model,question=question,document_names=document_names,session_id=session_id,mode=mode,write_access)

total_call_time = time.time() - qa_rag_start_time
logging.info(f"Total Response time is {total_call_time:.2f} seconds")
@@ -382,7 +384,7 @@ async def clear_chat_bot(uri=Form(),userName=Form(), password=Form(), database=F
async def connect(uri=Form(), userName=Form(), password=Form(), database=Form()):
try:
graph = create_graph_database_connection(uri, userName, password, database)
result = await asyncio.to_thread(connection_check_and_get_vector_dimensions, graph)
result = await asyncio.to_thread(connection_check_and_get_vector_dimensions, graph, database)
json_obj = {'api_name':'connect','db_url':uri,'status':result, 'count':1, 'logging_time': formatted_time(datetime.now(timezone.utc))}
logger.log_struct(json_obj, "INFO")
return create_api_response('Success',data=result)
10 changes: 5 additions & 5 deletions backend/src/QA_integration.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
from src.llm import get_llm
from src.shared.common_fn import load_embedding_model
from src.shared.constants import *

from src.graphDB_dataAccess import graphDBdataAccess
load_dotenv()

EMBEDDING_MODEL = os.getenv('EMBEDDING_MODEL')
@@ -560,13 +560,13 @@ def process_graph_response(model, graph, question, messages, history):
"user": "chatbot"
}

def create_neo4j_chat_message_history(graph, session_id, local=False):
def create_neo4j_chat_message_history(graph, session_id, write_access=True):
"""
Creates and returns a Neo4jChatMessageHistory instance.

"""
try:
if not local:
if write_access:
history = Neo4jChatMessageHistory(
graph=graph,
session_id=session_id
@@ -594,10 +594,10 @@ def get_chat_mode_settings(mode,settings_map=CHAT_MODE_CONFIG_MAP):

return chat_mode_settings

def QA_RAG(graph, model, question, document_names, session_id, mode):
def QA_RAG(graph,model, question, document_names, session_id, mode, write_access=True):
logging.info(f"Chat Mode: {mode}")

history = create_neo4j_chat_message_history(graph, session_id)
history = create_neo4j_chat_message_history(graph, session_id, write_access)
messages = history.messages

user_question = HumanMessage(content=question)
37 changes: 32 additions & 5 deletions backend/src/graphDB_dataAccess.py
Original file line number Diff line number Diff line change
@@ -141,6 +141,32 @@ def update_KNN_graph(self):
else:
logging.info("Vector index does not exist, So KNN graph not update")

def check_account_access(self, database):
query = """
SHOW USER PRIVILEGES
YIELD *
WHERE graph = $database AND action IN ['read', 'write']
RETURN COUNT(*) AS readAccessCount
"""
try:
logging.info(f"Checking access for database: {database}")

result = self.graph.query(query, params={"database": database})
read_access_count = result[0]["readAccessCount"] if result else 0

logging.info(f"Read access count: {read_access_count}")

if read_access_count > 0:
logging.info("The account has read access.")
return False
else:
logging.info("The account has write access.")
return True

except Exception as e:
logging.error(f"Error checking account access: {e}")
return False

def check_gds_version(self):
try:
gds_procedure_count = """
@@ -162,7 +188,7 @@ def check_gds_version(self):
logging.error(f"An error occurred while checking GDS version: {e}")
return False

def connection_check_and_get_vector_dimensions(self):
def connection_check_and_get_vector_dimensions(self,database):
"""
Get the vector index dimension from database and application configuration and DB connection status

@@ -189,18 +215,19 @@ def connection_check_and_get_vector_dimensions(self):
logging.info(f'embedding model:{embeddings} and dimesion:{application_dimension}')

gds_status = self.check_gds_version()
write_access = self.check_account_access(database=database)

if self.graph:
if len(db_vector_dimension) > 0:
return {'db_vector_dimension': db_vector_dimension[0]['vector_dimensions'], 'application_dimension':application_dimension, 'message':"Connection Successful","gds_status":gds_status}
return {'db_vector_dimension': db_vector_dimension[0]['vector_dimensions'], 'application_dimension':application_dimension, 'message':"Connection Successful","gds_status":gds_status,"write_access":write_access}
else:
if len(db_vector_dimension) == 0 and len(result_chunks) == 0:
logging.info("Chunks and vector index does not exists in database")
return {'db_vector_dimension': 0, 'application_dimension':application_dimension, 'message':"Connection Successful","chunks_exists":False,"gds_status":gds_status}
return {'db_vector_dimension': 0, 'application_dimension':application_dimension, 'message':"Connection Successful","chunks_exists":False,"gds_status":gds_status,"write_access":write_access}
elif len(db_vector_dimension) == 0 and result_chunks[0]['hasEmbedding']==0 and result_chunks[0]['chunks'] > 0:
return {'db_vector_dimension': 0, 'application_dimension':application_dimension, 'message':"Connection Successful","chunks_exists":True,"gds_status":gds_status}
return {'db_vector_dimension': 0, 'application_dimension':application_dimension, 'message':"Connection Successful","chunks_exists":True,"gds_status":gds_status,"write_access":write_access}
else:
return {'message':"Connection Successful","gds_status":gds_status}
return {'message':"Connection Successful","gds_status": gds_status,"write_access":write_access}

def execute_query(self, query, param=None):
return self.graph.query(query, param)
4 changes: 2 additions & 2 deletions backend/src/main.py
Original file line number Diff line number Diff line change
@@ -502,7 +502,7 @@ def update_graph(graph):
graph_DB_dataAccess.update_KNN_graph()


def connection_check_and_get_vector_dimensions(graph):
def connection_check_and_get_vector_dimensions(graph,database):
"""
Args:
uri: URI of the graph to extract
@@ -513,7 +513,7 @@ def connection_check_and_get_vector_dimensions(graph):
Returns a status of connection from NEO4j is success or failure
"""
graph_DB_dataAccess = graphDBdataAccess(graph)
return graph_DB_dataAccess.connection_check_and_get_vector_dimensions()
return graph_DB_dataAccess.connection_check_and_get_vector_dimensions(database)

def merge_chunks_local(file_name, total_chunks, chunk_dir, merged_dir):