GenAI POC - Training
GenAI POC - Training
Production
Lessons Learned Developing a GraphRAG Production App
2. Streamlit → Self-Hosted
5. Logging
It worked, but…
"""
● LLM handler . . .
● Database handler
def get_response(self, question: str,
context: pd.DataFrame | None) -> str:
"""
Get a response from the LLM.
"""
. . .
9 Neo4j Inc. All rights reserved 2023
Notebooks → Streamlit
● Google Cloud Run to host our backend API & frontend React app
● Google Cloud DNS
● Google Cloud Secrets Manager
● Google Cloud Artifact Registry / Container repository
● Google Cloud Storage
Github
● Validate requests
and responses
● Perform logging in
the background
● Automatic
documentation
● Stateless
● Object
representation
● Advanced
validation
● Our data sources come in a variety of formats: unstructured, semi structured, and
unstructured.
● In anticipation of encoding our documents as embeddings, we chunk/partition the
documents using some logical pivot point
As the project progressed, we discussed what additional data sources could further
improve results. We decided to include:
● More code from public Neo4j repos
● Transcripts of trainings from the Neo4j YouTube Page
But…
● More is not always better. Instead of ALL YouTube trainings we focused on the
Going Meta series, which focuses on ontologies and GenAI
● Quality over quantity. We also emphasized ensuring we properly ingested code
repos, rather than arbitrary text lengths.
Graph of an actual conversation between an Agent Neo user and the ChatGPT-4 LLM.
Context Documents are labeled with their GDS Community.
27 Neo4j Inc. All rights reserved 2023
Advanced RAG Strategies
Parent-Child: Subset larger text chunks into smaller chunks for initial matching, then
retrieve the larger chunk for response generation.
Questions: Use our question logging to identify repeat questions and the grounding
data that was retrieved to produce answers. Also use an LLM to generate additional
questions from the grounding data.
Enhanced
Grounding Data
LLM Conversation
AI-Specific Regulations like the EU AI Act and potential regulations in the US and
elsewhere
Critical for production environments where the GenAI app responses may have
real-world implications