Using CAMEL to Do Graph RAG with Mistral Models#

You can also check this cookbook in colab here

This cookbook walks you through the process of performing graph-based Retrieval-Augmented Generation (RAG) using CAMEL, powered by the advanced Mistral models. Specifically, we’ll utilize the Mistral Large 2 model to extract and structure knowledge from a given content source, and store this information in a Neo4j graph database. Subsequently, we can leverage a hybrid approach, combining vector retrieval and knowledge graph retrieval, to query and explore the stored knowledge.

Slide 16_9 - 9.png

Screenshot 2024-07-25 at 21.14.27.png

πŸ“¦ Installation#

First, install the CAMEL package with all its dependencies:

[ ]:
%pip install "camel-ai[all]==0.2.1"

πŸ”§ Setup#

Import the required modules from CAMEL-AI:

[2]:
from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType
from camel.configs import MistralConfig, OllamaConfig
from camel.loaders import UnstructuredIO
from camel.storages import Neo4jGraph
from camel.retrievers import AutoRetriever
from camel.embeddings import MistralEmbedding
from camel.types import StorageType
from camel.agents import ChatAgent, KnowledgeGraphAgent
from camel.messages import BaseMessage

πŸ”‘ Setting Up API Keys#

For secure access to Mistral AI’s services, we’ll prompt for the API key.

[3]:
import os
from getpass import getpass

# Prompt for the API key securely
mistral_api_key = getpass('Enter your API key: ')
os.environ["MISTRAL_API_KEY"] = mistral_api_key
Enter your API key: Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·

πŸ—„οΈ Configuring Neo4j Graph Database#

Set up your Neo4j instance by providing the URL, username, and password, here is the guidance, check your credentials in the downloaded .txt file. Note that you may need to wait up to 60 seconds if the instance has just been set up.

[4]:
# Set Neo4j instance
n4j = Neo4jGraph(
    url="Your_URL",
    username="Your_Username",
    password="Your_Password",
)

🧠 Creating the Model#

Set up Mistral Large 2 model using the CAMEL ModelFactory:

[5]:
# Set up model
mistral_large_2 = ModelFactory.create(
    model_platform=ModelPlatformType.MISTRAL,
    model_type=ModelType.MISTRAL_LARGE,
    model_config_dict=MistralConfig(temperature=0.2).as_dict(),
)
[6]:
# You can also set up model locally by using ollama
mistral_large_2_local = ModelFactory.create(
    model_platform=ModelPlatformType.OLLAMA,
    model_type="mistral-large",
    model_config_dict=OllamaConfig(temperature=0.2).as_dict(),
)
Failed to start Ollama server: [Errno 2] No such file or directory: 'ollama'.

πŸ€– Generate a Knowledge Graph Using CAMEL’s Agent#

Set up instances for knowledge graph agent:

[7]:
# Set instance
uio = UnstructuredIO()
kg_agent = KnowledgeGraphAgent(model=mistral_large_2)

Provide an example text input that the knowledge graph agent will process:

[8]:
# Set example text input
text_example = """
CAMEL has developed a knowledge graph agent can run with Mistral AI's most
advanced model, the Mistral Large 2. This knowledge graph agent is capable
of extracting entities and relationships from given content and create knowledge
graphs automaticlly.
"""

Create an element from the text and use the knowledge graph agent to extract node and relationship information:

[9]:
# Create an element from given text
element_example = uio.create_element_from_text(
    text=text_example, element_id="0"
)
[10]:
# Let Knowledge Graph Agent extract node and relationship information
ans_element = kg_agent.run(element_example, parse_graph_elements=False)
print(ans_element)
Sure, let's extract nodes and relationships from the given content. Here's the content for extraction:

Content:
"CAMEL has developed a knowledge graph agent that can run with Mistral AI's most advanced model, the Mistral Large 2. This knowledge graph agent is capable of extracting entities and relationships from given content and create knowledge graphs automatically."

### Extracted Nodes and Relationships

#### Nodes:

1. **CAMEL**
   - Type: Organization
2. **Knowledge Graph Agent**
   - Type: Software
3. **Mistral AI**
   - Type: Organization
4. **Mistral Large 2**
   - Type: Model
5. **Entities**
   - Type: Concept
6. **Relationships**
   - Type: Concept
7. **Content**
   - Type: Concept
8. **Knowledge Graphs**
   - Type: Concept

#### Relationships:

1. **CAMEL** developed **Knowledge Graph Agent**
   - Type: Developed
2. **Knowledge Graph Agent** can run with **Mistral Large 2**
   - Type: CanRunWith
