Skip to content

Communities #721

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

Merged
merged 70 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
2c907fe
added communities creation
vasanthasaikalluri Aug 19, 2024
7081f13
added communities
vasanthasaikalluri Aug 20, 2024
57ee114
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
vasanthasaikalluri Aug 20, 2024
8e14771
removed tqdm
vasanthasaikalluri Aug 20, 2024
8ae3b99
removed __Entity__ labels
vasanthasaikalluri Aug 28, 2024
450ba6f
removed graph_object
vasanthasaikalluri Aug 28, 2024
266c812
removed graph object in the function
vasanthasaikalluri Aug 28, 2024
43ec569
Modified queries
vasanthasaikalluri Aug 29, 2024
dbfe2a7
added properties and modified to entity labels
vasanthasaikalluri Sep 2, 2024
3d25d78
Post processing call after all files completion (#716)
kartikpersistent Sep 3, 2024
8baedb0
modified the summary creation
vasanthasaikalluri Sep 3, 2024
87a9321
Merge branch 'communities' of https://github.com/neo4j-labs/llm-graph…
vasanthasaikalluri Sep 3, 2024
c666c36
fixed the summary creation
vasanthasaikalluri Sep 3, 2024
8215abd
refactored qa integration
vasanthasaikalluri Sep 5, 2024
3f98459
modified the chat mode settings
vasanthasaikalluri Sep 5, 2024
09b0180
renamed QA_integration
vasanthasaikalluri Sep 5, 2024
19b7bf2
added graphdatascience
vasanthasaikalluri Sep 5, 2024
c91febb
moved settings to constants
vasanthasaikalluri Sep 5, 2024
169c272
modified constants
vasanthasaikalluri Sep 5, 2024
1222942
Science Molecule & database icon addition (#722)
prakriti-solankey Sep 6, 2024
0c278de
Add communities check and show respective chat modes (#729)
kartikpersistent Sep 6, 2024
a12b7cd
added local search
vasanthasaikalluri Sep 10, 2024
0469138
725 add checkbox for create communities (#728)
prakriti-solankey Sep 11, 2024
177f6c8
modified local search query
vasanthasaikalluri Sep 11, 2024
36c9dd3
added entity details for chat
vasanthasaikalluri Sep 11, 2024
1aaeab6
modified chunkids
vasanthasaikalluri Sep 11, 2024
ebb4c91
modified chunk_entities
vasanthasaikalluri Sep 11, 2024
c72962c
Add communities Checkbox to graph viz (#739)
prakriti-solankey Sep 11, 2024
1ef2e29
Merge branch 'graph_communities' of https://github.com/neo4j-labs/llm…
prakriti-solankey Sep 12, 2024
ef77b50
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
prakriti-solankey Sep 12, 2024
fd12e9a
changed name
vasanthasaikalluri Sep 12, 2024
21dd283
modified the query
vasanthasaikalluri Sep 12, 2024
ccfabc7
updated entities param
vasanthasaikalluri Sep 12, 2024
dde29f2
added document to details
vasanthasaikalluri Sep 13, 2024
93a4698
added global embedding
vasanthasaikalluri Sep 13, 2024
7740336
Merge branch 'DEV' into communities
prakriti-solankey Sep 13, 2024
7e0f1c8
added database
vasanthasaikalluri Sep 13, 2024
1c302cb
Merge branch 'communities' of https://github.com/neo4j-labs/llm-graph…
vasanthasaikalluri Sep 13, 2024
d1eda2b
added database
vasanthasaikalluri Sep 13, 2024
3c0a5df
modified is_entity
vasanthasaikalluri Sep 13, 2024
9e34919
modifies chunk entities
vasanthasaikalluri Sep 16, 2024
62f454d
removed QA integration
vasanthasaikalluri Sep 16, 2024
4c7821e
created neo4j from existing index
vasanthasaikalluri Sep 16, 2024
801745e
Integrate local search to chat details (#746)
prakriti-solankey Sep 16, 2024
8f0a706
removed entity label
vasanthasaikalluri Sep 16, 2024
bc09b86
Added Description to chat mode menu (#743)
prakriti-solankey Sep 16, 2024
dd89e0b
community check
prakriti-solankey Sep 16, 2024
6ed968d
Entity Empty Label fix and Icon
kartikpersistent Sep 17, 2024
9237847
Update Utils.ts
prakriti-solankey Sep 17, 2024
dff7535
removed __Entity__ labels
vasanthasaikalluri Sep 17, 2024
e3bcf2b
spell fix
kartikpersistent Sep 17, 2024
a86dd12
fixed postprocessing method invoking issue for odd no files
kartikpersistent Sep 18, 2024
ba0957e
lint fix
kartikpersistent Sep 18, 2024
3fecf70
Added filesource and name in chunks
kartikpersistent Sep 18, 2024
d6b2e6a
Merge branch 'DEV' into communities
kartikpersistent Sep 18, 2024
1695f19
Graph communities (#748)
prakriti-solankey Sep 18, 2024
f0810c7
aria label addition
prakriti-solankey Sep 18, 2024
a1dce53
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
prakriti-solankey Sep 18, 2024
869c87e
code improvements used URL class for host url check
kartikpersistent Sep 19, 2024
b2097e5
host level check
kartikpersistent Sep 19, 2024
1246b41
encryption of localstorage values
kartikpersistent Sep 19, 2024
0ec6846
Merge branch 'communities' of https://github.com/neo4j-labs/llm-graph…
prakriti-solankey Sep 19, 2024
1709a16
'mode-selection-changes'
prakriti-solankey Sep 19, 2024
f84e5c3
Merge branch 'communities' of https://github.com/neo4j-labs/llm-graph…
prakriti-solankey Sep 19, 2024
4756647
Merge branch 'DEV' into communities
kartikpersistent Sep 19, 2024
9210bf8
added neo4j from existing index to entity vector mode
vasanthasaikalluri Sep 19, 2024
2711b0c
Merge branch 'communities' of https://github.com/neo4j-labs/llm-graph…
vasanthasaikalluri Sep 19, 2024
b5b8545
label changes
prakriti-solankey Sep 19, 2024
6d9ae8a
Merge branch 'communities' of https://github.com/neo4j-labs/llm-graph…
prakriti-solankey Sep 19, 2024
8b6b930
Merge branch 'DEV' into communities
kartikpersistent Sep 20, 2024
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
5 changes: 3 additions & 2 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ requests==2.32.3
rsa==4.9
s3transfer==0.10.1
safetensors==0.4.1
scipy==1.10.1
shapely==2.0.3
six==1.16.0
sniffio==1.3.1
Expand Down Expand Up @@ -179,4 +178,6 @@ sentence-transformers==3.0.1
google-cloud-logging==3.10.0
PyMuPDF==1.24.5
pypandoc==1.13
Secweb==1.11.0
graphdatascience==1.10
Secweb==1.11.0

24 changes: 13 additions & 11 deletions backend/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from fastapi_health import health
from fastapi.middleware.cors import CORSMiddleware
from src.main import *
from src.QA_integration_new import *
from src.QA_integration import *
from src.entities.user_credential import user_credential
from src.shared.common_fn import *
import uvicorn
Expand All @@ -16,6 +16,7 @@
from src.chunkid_entities import get_entities_from_chunkids
from src.post_processing import create_fulltext, create_entity_embedding
from sse_starlette.sse import EventSourceResponse
from src.communities import create_communities
import json
from typing import List, Mapping
from starlette.middleware.sessions import SessionMiddleware
Expand Down Expand Up @@ -47,11 +48,6 @@ def sick():
return False

app = FastAPI()
SecWeb(app=app, Option={'referrer': False, 'xframe': False})
# app.add_middleware(HSTS, Option={'max-age': 4})
# app.add_middleware(ContentSecurityPolicy, Option={'default-src': ["'self'"], 'base-uri': ["'self'"], 'block-all-mixed-content': []}, script_nonce=False, style_nonce=False, report_only=False)
# app.add_middleware(XContentTypeOptions)
# app.add_middleware(XFrame, Option={'X-Frame-Options': 'DENY'})

app.add_middleware(
CORSMiddleware,
Expand Down Expand Up @@ -268,8 +264,12 @@ async def post_processing(uri=Form(), userName=Form(), password=Form(), database
await asyncio.to_thread(create_entity_embedding, graph)
json_obj = {'api_name': 'post_processing/create_entity_embedding', 'db_url': uri, 'logging_time': formatted_time(datetime.now(timezone.utc))}
logging.info(f'Entity Embeddings created')

logger.log_struct(json_obj, "INFO")
if "create_communities" in tasks:
model = "openai-gpt-4o"
await asyncio.to_thread(create_communities, uri, userName, password, database,model)
josn_obj = {'api_name': 'post_processing/create_communities', 'db_url': uri, 'logging_time': formatted_time(datetime.now(timezone.utc))}
logger.log_struct(josn_obj)
logging.info(f'created communities')
return create_api_response('Success', message='All tasks completed successfully')

except Exception as e:
Expand Down Expand Up @@ -311,10 +311,10 @@ async def chat_bot(uri=Form(),model=Form(None),userName=Form(), password=Form(),
gc.collect()

@app.post("/chunk_entities")
async def chunk_entities(uri=Form(),userName=Form(), password=Form(), chunk_ids=Form(None)):
async def chunk_entities(uri=Form(),userName=Form(), password=Form(), database=Form(), chunk_ids=Form(None),is_entity=Form()):
try:
logging.info(f"URI: {uri}, Username: {userName}, chunk_ids: {chunk_ids}")
result = await asyncio.to_thread(get_entities_from_chunkids,uri=uri, username=userName, password=password, chunk_ids=chunk_ids)
result = await asyncio.to_thread(get_entities_from_chunkids,uri=uri, username=userName, password=password, database=database,chunk_ids=chunk_ids,is_entity=json.loads(is_entity.lower()))
json_obj = {'api_name':'chunk_entities','db_url':uri, 'logging_time': formatted_time(datetime.now(timezone.utc))}
logger.log_struct(json_obj, "INFO")
return create_api_response('Success',data=result)
Expand All @@ -330,6 +330,7 @@ async def chunk_entities(uri=Form(),userName=Form(), password=Form(), chunk_ids=
@app.post("/graph_query")
async def graph_query(
uri: str = Form(),
database: str = Form(),
userName: str = Form(),
password: str = Form(),
document_names: str = Form(None),
Expand All @@ -341,6 +342,7 @@ async def graph_query(
uri=uri,
username=userName,
password=password,
database=database,
document_names=document_names
)
json_obj = {'api_name':'graph_query','db_url':uri,'document_names':document_names, 'logging_time': formatted_time(datetime.now(timezone.utc))}
Expand Down Expand Up @@ -451,7 +453,7 @@ async def generate():
graph = create_graph_database_connection(uri, userName, decoded_password, database)
graphDb_data_Access = graphDBdataAccess(graph)
result = graphDb_data_Access.get_current_status_document_node(file_name)
print(f'Result of document status in SSE : {result}')
# print(f'Result of document status in SSE : {result}')
if len(result) > 0:
status = json.dumps({'fileName':file_name,
'status':result[0]['Status'],
Expand Down
Loading