Hybrid Cypher GraphRAG
The HybridCypherRetriever enhances the hybrid search process by adding a graph traversal step. It begins by identifying an initial set of nodes through a combined search over vector and full-text indexes, then uses a specified Cypher query to retrieve additional information from the graph for each of these nodes.
To make use of this retriever, we first need to write a Cypher query to specify exactly what additional information to fetch along with each of the nodes retrieved through hybrid search. Given we are looking to answer questions about actors in movies, we can use the following query:
Preamble¶
NOTE: The APOC core library must be installed in your Neo4j instance (Installation)
In [ ]:
Copied!
%pip install -e ..
%pip install -e ..
In [17]:
Copied!
from ragsphere import RAG
from ragsphere.models import Text2CypherRetrieverConfig
from ragsphere.graphrag import Text2CypherRetriever
from ragsphere import RAG
from ragsphere.models import Text2CypherRetrieverConfig
from ragsphere.graphrag import Text2CypherRetriever
Indexing Configuration¶
In [26]:
Copied!
# Default configuration
indexer = HybridGRIndexer()
# Default configuration
indexer = HybridGRIndexer()
In [27]:
Copied!
indexer_config_dict = {
"similarity_fn": "cosine",
"f_index_name": "ft_index_all",
"v_index_name": "vector_index_all",
"target_nodes": None,
"property_limit": 40
}
indexer_config_class = HybridGRIndexerConfig(**indexer_config_dict)
indexer_with_dict = HybridGRIndexer(indexer_config_dict) # parameter=indexer_config_dict
indexer_with_class = HybridGRIndexer(config=indexer_config_class)
indexer_config_dict = {
"similarity_fn": "cosine",
"f_index_name": "ft_index_all",
"v_index_name": "vector_index_all",
"target_nodes": None,
"property_limit": 40
}
indexer_config_class = HybridGRIndexerConfig(**indexer_config_dict)
indexer_with_dict = HybridGRIndexer(indexer_config_dict) # parameter=indexer_config_dict
indexer_with_class = HybridGRIndexer(config=indexer_config_class)
In [28]:
Copied!
print(indexer_config_class)
print(indexer_with_dict.config)
print(indexer_with_class.config)
print(indexer_config_class)
print(indexer_with_dict.config)
print(indexer_with_class.config)
HybridGRIndexerConfig(similarity_fn='cosine', f_index_name='ft_index_all', v_index_name='vector_index_all', target_nodes=None, property_limit=40) HybridGRIndexerConfig(similarity_fn='cosine', f_index_name='ft_index_all', v_index_name='vector_index_all', target_nodes=None, property_limit=40) HybridGRIndexerConfig(similarity_fn='cosine', f_index_name='ft_index_all', v_index_name='vector_index_all', target_nodes=None, property_limit=40)
Retrieval Configuration¶
In [14]:
Copied!
# Default configuration
retriever = HybridCypherGRRetriever()
# Default configuration
retriever = HybridCypherGRRetriever()
In [15]:
Copied!
retriever_config_dict = {
"similarity_fn": "cosine",
"f_index_name": "ft_index_all",
"v_index_name": "vector_index_all",
"top_k": 5,
}
retriever_config_class = HybridCypherGRRetrieverConfig(**retriever_config_dict)
retriever_with_dict = HybridGRRetriever(retriever_config_dict) # parameter=retriever_config_dict
retriever_with_class = HybridGRRetriever(config=retriever_config_class)
retriever_config_dict = {
"similarity_fn": "cosine",
"f_index_name": "ft_index_all",
"v_index_name": "vector_index_all",
"top_k": 5,
}
retriever_config_class = HybridCypherGRRetrieverConfig(**retriever_config_dict)
retriever_with_dict = HybridGRRetriever(retriever_config_dict) # parameter=retriever_config_dict
retriever_with_class = HybridGRRetriever(config=retriever_config_class)
In [16]:
Copied!
print(retriever_config_class)
print(retriever_with_dict.config)
print(retriever_with_class.config)
print(retriever_config_class)
print(retriever_with_dict.config)
print(retriever_with_class.config)
HybridCypherGRRetrieverConfig(top_k=5, similarity_fn='cosine', f_index_name='ft_index_all', v_index_name='vector_index_all') HybridGRRetrieverConfig(top_k=5, similarity_fn='cosine', f_index_name='ft_index_all', v_index_name='vector_index_all', return_properties=None) HybridCypherGRRetrieverConfig(top_k=5, similarity_fn='cosine', f_index_name='ft_index_all', v_index_name='vector_index_all')
Instantiation¶
Default
In [11]:
Copied!
rag = RAG(
indexer = "graphrag",
retriever = "graphrag",
verbosity=1
)
rag = RAG(
indexer = "graphrag",
retriever = "graphrag",
verbosity=1
)
2025-10-01 23:27:09,994 - INFO - RAG initialized with verbosity 1 2025-10-01 23:27:10,013 - INFO - The indexing technique is set to: 'graphrag' 2025-10-01 23:27:10,014 - INFO - The retrieval technique is set to: 'graphrag' 2025-10-01 23:27:10,016 - INFO - The document path has not been specified. 2025-10-01 23:27:10,017 - INFO - Using default path: '../db/data' 2025-10-01 23:27:10,018 - INFO - The graph database has not been specified. 2025-10-01 23:27:10,020 - INFO - Using default graph database: 'Neo4j' 2025-10-01 23:27:10,020 - INFO - The vector database has not been specified. 2025-10-01 23:27:10,020 - INFO - Using default vector database: 'Neo4j' 2025-10-01 23:27:10,020 - INFO - The indexing LLM has not been specified. 2025-10-01 23:27:10,026 - INFO - Using the default indexing LLM: 'llama3.3:latest' 2025-10-01 23:27:10,026 - INFO - The query LLM has not been specified. 2025-10-01 23:27:10,029 - INFO - Using the default query LLM: 'llama3.3:latest' 2025-10-01 23:27:10,030 - INFO - The embedding model has not been specified. 2025-10-01 23:27:10,032 - INFO - Using the default embedding model: 'all-MiniLM-L6-v2' 2025-10-01 23:27:10,033 - INFO - Successfully loaded
Custom Option 1
In [32]:
Copied!
# Vector GraphRAG
rag = RAG(
indexer = "vectorgraphrag",
indexer_config = indexer_config_dict,
retriever = "vectorgraphrag",
retriever_config = retriever_config_dict,
verbosity=1
)
# Vector GraphRAG
rag = RAG(
indexer = "vectorgraphrag",
indexer_config = indexer_config_dict,
retriever = "vectorgraphrag",
retriever_config = retriever_config_dict,
verbosity=1
)
2026-02-09 15:01:06,061 - INFO - RAG initialized with verbosity 1 2026-02-09 15:01:06,064 - INFO - The indexing technique is set to: 'vectorgraphrag' 2026-02-09 15:01:06,065 - INFO - The retrieval technique is set to: 'vectorgraphrag' 2026-02-09 15:01:06,066 - INFO - The document path has not been specified. 2026-02-09 15:01:06,067 - INFO - Using default path: '../db/data' 2026-02-09 15:01:06,068 - INFO - The graph database has not been specified. 2026-02-09 15:01:06,069 - INFO - Using default graph database: 'Neo4j' 2026-02-09 15:01:06,070 - INFO - The vector database has not been specified. 2026-02-09 15:01:06,071 - INFO - Using default vector database: 'Neo4j' 2026-02-09 15:01:06,072 - INFO - The indexing LLM has not been specified. 2026-02-09 15:01:06,073 - INFO - Using the default indexing LLM: 'gpt-oss:120b' 2026-02-09 15:01:06,073 - INFO - The query LLM has not been specified. 2026-02-09 15:01:06,074 - INFO - Using the default query LLM: 'gpt-oss:120b' 2026-02-09 15:01:06,074 - INFO - The embedding model has not been specified. 2026-02-09 15:01:06,076 - INFO - Using the default embedding model: 'all-MiniLM-L6-v2' 2026-02-09 15:01:06,076 - INFO - Successfully loaded
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[32], line 2 1 # Vector GraphRAG ----> 2 rag = RAG( 3 indexer = "vectorgraphrag", 4 indexer_config = indexer_config_dict, 5 retriever = "vectorgraphrag", 6 retriever_config = retriever_config_dict, 7 verbosity=1 8 ) File ~\Desktop\RAGsphere\RAGLib-branch\ragsphere\rag.py:261, in RAG.__init__(self, documents, graph_db, vector_db, indexer, indexer_config, retriever_config, retriever, llm_index, llm_query, emb_model, verbosity) 249 self.indexer_engine = IndexerEngine( 250 documents=self.documents, 251 llm=self.llm_index, (...) 257 config=self.config, 258 ) 260 # Load the Query Engine --> 261 self.query_engine = QueryEngine( 262 documents=self.documents, 263 llm=self.llm_query, 264 emb_model=self.emb_model, 265 graph_db=self.graph_db, 266 vector_db=self.vector_db, 267 retriever=self.retriever, 268 retriever_config=self.retriever_config, 269 config=self.config, 270 ) File ~\Desktop\RAGsphere\RAGLib-branch\ragsphere\query_engine.py:102, in QueryEngine.__init__(self, config, documents, graph_db, vector_db, retriever, llm, emb_model, retriever_config) 100 config_class = self._get_retriever_config_class(retriever) 101 # Override default retriever settings --> 102 self.retriever_config = config_class(**retriever_config) 104 # Set retrieval technique 105 if isinstance(retriever, RetrieverType): TypeError: VectorGRRetrieverConfig.__init__() got an unexpected keyword argument 'examples'
Indexing¶
In [26]:
Copied!
# Indexing for hybridgaphrag
rag.index(verbosity=1)
# Indexing for hybridgaphrag
rag.index(verbosity=1)
2026-02-09 14:00:01,095 - WARNING - No indexing technique has been specified.
Retrieval¶
In [27]:
Copied!
query_text = "List all anomaly report IDs"
#query_text = "What is the structure of the anomaly reports?"
retrieval_query = "MATCH (a:AnomalyReport) RETURN a.reportId"
response = rag.query(
prompt=query_text,
#retrieval_query=retrieval_query,
verbosity=1
)
query_text = "List all anomaly report IDs"
#query_text = "What is the structure of the anomaly reports?"
retrieval_query = "MATCH (a:AnomalyReport) RETURN a.reportId"
response = rag.query(
prompt=query_text,
#retrieval_query=retrieval_query,
verbosity=1
)
2026-02-09 14:01:07,278 - INFO - DOING 'text2cypher' RETRIEVAL WITH Text2CypherRetrieverConfig(top_k=0, examples=["USER INPUT: 'Which actors starred in the Matrix?' QUERY: MATCH (p:Person)-[:ACTED_IN]->(m:Movie) WHERE m.title = 'The Matrix' RETURN p.name"]) 2026-02-09 14:01:07,279 - INFO - USING THE FOLLOWING QUERY: 'List all anomaly report IDs'
Connection successful: True
{"temperature": 0}
2026-02-09 14:01:18,723 - INFO - HTTP Request: POST http://sc-030362l.intra.dlr.de:11434/api/chat "HTTP/1.1 200 OK"
In [8]:
Copied!
response["answer"]
response["answer"]
Out[8]:
'The anomaly reports are stored as JSON‑style dictionaries that follow a fairly regular schema. \nAlthough a few fields appear only on certain reports (e.g., the older EPDS/ECLSS entries), the bulk of the reports share the same logical sections:\n\n| **Section** | **Typical Keys** | **What the key holds** |\n|-------------|------------------|------------------------|\n| **Identification / Metadata** | `reportId`, `eventId`, `eventDate` / `eventStart` / `eventEnd`, `creationDate`, `eventGMT`, `eventReference` | Unique IDs, timestamps (UTC), human‑readable reference numbers |\n| **Classification** | `class`, `criticality`, `status`, `forwardStatus`, `eventClass`, `eventCode` | Severity, current workflow state, type of event (anomaly, etc.) |\n| **Subsystem / Context** | `subsystem`, `eventName`, `title` | Which payload or ISS system is involved and a short title |\n| **Description & Environment** | `description`, `environment`, `notes` | Narrative of what happened, surrounding conditions, any crew observations |\n| **Analysis & Recommendations** | `analysis`, `recommendedSolution`, `opsImpact`, `opsProductRef` | Preliminary cause analysis, suggested corrective actions, impact on operations, reference documents |\n| **Real‑Time Information** | `realTimeActions`, `realTimeResponse`, `realTimeAssessment` | What was done immediately, crew instructions, initial assessment |\n| **Operational Details** | `eventStartTrigger`, `eventEndTrigger`, `reportedStart`, `reportedDuration`, `reportedEnd` | Triggers that started/ended the event and the duration as reported |\n| **Procedural Links** | `children`, `duplicates` | Links to related reports or follow‑on actions |\n| **Additional Technical Data** | `NodeEmbedding` (usually null), `eventCode` (numeric or string), `eventStartTrigger`, `eventEndTrigger` | Miscellaneous fields that may be used by downstream tools |\n\n### Example of a “full‑featured” MARES anomaly report\n```json\n{\n "NodeEmbedding": null,\n "recommendedSolution": "Perform a detailed analysis …",\n "eventDate": "2022-07-25T14:20:00Z",\n "duplicates": [],\n "status": "OPEN",\n "opsImpact": "The anomaly impacted the current science operation …",\n "opsProductRef": "Refer to the MARES payload operations manual …",\n "realTimeActions": "YES",\n "children": [],\n "class": "C",\n "eventGMT": "207/14:20:00",\n "analysis": "The preliminary analysis suggests …",\n "reportId": "3.json",\n "forwardStatus": "NEW",\n "criticality": "CRITICAL",\n "creationDate": "2022-07-25T14:30:00Z",\n "title": "Anomaly in MARES Payload Communication via HRCS and Impact on COU",\n "environment": "The MARES payload was in operational mode …",\n "realTimeResponse": "The POCC team immediately responded …",\n "description": "On July 25, 2022, at 14:20 UTC, an unexpected loss of signal …",\n "realTimeAssessment": "The initial assessment indicated a potential communication issue …",\n "subsystem": "MARES"\n}\n```\n\n### Example of an older EPDS/ECLSS report\n```json\n{\n "eventStart": "2020-04-15T13:45:00+00:00",\n "eventEnd": "2020-04-15T14:10:30+00:00",\n "eventClass": "anomaly",\n "reportedDuration": "PT1H15M25S",\n "reportedStart": "2020-04-15T13:45:05+00:00",\n "eventStartTrigger": "EPDS_O2LeakDetectThresh_0.5",\n "eventId": "6.json",\n "eventEndTrigger": "EPDS_O2LeakDetectThresh_1.0",\n "eventCode": "52010A1",\n "subsystem": "EPDS",\n "eventName": "O2 Leak Detection in EPDS",\n "notes": "Airlock depressurization detected …",\n "eventReference": "Columbus Anomaly Report 2020041501"\n}\n```\n\nIn summary, each anomaly report is a self‑contained JSON object that groups together:\n\n1. **Metadata & identifiers** (IDs, timestamps, references) \n2. **Classification** (severity, status, type) \n3. **Subsystem & title** (what system, short name) \n4. **Narrative** (description, environment, notes) \n5. **Analysis & recommended actions** (root‑cause hypotheses, next steps) \n6. **Real‑time handling** (what was done immediately) \n7. **Operational impact** (effects on science, crew, ISS) \n8. **Linkage to other reports** (children, duplicates) \n\nThis consistent structure makes it easy for downstream tools (search, reporting, trend analysis) to ingest and process the anomaly data.'
In [9]:
Copied!
for result_item in response["retriever_result"]:
print("Content: \n", result_item.content)
for result_item in response["retriever_result"]:
print("Content: \n", result_item.content)
Content:
{'NodeEmbedding': None, 'recommendedSolution': 'Perform a detailed analysis of the HRCS system and the TWT amplifier to determine the root cause of the anomaly. Update the ODF to reflect the new configuration, and schedule a CART session to discuss the findings and recommend further actions. Consider performing an AIT to verify the functionality of the EVSU and the PDU.', 'eventDate': '2022-07-25T14:20:00Z', 'duplicates': [], 'status': 'OPEN', 'opsImpact': 'The anomaly impacted the current science operation, and the activity was aborted. The crew will need to reschedule the experiment for a later time. The anomaly did not affect the safety of the crew or the ISS, but it may have an impact on the scientific objectives of the mission.', 'opsProductRef': 'Refer to the MARES payload operations manual, the HRCS system documentation, and the POCC procedures for further information.', 'realTimeActions': 'YES', 'children': [], 'class': 'C', 'eventGMT': '207/14:20:00', 'analysis': 'The preliminary analysis suggests that the anomaly may be related to a software issue or a hardware failure in the HRCS system. Further investigation is required to determine the root cause and to develop a plan to prevent similar anomalies from occurring in the future. The APT will review the findings and provide recommendations for future operations.', 'reportId': '3.json', 'forwardStatus': 'NEW', 'criticality': 'CRITICAL', 'creationDate': '2022-07-25T14:30:00Z', 'title': 'Anomaly in MARES Payload Communication via HRCS and Impact on COU', 'environment': 'The MARES payload was in operational mode, and the HRCS system was configured for high-gain communication. The crew was performing routine maintenance tasks, and the CBCS cameras were monitoring the activity. The LTL was in nominal operation, and the ATC system was maintaining the desired temperature range.', 'realTimeResponse': 'The POCC team immediately responded to the anomaly by notifying the crew and initiating an investigation. The crew was instructed to stand by while the issue was being resolved, and the science operation was put on hold. The CBCS cameras were used to monitor the activity, and the LTL was checked to ensure nominal operation.', 'description': 'On July 25, 2022, at 14:20 UTC, an unexpected loss of signal was observed in the MARES payload communication via the HRCS system. The BITE checks were performed, and the results indicated a potential issue with the TWT amplifier. The event occurred during a routine science operation, and the crew was in the process of configuring the PUL for the next experiment. The MAL was triggered, and the POCC team was notified. Further analysis is required to determine the root cause of the anomaly, which may be related to the ICD specifications or the VHF communication protocol.', 'realTimeAssessment': 'The initial assessment indicated a potential communication issue, and the crew was notified to stand by while the POCC team investigated the anomaly. The real-time data indicated a loss of signal, and the MAL was triggered to alert the crew and the ground team.', 'subsystem': 'MARES'}
Content:
{'NodeEmbedding': None, 'recommendedSolution': "Perform a detailed analysis of the BITE data and HRCS logs to identify the cause of the disconnection. If necessary, update the OSTP to include additional troubleshooting steps or schedule a CART session for further investigation. Consider performing an ACO procedure to verify the system's functionality before resuming experiment operations.", 'eventDate': '2022-07-25T14:20:00Z', 'duplicates': [], 'status': 'OPEN', 'opsImpact': 'The anomaly resulted in a temporary loss of science data and a delay in the experiment schedule. The affected activities will need to be rescheduled, and a new OSTP will be generated to reflect the updated plan. Long-term impacts are expected to be minimal, but further analysis is required to confirm.', 'opsProductRef': 'Refer to procedure COL-PRO-001, flight note FN-002, and ICD document ICDDOC-003 for additional information on MARES payload operations and troubleshooting.', 'realTimeActions': 'YES', 'children': [], 'class': 'C', 'eventGMT': '207/14:20:00', 'analysis': 'Initial assessment suggests that the anomaly may be related to a hardware issue with the TWT amplifier or a software configuration problem. Further analysis of the BITE data and HRCS logs is required to determine the root cause. If the issue is hardware-related, a replacement of the faulty component may be necessary. To prevent similar anomalies in the future, it is recommended to review the ICD documentation and update the PCA as needed.', 'reportId': '28.json', 'forwardStatus': 'NEW', 'criticality': 'CRITICAL', 'creationDate': '2022-07-25T14:30:00Z', 'title': 'MARES Payload Anomaly: Unexpected HRCS Disconnection during Experiment Execution with MAL and BITE Indications', 'environment': 'The MARES payload was in operational mode, with the HRCS configured for high-gain transmission. The experiment was being controlled from the POCC, and all systems were nominal before the anomaly occurred. The crew was performing routine maintenance tasks in the nearby area but did not report any issues or observations related to the event.', 'realTimeResponse': 'The POCC team sent an RTC command to restart the HRCS system, and the crew was instructed to stand by for further instructions. The experiment was paused, and all non-essential systems were shut down as a precautionary measure.', 'description': 'On July 25, 2022, at 14:20 UTC, during the execution of a MARES experiment, an unexpected disconnection of the HRCS occurred, triggering a MAL indication. BITE checks were performed immediately after the event, and initial results suggest a possible issue with the TWT amplifier. The POCC team was notified, and an RTC command was sent to restart the system. Further analysis is required to determine the root cause of the anomaly, which may be related to the recent PIA activities or AIT testing.', 'realTimeAssessment': 'The initial assessment in real-time suggested a possible communication issue between the MARES payload and the HRCS system. The MAL indication triggered an immediate response from the POCC team, who quickly notified the APT and initiated troubleshooting procedures.', 'subsystem': 'MARES'}
Content:
{'NodeEmbedding': None, 'eventStart': '2020-04-15T13:45:00+00:00', 'eventEnd': '2020-04-15T14:10:30+00:00', 'eventClass': 'anomaly', 'reportedDuration': 'PT1H15M25S', 'reportedStart': '2020-04-15T13:45:05+00:00', 'eventStartTrigger': 'EPDS_O2LeakDetectThresh_0.5', 'eventId': '6.json', 'eventEndTrigger': 'EPDS_O2LeakDetectThresh_1.0', 'eventCode': '52010A1', 'subsystem': 'EPDS', 'eventName': 'O2 Leak Detection in EPDS', 'notes': 'Airlock depressurization detected; EPDS oxygen leak detected and reported. Crew safely evacuated to safety.', 'eventReference': 'Columbus Anomaly Report 2020041501'}
Content:
{'NodeEmbedding': None, 'eventStart': '2020-03-12T10:30:00+02:00', 'eventEnd': '2020-03-12T15:30:00+02:00', 'eventClass': 'anomaly', 'reportedDuration': 'P3DT6H', 'reportedStart': '2020-03-13T10:45:00+02:00', 'eventStartTrigger': 'SOLAR_ARRAY_PANEL_COVER_STATE', 'eventId': '2.json', 'eventEndTrigger': 'SOLAR_ARRAY_PANEL_COVER_STATE', 'eventCode': '42100', 'subsystem': 'EPDS', 'eventName': 'Solar Array Panel Cover Misalignment Anomaly', 'notes': 'The EPDS system detected a misalignment of the solar array panel covers. The anomaly occurred during the morning sunlight operation, and the EPDS system alerted the crew. The cover was manually repositioned by the ECLSS crew member.', 'eventReference': 'COL-20-0013-01'}
Content:
{'NodeEmbedding': None, 'eventStart': '2022-07-25T14:30:00+00:00', 'eventEnd': '2022-07-25T15:45:00+00:00', 'eventClass': 'anomaly', 'reportedDuration': 'PT1H30M', 'reportedStart': '2022-07-25T14:31:00+00:00', 'eventStartTrigger': 'ECLSS_PressureThreshold', 'eventId': '8.json', 'eventEndTrigger': 'ECLSS_PressureReset', 'eventCode': 34567, 'subsystem': 'ECLSS', 'eventName': 'Columbus EPS Fluid Management System Overpressure Event', 'notes': 'The event occurred during a routine maintenance activity when an unexpected overpressure in the fluid management system was detected. The crew responded quickly and reset the pressure, preventing any damage to the subsystem.', 'eventReference': 'Anomaly Report 001 - ECLSS Fluid Management System Overpressure Event'}
In [ ]:
Copied!
for result_item in response["retriever_result"]:
print("Content: \n", result_item.content)
print("\nScore: ", result_item.metadata["score"], "\n\n")
for result_item in response["retriever_result"]:
print("Content: \n", result_item.content)
print("\nScore: ", result_item.metadata["score"], "\n\n")
In [11]:
Copied!
response["retriever_result"]
response["retriever_result"]
Out[11]:
[RetrieverResultItem(content="{'NodeEmbedding': None, 'recommendedSolution': 'Perform a detailed analysis of the HRCS system and the TWT amplifier to determine the root cause of the anomaly. Update the ODF to reflect the new configuration, and schedule a CART session to discuss the findings and recommend further actions. Consider performing an AIT to verify the functionality of the EVSU and the PDU.', 'eventDate': '2022-07-25T14:20:00Z', 'duplicates': [], 'status': 'OPEN', 'opsImpact': 'The anomaly impacted the current science operation, and the activity was aborted. The crew will need to reschedule the experiment for a later time. The anomaly did not affect the safety of the crew or the ISS, but it may have an impact on the scientific objectives of the mission.', 'opsProductRef': 'Refer to the MARES payload operations manual, the HRCS system documentation, and the POCC procedures for further information.', 'realTimeActions': 'YES', 'children': [], 'class': 'C', 'eventGMT': '207/14:20:00', 'analysis': 'The preliminary analysis suggests that the anomaly may be related to a software issue or a hardware failure in the HRCS system. Further investigation is required to determine the root cause and to develop a plan to prevent similar anomalies from occurring in the future. The APT will review the findings and provide recommendations for future operations.', 'reportId': '3.json', 'forwardStatus': 'NEW', 'criticality': 'CRITICAL', 'creationDate': '2022-07-25T14:30:00Z', 'title': 'Anomaly in MARES Payload Communication via HRCS and Impact on COU', 'environment': 'The MARES payload was in operational mode, and the HRCS system was configured for high-gain communication. The crew was performing routine maintenance tasks, and the CBCS cameras were monitoring the activity. The LTL was in nominal operation, and the ATC system was maintaining the desired temperature range.', 'realTimeResponse': 'The POCC team immediately responded to the anomaly by notifying the crew and initiating an investigation. The crew was instructed to stand by while the issue was being resolved, and the science operation was put on hold. The CBCS cameras were used to monitor the activity, and the LTL was checked to ensure nominal operation.', 'description': 'On July 25, 2022, at 14:20 UTC, an unexpected loss of signal was observed in the MARES payload communication via the HRCS system. The BITE checks were performed, and the results indicated a potential issue with the TWT amplifier. The event occurred during a routine science operation, and the crew was in the process of configuring the PUL for the next experiment. The MAL was triggered, and the POCC team was notified. Further analysis is required to determine the root cause of the anomaly, which may be related to the ICD specifications or the VHF communication protocol.', 'realTimeAssessment': 'The initial assessment indicated a potential communication issue, and the crew was notified to stand by while the POCC team investigated the anomaly. The real-time data indicated a loss of signal, and the MAL was triggered to alert the crew and the ground team.', 'subsystem': 'MARES'}", metadata={'score': 0.4786575734615326, 'nodeLabels': ['AnomalyReport', 'Searchable'], 'id': '4:f7e64eaf-c656-4f43-99c8-a3fe461f44d8:208'}),
RetrieverResultItem(content='{\'NodeEmbedding\': None, \'recommendedSolution\': "Perform a detailed analysis of the BITE data and HRCS logs to identify the cause of the disconnection. If necessary, update the OSTP to include additional troubleshooting steps or schedule a CART session for further investigation. Consider performing an ACO procedure to verify the system\'s functionality before resuming experiment operations.", \'eventDate\': \'2022-07-25T14:20:00Z\', \'duplicates\': [], \'status\': \'OPEN\', \'opsImpact\': \'The anomaly resulted in a temporary loss of science data and a delay in the experiment schedule. The affected activities will need to be rescheduled, and a new OSTP will be generated to reflect the updated plan. Long-term impacts are expected to be minimal, but further analysis is required to confirm.\', \'opsProductRef\': \'Refer to procedure COL-PRO-001, flight note FN-002, and ICD document ICDDOC-003 for additional information on MARES payload operations and troubleshooting.\', \'realTimeActions\': \'YES\', \'children\': [], \'class\': \'C\', \'eventGMT\': \'207/14:20:00\', \'analysis\': \'Initial assessment suggests that the anomaly may be related to a hardware issue with the TWT amplifier or a software configuration problem. Further analysis of the BITE data and HRCS logs is required to determine the root cause. If the issue is hardware-related, a replacement of the faulty component may be necessary. To prevent similar anomalies in the future, it is recommended to review the ICD documentation and update the PCA as needed.\', \'reportId\': \'28.json\', \'forwardStatus\': \'NEW\', \'criticality\': \'CRITICAL\', \'creationDate\': \'2022-07-25T14:30:00Z\', \'title\': \'MARES Payload Anomaly: Unexpected HRCS Disconnection during Experiment Execution with MAL and BITE Indications\', \'environment\': \'The MARES payload was in operational mode, with the HRCS configured for high-gain transmission. The experiment was being controlled from the POCC, and all systems were nominal before the anomaly occurred. The crew was performing routine maintenance tasks in the nearby area but did not report any issues or observations related to the event.\', \'realTimeResponse\': \'The POCC team sent an RTC command to restart the HRCS system, and the crew was instructed to stand by for further instructions. The experiment was paused, and all non-essential systems were shut down as a precautionary measure.\', \'description\': \'On July 25, 2022, at 14:20 UTC, during the execution of a MARES experiment, an unexpected disconnection of the HRCS occurred, triggering a MAL indication. BITE checks were performed immediately after the event, and initial results suggest a possible issue with the TWT amplifier. The POCC team was notified, and an RTC command was sent to restart the system. Further analysis is required to determine the root cause of the anomaly, which may be related to the recent PIA activities or AIT testing.\', \'realTimeAssessment\': \'The initial assessment in real-time suggested a possible communication issue between the MARES payload and the HRCS system. The MAL indication triggered an immediate response from the POCC team, who quickly notified the APT and initiated troubleshooting procedures.\', \'subsystem\': \'MARES\'}', metadata={'score': 0.4658321142196655, 'nodeLabels': ['AnomalyReport', 'Searchable'], 'id': '4:f7e64eaf-c656-4f43-99c8-a3fe461f44d8:206'}),
RetrieverResultItem(content="{'NodeEmbedding': None, 'eventStart': '2020-04-15T13:45:00+00:00', 'eventEnd': '2020-04-15T14:10:30+00:00', 'eventClass': 'anomaly', 'reportedDuration': 'PT1H15M25S', 'reportedStart': '2020-04-15T13:45:05+00:00', 'eventStartTrigger': 'EPDS_O2LeakDetectThresh_0.5', 'eventId': '6.json', 'eventEndTrigger': 'EPDS_O2LeakDetectThresh_1.0', 'eventCode': '52010A1', 'subsystem': 'EPDS', 'eventName': 'O2 Leak Detection in EPDS', 'notes': 'Airlock depressurization detected; EPDS oxygen leak detected and reported. Crew safely evacuated to safety.', 'eventReference': 'Columbus Anomaly Report 2020041501'}", metadata={'score': 0.46177491545677185, 'nodeLabels': ['Event', 'Searchable'], 'id': '4:f7e64eaf-c656-4f43-99c8-a3fe461f44d8:241'}),
RetrieverResultItem(content="{'NodeEmbedding': None, 'eventStart': '2020-03-12T10:30:00+02:00', 'eventEnd': '2020-03-12T15:30:00+02:00', 'eventClass': 'anomaly', 'reportedDuration': 'P3DT6H', 'reportedStart': '2020-03-13T10:45:00+02:00', 'eventStartTrigger': 'SOLAR_ARRAY_PANEL_COVER_STATE', 'eventId': '2.json', 'eventEndTrigger': 'SOLAR_ARRAY_PANEL_COVER_STATE', 'eventCode': '42100', 'subsystem': 'EPDS', 'eventName': 'Solar Array Panel Cover Misalignment Anomaly', 'notes': 'The EPDS system detected a misalignment of the solar array panel covers. The anomaly occurred during the morning sunlight operation, and the EPDS system alerted the crew. The cover was manually repositioned by the ECLSS crew member.', 'eventReference': 'COL-20-0013-01'}", metadata={'score': 0.45981842279434204, 'nodeLabels': ['Event', 'Searchable'], 'id': '4:f7e64eaf-c656-4f43-99c8-a3fe461f44d8:227'}),
RetrieverResultItem(content="{'NodeEmbedding': None, 'eventStart': '2022-07-25T14:30:00+00:00', 'eventEnd': '2022-07-25T15:45:00+00:00', 'eventClass': 'anomaly', 'reportedDuration': 'PT1H30M', 'reportedStart': '2022-07-25T14:31:00+00:00', 'eventStartTrigger': 'ECLSS_PressureThreshold', 'eventId': '8.json', 'eventEndTrigger': 'ECLSS_PressureReset', 'eventCode': 34567, 'subsystem': 'ECLSS', 'eventName': 'Columbus EPS Fluid Management System Overpressure Event', 'notes': 'The event occurred during a routine maintenance activity when an unexpected overpressure in the fluid management system was detected. The crew responded quickly and reset the pressure, preventing any damage to the subsystem.', 'eventReference': 'Anomaly Report 001 - ECLSS Fluid Management System Overpressure Event'}", metadata={'score': 0.45928755402565, 'nodeLabels': ['Event', 'Searchable'], 'id': '4:f7e64eaf-c656-4f43-99c8-a3fe461f44d8:243'})]
In [10]:
Copied!
response["query_vector"]
response["query_vector"]
Out[10]:
[-0.05699452757835388, -0.026553941890597343, -0.010509852319955826, 0.10938193649053574, 0.05123076215386391, -0.04177340865135193, -0.01955634169280529, 0.04247733950614929, 0.03609944134950638, -0.009581546299159527, 0.02750636637210846, 0.0068547725677490234, 0.03249093145132065, 0.03029751405119896, -0.08973249793052673, -0.020106591284275055, -0.03255757316946983, -0.04169187322258949, 0.003710542107000947, 0.0031211492605507374, 0.005607608240097761, 0.05011194199323654, -0.03177341818809509, 0.015707049518823624, -0.05236757546663284, 0.034263186156749725, -0.001883440650999546, -0.006309905555099249, -0.0008549132035113871, -0.08917561918497086, -0.02378951944410801, 0.10555881261825562, 0.017511004582047462, 0.02208738774061203, 0.061059627681970596, 0.0032822799403220415, 0.08168843388557434, 0.0075717284344136715, 0.010575463995337486, -0.02302924543619156, 0.05564982444047928, -0.03690291568636894, 0.09293652325868607, 0.026057299226522446, -0.08915987610816956, -0.002847742522135377, -0.09633912146091461, -0.020395295694470406, -0.0601869635283947, 0.010106559842824936, -0.02991008758544922, -0.027464058250188828, 0.01430664025247097, 0.07187092304229736, 0.02312544919550419, -0.04449133574962616, -0.08160290867090225, -0.05375523492693901, -0.0016350189689546824, -0.014084815979003906, 0.08334220200777054, 0.022211331874132156, -0.07172311842441559, 0.006175575777888298, 0.14067302644252777, 0.08181002736091614, 0.0028409212827682495, -0.004145258571952581, 0.037119060754776, 0.014724545180797577, -0.018668079748749733, 0.018864590674638748, -0.11387112736701965, 0.012703781016170979, 0.06423822790384293, -0.012909626588225365, -0.01215813122689724, -0.009522330947220325, 0.03330589458346367, -0.08113481104373932, -0.030608564615249634, 0.06578461825847626, 0.058400437235832214, 0.04302108660340309, 0.09513816237449646, -0.03763458877801895, 0.019603217020630836, 0.03324262797832489, -0.016043646261096, 0.03213462606072426, -0.008768357336521149, -0.06846059858798981, -0.016256380826234818, 0.01860455609858036, 0.04893120005726814, 0.08429829776287079, 0.010557512752711773, -0.04921770095825195, 0.17145267128944397, 0.05700468644499779, 0.0773303359746933, 0.026862291619181633, 0.02233581244945526, 0.05827607214450836, -0.020655177533626556, -0.07011745870113373, -0.03666079044342041, 0.009461508132517338, -0.030314186587929726, -0.020428506657481194, 0.00785921886563301, 0.018297793343663216, -0.01722072809934616, -0.09122268855571747, 0.03388407081365585, -0.06627649068832397, -0.0052100894972682, 0.07319682091474533, -0.0696304515004158, 0.011534522287547588, 0.029715051874518394, 0.038284655660390854, 0.02447396330535412, 0.019076261669397354, 0.006274618674069643, 0.06443122029304504, -0.15031781792640686, -7.490567386914338e-33, 0.05968862399458885, 0.03875355422496796, -0.03805408254265785, 0.03423516824841499, 0.002578268526121974, 0.06382893770933151, -0.11120495200157166, -0.009416635148227215, 0.0662422701716423, 0.08604467660188675, -0.02276204712688923, 0.07421533018350601, 0.08415061235427856, -0.07112185657024384, 0.01516954880207777, 0.021347982808947563, 0.009510457515716553, 0.1244988813996315, -0.054629016667604446, -0.01267153024673462, 0.026423344388604164, 0.02833121083676815, 0.030072379857301712, -0.0110626220703125, 0.06355451792478561, 0.041549257934093475, 0.0020992865320295095, -0.008583774790167809, -0.0559709407389164, 0.016944538801908493, 0.0402599461376667, 0.04246250540018082, -0.026406971737742424, 0.02779741771519184, 0.015734408050775528, 0.02841627225279808, -0.0019566079135984182, -0.03226639702916145, 0.02696588821709156, -0.0407177172601223, -0.00682555278763175, -0.0174466073513031, -0.08482646942138672, -0.031980108469724655, 0.0632711723446846, 0.009324081242084503, 0.01826304942369461, -0.02757801115512848, -0.005114011000841856, -0.08590894192457199, -0.04072142764925957, 0.02232503518462181, 0.043365489691495895, -0.02296474762260914, 0.006903075147420168, -0.0017416158225387335, -0.031214436516165733, -0.08036861568689346, -0.018266502767801285, 0.07132183760404587, 0.11781571060419083, 0.044478513300418854, -0.03786053508520126, -0.03187885507941246, -0.004251886624842882, 0.010672167874872684, -0.0246073417365551, 0.004335938952863216, 0.01790873147547245, 0.0627666562795639, -0.016781870275735855, 0.020612366497516632, -0.025146638974547386, 0.02064690552651882, -0.04433086887001991, -0.026833796873688698, 0.01315554790198803, 0.004030888434499502, -0.0394199974834919, 0.019124798476696014, -0.06373999267816544, -0.03742149844765663, 0.0989593043923378, 0.02329237572848797, -0.1329706460237503, -0.01916942372918129, -0.01334039680659771, 0.04407645761966705, -0.05044546350836754, 0.019303712993860245, -0.005593255162239075, 0.014741026796400547, -0.02457820065319538, 0.012888317927718163, -0.03853542357683182, 4.6734628490740784e-33, -0.09018774330615997, 0.05289441719651222, -0.0758250430226326, -0.09602523595094681, -0.030779000371694565, -0.039542097598314285, -0.04725482687354088, 0.051305074244737625, 0.005927345249801874, 0.01779620721936226, -0.042900461703538895, -0.013169142417609692, -0.027213528752326965, -0.0864739641547203, 0.002930966904386878, 0.010233174078166485, 0.017262598499655724, -0.030072592198848724, -0.019235804677009583, 0.047223594039678574, 0.04260176047682762, 0.024998990818858147, -0.06635817885398865, -0.03617100790143013, 0.027650831267237663, 0.07796789705753326, 0.012259312905371189, -0.04441927373409271, -0.03829703852534294, 0.030499720945954323, -0.007665407843887806, -0.020295018330216408, -0.015039227902889252, 0.014720743522047997, -0.0035449108108878136, 0.00227334420196712, 0.02597445622086525, -0.0430072657763958, 0.02461337298154831, -0.055529385805130005, -0.018093550577759743, 0.1290290802717209, 0.03488342463970184, 0.058808404952287674, 0.023234257474541664, 0.029601730406284332, 0.037974607199430466, 0.06237327307462692, -0.060283057391643524, -0.05335422605276108, -0.02762073464691639, 0.03643975779414177, 0.0051181865856051445, 0.008912207558751106, -0.07168025523424149, 0.10235646367073059, -0.047745008021593094, -0.04621070250868797, -0.029989533126354218, 0.08576200157403946, -0.001718497253023088, 0.0341557040810585, -0.07460802793502808, -0.0002914398501161486, 0.05879291146993637, -0.04651521518826485, -0.06736146658658981, -0.10621997714042664, -0.010178104974329472, -0.0509745255112648, 0.037421684712171555, -0.0705740824341774, -0.170588418841362, -0.05123342201113701, 0.02741323597729206, -0.01865970529615879, -0.030857417732477188, -0.06226227432489395, -0.068380206823349, -0.010945812799036503, -0.006387508939951658, -0.01882181316614151, 0.07502596825361252, -0.004229729529470205, 0.031078901141881943, 0.059384267777204514, 0.03791075944900513, 0.023205261677503586, 0.03491218015551567, -0.00687440624460578, -0.019733240827918053, -0.012148221023380756, -0.14122866094112396, 0.03816628083586693, 0.04006817936897278, -1.8889990016646152e-08, -0.05298342555761337, -0.033915385603904724, -0.009571630507707596, -0.03773980587720871, 0.08379103988409042, -0.027752581983804703, -0.006068169604986906, 0.07909243553876877, 0.0023602161090821028, 0.037038709968328476, -0.01467082928866148, -0.06108340620994568, -0.06998063623905182, -0.0961645320057869, 0.08608949184417725, -0.0443960577249527, -0.004281603265553713, 0.05578767508268356, -0.12383734434843063, 0.0021476855035871267, 0.011305367574095726, 0.05655568465590477, 0.003855461487546563, -0.0724494606256485, -0.031289760023355484, -0.03850150853395462, 0.0718713253736496, 0.04853176698088646, 0.018417198210954666, -0.0007775378180667758, 0.0014007086865603924, 0.05819784849882126, 0.06215476989746094, 0.004839818459004164, -0.07395843416452408, 0.11433257907629013, 0.006600302644073963, 0.0074401176534593105, 0.015527433715760708, -0.05859026312828064, -0.004613311029970646, -0.0004268346237950027, -0.0041685267351567745, 0.15443678200244904, -0.026776045560836792, -0.011253179982304573, -0.10392399877309799, -0.057749610394239426, 0.020955346524715424, -0.08249542117118835, -0.013131502084434032, -0.021302491426467896, 0.0211943332105875, 0.10395652800798416, -0.0049699158407747746, 0.06603720039129257, 0.010576047003269196, -0.08249277621507645, 0.01187042985111475, -0.01998129114508629, 0.08047442138195038, 0.015829434618353844, -0.01947944425046444, 0.006252591498196125]
In [30]:
Copied!
import pprint
for res in answer:
pprint.pp(res.matchedContent+"\n")
#pprint.pp(answer)
import pprint
for res in answer:
pprint.pp(res.matchedContent+"\n")
#pprint.pp(answer)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[30], line 2 1 import pprint ----> 2 for res in answer: 3 pprint.pp(res.matchedContent+"\n") NameError: name 'answer' is not defined