3. **Mistral Large 2** is developed by **Mistral AI**
   - Type: DevelopedBy
4. **Knowledge Graph Agent** is capable of extracting **Entities**
   - Type: CanExtract
5. **Knowledge Graph Agent** is capable of extracting **Relationships**
   - Type: CanExtract
6. **Knowledge Graph Agent** creates **Knowledge Graphs**
   - Type: Creates
7. **Entities** and **Relationships** are extracted from **Content**
   - Type: ExtractedFrom

### Structured Output

#### Nodes:

```python
Node(id='CAMEL', type='Organization')
Node(id='Knowledge Graph Agent', type='Software')
Node(id='Mistral AI', type='Organization')
Node(id='Mistral Large 2', type='Model')
Node(id='Entities', type='Concept')
Node(id='Relationships', type='Concept')
Node(id='Content', type='Concept')
Node(id='Knowledge Graphs', type='Concept')
```

#### Relationships:

```python
Relationship(subj=Node(id='CAMEL', type='Organization'), obj=Node(id='Knowledge Graph Agent', type='Software'), type='Developed')
Relationship(subj=Node(id='Knowledge Graph Agent', type='Software'), obj=Node(id='Mistral Large 2', type='Model'), type='CanRunWith')
Relationship(subj=Node(id='Mistral Large 2', type='Model'), obj=Node(id='Mistral AI', type='Organization'), type='DevelopedBy')
Relationship(subj=Node(id='Knowledge Graph Agent', type='Software'), obj=Node(id='Entities', type='Concept'), type='CanExtract')
Relationship(subj=Node(id='Knowledge Graph Agent', type='Software'), obj=Node(id='Relationships', type='Concept'), type='CanExtract')
Relationship(subj=Node(id='Knowledge Graph Agent', type='Software'), obj=Node(id='Knowledge Graphs', type='Concept'), type='Creates')
Relationship(subj=Node(id='Entities', type='Concept'), obj=Node(id='Content', type='Concept'), type='ExtractedFrom')
Relationship(subj=Node(id='Relationships', type='Concept'), obj=Node(id='Content', type='Concept'), type='ExtractedFrom')
```

This structured output represents the nodes and relationships extracted from the given content.
[11]:
# Check graph element
graph_elements = kg_agent.run(element_example, parse_graph_elements=True)
print(graph_elements)
nodes=[Node(id='CAMEL', type='Organization', properties={'source': 'agent_created'}), Node(id='knowledge graph agent', type='Software', properties={'source': 'agent_created'}), Node(id='Mistral AI', type='Organization', properties={'source': 'agent_created'}), Node(id='Mistral Large 2', type='Model', properties={'source': 'agent_created'}), Node(id='entities', type='Concept', properties={'source': 'agent_created'}), Node(id='relationships', type='Concept', properties={'source': 'agent_created'}), Node(id='content', type='Concept', properties={'source': 'agent_created'}), Node(id='knowledge graphs', type='Concept', properties={'source': 'agent_created'})] relationships=[Relationship(subj=Node(id='CAMEL', type='Organization', properties={'source': 'agent_created'}), obj=Node(id='knowledge graph agent', type='Software', properties={'source': 'agent_created'}), type='Developed', properties={'source': 'agent_created'}), Relationship(subj=Node(id='knowledge graph agent', type='Software', properties={'source': 'agent_created'}), obj=Node(id='Mistral AI', type='Organization', properties={'source': 'agent_created'}), type='CanRunWith', properties={'source': 'agent_created'}), Relationship(subj=Node(id='Mistral AI', type='Organization', properties={'source': 'agent_created'}), obj=Node(id='Mistral Large 2', type='Model', properties={'source': 'agent_created'}), type='HasModel', properties={'source': 'agent_created'}), Relationship(subj=Node(id='knowledge graph agent', type='Software', properties={'source': 'agent_created'}), obj=Node(id='entities', type='Concept', properties={'source': 'agent_created'}), type='CanExtract', properties={'source': 'agent_created'}), Relationship(subj=Node(id='knowledge graph agent', type='Software', properties={'source': 'agent_created'}), obj=Node(id='relationships', type='Concept', properties={'source': 'agent_created'}), type='CanExtract', properties={'source': 'agent_created'}), Relationship(subj=Node(id='knowledge graph agent', type='Software', properties={'source': 'agent_created'}), obj=Node(id='knowledge graphs', type='Concept', properties={'source': 'agent_created'}), type='Creates', properties={'source': 'agent_created'})] source=<unstructured.documents.elements.Text object at 0x7f5d31a5f5b0>

Add the extracted graph elements to the Neo4j database:

[12]:
# Add the element to neo4j database
n4j.add_graph_elements(graph_elements=[graph_elements])

πŸŽ‰ Now you can go to here to check the knowledge graph built with CAMEL’s Knowledge Graph Agent and Mistral AI’s Mistral Large 2 model!#

πŸ—ƒοΈ Running Graph RAG with CAMEL#

Next we will showcase how to run RAG in a hybrid approach, combining vector retrieval and knowledge graph retrieval, to query and explore the stored knowledge.

Set up a vector retriever with local storage and embedding model from Mistral AI:

[13]:
# Set retriever
camel_retriever = AutoRetriever(
    vector_storage_local_path="local_data/embedding_storage",
    storage_type=StorageType.QDRANT,
    embedding_model=MistralEmbedding(),
)

Provide an example user query:

[14]:
# Set one user query
query="what's the relationship between Mistral Large 2 and Mistral AI? What kind of feature does Mistral Large 2 has?"

Retrieve related content using the vector retriever, here we take Mistral AI’s news in the website as example conetent, you can also set the local file path here:

[16]:
# Get related content by using vector retriever
vector_result = camel_retriever.run_vector_retriever(
    query=query,
    contents="https://mistral.ai/news/mistral-large-2407/",
)

# Show the result from vector search
print(vector_result)
[nltk_data] Downloading package punkt to /root/nltk_data...
[nltk_data]   Unzipping tokenizers/punkt.zip.
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data]     /root/nltk_data...
[nltk_data]   Unzipping taggers/averaged_perceptron_tagger.zip.
{'Original Query': "what's the relationship between Mistral Large 2 and Mistral AI? What kind of feature does Mistral Large 2 has?", 'Retrieved Context': ['Mistral Large 2 is designed for single-node inference with long-context applications in mind – its size of 123 billion parameters allows it to run at large throughput on a single node.\nWe are releasing Mistral Large 2 under the Mistral Research License, that allows usage and modification for research and non-commercial usages. For commercial usage of Mistral Large 2 requiring self-deployment, a Mistral Commercial License must be acquired by contacting us.']}

Parse content from the specified URL and create knowledge graph data:

[17]:
# Parse conetent from mistral website and create knowledge graph data by using
# the Knowledge Graph Agent, store the information into graph database.

elements = uio.parse_file_or_url(
    input_path="https://mistral.ai/news/mistral-large-2407/"
)
chunk_elements = uio.chunk_elements(
    chunk_type="chunk_by_title", elements=elements
)

graph_elements = []
for chunk in chunk_elements:
    graph_element = kg_agent.run(chunk, parse_graph_elements=True)
    n4j.add_graph_elements(graph_elements=[graph_element])
    graph_elements.append(graph_element)

Create an element from the user query:

[18]:
# Create an element from user query
query_element = uio.create_element_from_text(
    text=query, element_id="1"
)

# Let Knowledge Graph Agent extract node and relationship information from the qyery
ans_element = kg_agent.run(query_element, parse_graph_elements=True)

Match entities from the query in the knowledge graph storage content:

[19]:
# Match the enetity got from query in the knowledge graph storage content
kg_result = []
for node in ans_element.nodes:
    n4j_query = f"""
MATCH (n {{id: '{node.id}'}})-[r]->(m)
RETURN 'Node ' + n.id + ' (label: ' + labels(n)[0] + ') has relationship ' + type(r) + ' with Node ' + m.id + ' (label: ' + labels(m)[0] + ')' AS Description
UNION
MATCH (n)<-[r]-(m {{id: '{node.id}'}})
RETURN 'Node ' + m.id + ' (label: ' + labels(m)[0] + ') has relationship ' + type(r) + ' with Node ' + n.id + ' (label: ' + labels(n)[0] + ')' AS Description
"""
    result = n4j.query(query=n4j_query)
    kg_result.extend(result)

kg_result = [item['Description'] for item in kg_result]

# Show the result from knowledge graph database
print(kg_result)
['Node Mistral Large 2 (label: Model) has relationship HASFEATURE with Node 128k context window (label: Feature)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node French (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node German (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Spanish (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Italian (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Portuguese (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Arabic (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Hindi (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Russian (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Chinese (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Japanese (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSLANGUAGE with Node Korean (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSCODINGLANGUAGE with Node Python (label: CodingLanguage)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSCODINGLANGUAGE with Node Java (label: CodingLanguage)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSCODINGLANGUAGE with Node C (label: CodingLanguage)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSCODINGLANGUAGE with Node C++ (label: CodingLanguage)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSCODINGLANGUAGE with Node JavaScript (label: CodingLanguage)', 'Node Mistral Large 2 (label: Model) has relationship SUPPORTSCODINGLANGUAGE with Node Bash (label: CodingLanguage)', 'Node Mistral Large 2 (label: Model) has relationship DESIGNEDFOR with Node single-node inference (label: Concept)', 'Node Mistral Large 2 (label: Model) has relationship DESIGNEDFOR with Node long-context applications (label: Concept)', 'Node Mistral Large 2 (label: Model) has relationship HASSIZE with Node 123 billion parameters (label: Attribute)', 'Node Mistral Large 2 (label: Model) has relationship ALLOWS with Node large throughput (label: Attribute)', 'Node Mistral Large 2 (label: Model) has relationship RELEASEDUNDER with Node Mistral Research License (label: License)', 'Node Mistral Large 2 (label: Model) has relationship REQUIRESFORCOMMERCIALUSAGE with Node Mistral Commercial License (label: License)', 'Node Mistral Large 2 (label: Model) has relationship SETSFRONTIER with Node Performance (label: Concept)', 'Node Mistral Large 2 (label: Model) has relationship SETSFRONTIER with Node Cost of Serving (label: Concept)', 'Node Mistral Large 2 (label: Model) has relationship SETSFRONTIER with Node Evaluation Metrics (label: Concept)', 'Node Mistral Large 2 (label: Model) has relationship SETSNEWPOINT with Node Performance/Cost Pareto Front (label: Concept)', 'Node Mistral Large 2 (label: Model) has relationship BENCHMARKEDTHROUGH with Node evaluation pipeline (label: Process)', 'Node Mistral Large 2 (label: Model) has relationship IMPROVED with Node instruction-following (label: Capability)', 'Node Mistral Large 2 (label: Model) has relationship IMPROVED with Node conversational capabilities (label: Capability)', 'Node Mistral Large 2 (label: Model) has relationship BETTERAT with Node precise instructions (label: Capability)', 'Node Mistral Large 2 (label: Model) has relationship BETTERAT with Node long multi-turn conversations (label: Capability)', 'Node Mistral Large 2 (label: Model) has relationship PERFORMANCEREPORTEDON with Node MT-Bench (label: Benchmark)', 'Node Mistral Large 2 (label: Model) has relationship PERFORMANCEREPORTEDON with Node Wild Bench (label: Benchmark)', 'Node Mistral Large 2 (label: Model) has relationship PERFORMANCEREPORTEDON with Node Arena Hard benchmarks (label: Benchmark)', 'Node Mistral Large 2 (label: Model) has relationship PERFORMANCEREPORTEDON with Node general alignment benchmarks (label: Benchmark)', 'Node Mistral Large 2 (label: Model) has relationship TRAINEDON with Node Multilingual Data (label: Concept)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node French (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node German (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Spanish (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Italian (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Portuguese (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Arabic (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Hindi (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Russian (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Chinese (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Japanese (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Korean (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node English (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship EXCELSIN with Node Dutch (label: Language)', 'Node Mistral Large 2 (label: Model) has relationship HASPERFORMANCERESULTSON with Node MMLU Benchmark (label: Benchmark)', 'Node Mistral Large 2 (label: Model) has relationship COMPAREDTO with Node Mistral Large (label: Model)', 'Node Mistral Large 2 (label: Model) has relationship COMPAREDTO with Node Llama (label: Model)', 'Node Mistral Large 2 (label: Model) has relationship EQUIPPEDWITH with Node Enhanced Function Calling (label: Feature)', 'Node Mistral Large 2 (label: Model) has relationship EQUIPPEDWITH with Node Retrieval Skills (label: Feature)', 'Node Mistral Large 2 (label: Model) has relationship UNDERGONE with Node Training (label: Process)', 'Node Mistral Large 2 (label: Model) has relationship CANEXECUTE with Node Parallel Function Calls (label: Feature)', 'Node Mistral Large 2 (label: Model) has relationship CANEXECUTE with Node Sequential Function Calls (label: Feature)', 'Node Mistral Large 2 (label: Model) has relationship SERVESAS with Node Power Engine (label: Role)', 'Node Mistral Large 2 (label: Product) has relationship EXPOSEDON with Node la Plateforme (label: Platform)', 'Node Mistral Large 2 (label: Product) has relationship ENRICHEDWITH with Node new features (label: Feature)', 'Node Mistral AI (label: Organization) has relationship HASMODEL with Node Mistral Large 2 (label: Model)', 'Node Mistral AI (label: Organization) has relationship PARTNERSWITH with Node Google Cloud Platform (label: Organization)', 'Node Mistral AI (label: Organization) has relationship PROVIDESMODELSON with Node Vertex AI (label: Service)', 'Node Mistral AI (label: Organization) has relationship PROVIDESMODELSON with Node Azure AI Studio (label: Service)', 'Node Mistral AI (label: Organization) has relationship PROVIDESMODELSON with Node Amazon Bedrock (label: Service)', 'Node Mistral AI (label: Organization) has relationship PROVIDESMODELSON with Node IBM watsonx.ai (label: Service)']

Combine results from the vector search and knowledge graph entity search:

[23]:
# combine result from vector seach and knowledge graph entity search
comined_results = str(vector_result) + "\n".join(kg_result)

Set up an assistant agent to answer questions based on the retrieved context:

[24]:
# Set agent
sys_msg = BaseMessage.make_assistant_message(
    role_name="CAMEL Agent",
    content="""You are a helpful assistant to answer question,
        I will give you the Original Query and Retrieved Context,
    answer the Original Query based on the Retrieved Context.""",
)

camel_agent = ChatAgent(system_message=sys_msg,
                        model=mistral_large_2)

# Pass the retrieved infomation to agent
user_prompt=f"""
The Original Query is {query}
The Retrieved Context is {comined_results}
"""

user_msg = BaseMessage.make_user_message(
    role_name="CAMEL User", content=user_prompt
)

# Get response
agent_response = camel_agent.step(user_msg)

print(agent_response.msg.content)
### Relationship Between Mistral Large 2 and Mistral AI

Mistral Large 2 is a model developed by Mistral AI. The relationship between Mistral Large 2 and Mistral AI is that Mistral AI has created and provides the Mistral Large 2 model.

### Features of Mistral Large 2

Mistral Large 2 has several notable features and capabilities:

1. **Size and Performance**:
   - **123 Billion Parameters**: This size allows it to run at large throughput on a single node.
   - **128k Context Window**: This feature enables the model to handle long-context applications effectively.

2. **Language Support**:
   - Mistral Large 2 supports multiple languages, including French, German, Spanish, Italian, Portuguese, Arabic, Hindi, Russian, Chinese, Japanese, and Korean.

3. **Coding Language Support**:
   - The model supports various coding languages such as Python, Java, C, C++, JavaScript, and Bash.

4. **Design and Usage**:
   - **Single-Node Inference**: Designed for single-node inference, making it efficient for specific use cases.
   - **Long-Context Applications**: Optimized for applications requiring long contexts.

5. **Licensing**:
   - **Mistral Research License**: Allows usage and modification for research and non-commercial purposes.
   - **Mistral Commercial License**: Required for commercial usage involving self-deployment.

6. **Capabilities**:
   - **Instruction-Following**: Improved capabilities in following precise instructions.
   - **Conversational Capabilities**: Better at handling long multi-turn conversations.

7. **Benchmarks and Performance**:
   - Performance reported on various benchmarks such as MT-Bench, Wild Bench, Arena Hard benchmarks, and general alignment benchmarks.
   - Sets new frontiers in performance, cost of serving, and evaluation metrics.

8. **Additional Features**:
   - **Enhanced Function Calling**: Equipped with enhanced function calling capabilities.
   - **Retrieval Skills**: Possesses retrieval skills.
   - **Parallel and Sequential Function Calls**: Can execute both parallel and sequential function calls.

9. **Training and Evaluation**:
   - Trained on multilingual data.
   - Benchmarked through an evaluation pipeline.

10. **Platforms and Services**:
    - Exposed on platforms like "la Plateforme."
    - Provided on services such as Vertex AI, Azure AI Studio, Amazon Bedrock, and IBM watsonx.ai.

These features make Mistral Large 2 a powerful and versatile model suitable for a wide range of applications.

🌟 Highlights#

  • Automated Knowledge Extraction: The Knowledge Graph Agent automates the extraction of entities and relationships, making the process efficient and effective.

  • Mistral AI Integration: This cookbook showcases the integration of Mistral AI’s advanced models, particularly the Mistral Large 2, with CAMEL-AI to create a powerful knowledge graph system.

  • Secure and Scalable: Using CAMEL-AI’s robust architecture and Neo4j for graph storage ensures that the solution is both secure and scalable.

By following this cookbook, you can leverage the cutting-edge capabilities of CAMEL AI and Mistral AI to build sophisticated knowledge graphs, facilitating advanced data analysis and retrieval tasks.