semvec/pypi-packages huggingface dataset:
llama-index-llms-modelscope 0.5.1
llama-index llms modelscope integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration: ModelScope

## Installation

To install the required package, run:

```bash
!pip install llama-index-llms-modelscope
```

## Basic Usage

### Initialize the ModelScopeLLM

To use the ModelScopeLLM model, create an instance by specifying the model name and revision:

```python
import sys
from llama_index.llms.modelscope import ModelScopeLLM

llm = ModelScopeLLM(model_name="qwen/Qwen3-8B", model_revision="master")
```

### Generate Completions

To generate a text completion for a prompt, use the `complete` method:

```python
rsp = llm.complete("Hello, who are you?")
print(rsp)
```

### Using Message Requests

You can chat with the model by using a list of messages. Here’s how to set it up:

```python
from llama_index.core.base.llms.types import MessageRole, ChatMessage

messages = [
    ChatMessage(
        role=MessageRole.SYSTEM, content="You are a helpful assistant."
    ),
    ChatMessage(role=MessageRole.USER, content="How to make cake?"),
]
resp = llm.chat(messages)
print(resp)
```

### LLM Implementation example

https://docs.llamaindex.ai/en/stable/examples/llm/modelscope/
llama-index-readers-mbox 0.5.1
llama-index readers mbox integration
Requires Python: <4.0,>=3.9

# LlamaIndex Readers Integration: Mbox

## Overview

Mbox Reader is a simple reader for mbox (mailbox) files, commonly used for storing email messages. It reads a set of emails saved in the mbox format and extracts them into documents.

### Installation

You can install Mbox Reader via pip:

```bash
pip install llama-index-readers-mbox
```

### Usage

```python
from llama_index.readers.mbox import MboxReader

# Initialize MboxReader
reader = MboxReader()

# Load data from mbox files in the input directory
documents = reader.load_data(input_dir="<Input Directory>")
```

This loader is designed to be used as a way to load data into
[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently
used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.
llama-index-tools-multion 0.5.1
llama-index tools multion integration
Requires Python: <4.0,>=3.9

# MultiOn Tool

```bash
pip install llama-index-tools-multion
```

This tool connects to [MultiOn](https://www.multion.ai/) to enable your agent to easily
connect to the internet through your Chrome Web browser and act on your behalf

You will need to have the MultiOn chrome extension installed and a MultiOn account
to use this integration

## Usage

This tool has more a extensive example usage documented in a Jupyter notebook [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-multion/examples/multion.ipynb).

Here's an example usage of the MultionToolSpec.

```python
from llama_index.tools.multion import MultionToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

multion_tool = MultionToolSpec(api_key="your-multion-key")

agent = FunctionAgent(
    tools=multion_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("Can you read the latest tweets from my followers"))
print(await agent.run("What's the next thing on my google calendar?"))
```

`browse`: The core function that takes natural language instructions to pass to the web browser to execute

This loader is designed to be used as a way to load data as a Tool in a Agent.
llama-index-tools-metaphor 0.4.1
llama-index tools metaphor integration
Requires Python: <4.0,>=3.9

# Metaphor Tool

# ================================================================================

NOTE: Deprecated in favor of Exa Tool.

# ================================================================================

This tool connects to [Metaphor](https://metaphor.systems/) to easily enable
your agent to search and get HTML content from the Internet.

To begin, you need to obtain an API key on the [Metaphor developer dashboard](https://dashboard.metaphor.systems).

## Usage

This tool has more a extensive example usage documented in a Jupyter notebook [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-metaphor/examples/metaphor.ipynb)

Here's an example usage of the MetaphorToolSpec.

```python
from llama_index.tools.metaphor import MetaphorToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

metaphor_tool = MetaphorToolSpec(
    api_key="your-key",
)
agent = FunctionAgent(
    tools=metaphor_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(
    await agent.run(
        "Can you summarize the news published in the last month on superconductors"
    )
)
```

`search`: Search for a list of articles relating to a natural language query
`retrieve_documents`: Retrieve a list of documents returned from `metaphor_search`.
`search_and_retrieve_documents`: Combines search and retrieve_documents to directly return a list of documents related to a search
`find_similar`: Find similar documents to a given URL.
`current_date`: Utility for the Agent to get todays date

This loader is designed to be used as a way to load data as a Tool in a Agent.
llama-index-readers-milvus 0.4.1
llama-index readers milvus integration
Requires Python: <4.0,>=3.9

# LlamaIndex Readers Integration: Milvus

## Overview

Milvus Reader is designed to load data from a Milvus vector store, which provides search functionality based on query vectors. It retrieves documents from the specified Milvus collection using the provided connection parameters.

### Installation

You can install Milvus Reader via pip:

```bash
pip install llama-index-readers-milvus
```

### Usage

```python
from llama_index.readers.milvus import MilvusReader

# Initialize MilvusReader
reader = MilvusReader(
    host="<Milvus Host>",  # Milvus host address (default: "localhost")
    port=19530,  # Milvus port (default: 19530)
    user="",  # Milvus user (default: "")
    password="",  # Milvus password (default: "")
    use_secure=False,  # Use secure connection (default: False)
)

# Load data from Milvus
documents = reader.load_data(
    query_vector=[0.1, 0.2, 0.3],  # Query vector
    collection_name="<Collection Name>",  # Name of the Milvus collection
    limit=10,  # Number of results to return
    search_params=None,  # Search parameters (optional)
)
```

Implementation for Milvus reader can be found [here](https://docs.llamaindex.ai/en/stable/examples/data_connectors/MilvusReaderDemo)

This loader is designed to be used as a way to load data into
[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently
used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.
llama-index-llms-databricks 0.4.1
llama-index llms databricks integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration: Databricks

## Overview

Integrate with Databricks LLMs APIs.

## Installation

```bash
pip install llama-index-llms-databricks
```

## Example

With environmental variables.

```.env
DATABRICKS_TOKEN=your_api_key
DATABRICKS_SERVING_ENDPOINT=https://[your-work-space].cloud.databricks.com/serving-endpoints
```

```python
from llama_index.llms.databricks import Databricks

# Initialize Databricks LLM without explicitly passing the API key and base
llm = Databricks(model="databricks-dbrx-instruct")

# Make a query to the LLM
response = llm.complete("Explain the importance of open source LLMs")

print(response)
```

Without environmental variables

```python
from llama_index.llms.databricks import Databricks

# Set up the Databricks class with the required model, API key and serving endpoint
llm = Databricks(
    model="databricks-dbrx-instruct",
    api_key="your_api_key",
    api_base="https://[your-work-space].cloud.databricks.com/serving-endpoints",
)

# Call the complete method with a query
response = llm.complete("Explain the importance of open source LLMs")

print(response)
```
llama-index-readers-psychic 0.4.1
llama-index readers psychic integration
Requires Python: <4.0,>=3.9

# LlamaIndex Readers Integration: Psychic

## Overview

The Psychic Reader facilitates the extraction of data from the Psychic platform, enabling seamless access to synced data from various SaaS applications through a single universal API.
Psychic is a platform designed to synchronize data from multiple SaaS applications via a universal API. This reader module connects to a Psychic instance and retrieves data, requiring authentication via a secret key.

For more detailed information about Psychic, visit [docs.psychic.dev](https://docs.psychic.dev).

### Installation

You can install Psychic Reader via pip:

```bash
pip install llama-index-readers-psychic
```

### Usage

```python
from llama_index.readers.psychic import PsychicReader

# Initialize PsychicReader
reader = PsychicReader(psychic_key="<Psychic Secret Key>")

# Load data from Psychic
documents = reader.load_data(
    connector_id="<Connector ID>", account_id="<Account ID>"
)
```

This loader is designed to be used as a way to load data into
[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently
used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.
llama-index-graph-stores-ApertureDB 0.2.1
llama-index graph stores ApertureDB integration
Requires Python: <4.0,>=3.9

# LlamaIndex Graph Stores Integration: ApertureDB

[ApertureDB](https://www.aperturedata.io/) is a Multimodal Database.
The storage is modelled as a graph.

It can be used off [cloud](https://cloud.aperturedata.io/), [On premise](https://docs.aperturedata.io/Setup/server/Custom#customer-hosted-setup), and it comes with a public [community edition](https://docs.aperturedata.io/Setup/server/Local) which can run on a laptop too.

This integration implements the PropertyGraph interface of llama_index, which can be used to Store and query a Knowledge Graph using ApertureDB as the store.

Assuming a working and accessible instance of ApertureDB the following examples would work for adding nodes to your graph, and retrieving them.

```python
from llama_index.core.graph_stores.types import Relation, EntityNode
from llama_index.graph_stores.ApertureDB import ApertureDBGraphStore

entities = [
    EntityNode(label="PERSON", name="James"),
    EntityNode(label="DISH", name="Butter Chicken"),
    EntityNode(label="DISH", name="Scrambled Eggs"),
    EntityNode(label="INGREDIENT", name="Butter"),
    EntityNode(label="INGREDIENT", name="Chicken"),
    EntityNode(label="INGREDIENT", name="Eggs"),
    EntityNode(label="INGREDIENT", name="Salt"),
]

relations = [
    Relation(
        label="EATS",
        source_id=entities[0].id,
        target_id=entities[1].id,
    ),
    Relation(
        label="EATS",
        source_id=entities[0].id,
        target_id=entities[2].id,
    ),
    Relation(
        label="CONTAINS",
        source_id=entities[1].id,
        target_id=entities[3].id,
    ),
    Relation(
        label="HAS",
        source_id=entities[1].id,
        target_id=entities[4].id,
    ),
    Relation(
        label="COMPRISED_OF",
        source_id=entities[2].id,
        target_id=entities[5].id,
    ),
    Relation(
        label="GOT",
        source_id=entities[2].id,
        target_id=entities[6].id,
    ),
]
graph_store = ApertureDBGraphStore()
graph_store.upsert_nodes(entities)
graph_store.upsert_relations(relations)
```

Retrieve nodes:

```python
# get all.
print(pg_store.get())

# get nodes by ID.
kg_nodes = pg_store.get(ids=[entities[0].id])
print(kg_nodes)

# get paths from a node
paths = pg_store.get_rel_map(kg_nodes, depth=2)
import json

print(json.dumps(paths, indent=2, default=str))
```
llama-index-tools-linkup-research 0.4.1
llama-index tools linkup_research integration
Requires Python: <4.0,>=3.9
Keywords: search

# Linkup Research Tool

[Linkup](https://app.linkup.so/) is a robust research API tailored specifically for LLM Agents. It seamlessly integrates with diverse data sources to ensure a superior, relevant research experience.

- you need to obtain an API key on the [Linkup dashboard](https://app.linkup.com/)

### Quick Start:

```bash
pip install llama-index-tools-linkup-research
```

```python
import os
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.linkup_research.base import LinkupToolSpec


# structured_schema=json.dumps(your schema here) # Only if output type is structured
# Initialisation of the tool
linkup_tool = LinkupToolSpec(
    api_key="your Linkup API Key",
    depth="",  # Choose (standard) for a faster result (deep) for a slower but more complete result.
    output_type="",  # Choose (searchResults) for a list of results relative to your query, (sourcedAnswer) for an answer and a list of sources, or (structured) if you want a specific schema.
    # structured_output_schema=structured_schema # Only if output type is structured
)

# Creation of the agent
agent = FunctionAgent(
    tools=linkup_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4o"),
)

# Query for the agent
await agent.run(
    "Can you tell me which women were awarded the Physics Nobel Prize"
)
```

This loader is designed to be used as a way to load data as a Tool in an Agent.
llama-index-readers-smart-pdf-loader 0.4.1
llama-index readers smart_pdf_loader integration
Requires Python: <4.0,>=3.9
Keywords: pdf, pdf layout, pdf table

# Smart PDF Loader

```bash
pip install llama-index-readers-smart-pdf-loader
```

SmartPDFLoader is a super fast PDF reader that understands the layout structure of PDFs such as nested sections, nested lists, paragraphs and tables.
It uses layout information to smartly chunk PDFs into optimal short contexts for LLMs.

## Requirements

Install the llmsherpa library if it is not already present:

```
pip install llmsherpa
```

## Usage

Here's an example usage of the SmartPDFLoader:

```python
from llama_index.readers.smart_pdf_loader import SmartPDFLoader

llmsherpa_api_url = "https://readers.llmsherpa.com/api/document/developer/parseDocument?renderFormat=all"
pdf_url = "https://arxiv.org/pdf/1910.13461.pdf"  # also allowed is a file path e.g. /home/downloads/xyz.pdf
pdf_loader = SmartPDFLoader(llmsherpa_api_url=llmsherpa_api_url)
documents = pdf_loader.load_data(pdf_url)
```

Now you can use the documents with other LlamaIndex components. For example, for retrieval augmented generation, try this:

```python
from llama_index.core import VectorStoreIndex

index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()

response = query_engine.query("list all the tasks that work with bart")
print(response)

response = query_engine.query("what is the bart performance score on squad")
print(response)
```

## More Examples

SmartPDFLoader is based on LayoutPDFReader from [llmsherpa](https://github.com/nlmatics/llmsherpa) library. See the [documentation](<(https://github.com/nlmatics/llmsherpa)>) there to explore other ways to use the library for connecting data from your PDFs with LLMs.

- [Summarize a section using prompts](https://github.com/nlmatics/llmsherpa#summarize-a-section-using-prompts)
- [Analyze a table using prompts](https://github.com/nlmatics/llmsherpa#analyze-a-table-using-prompts)
- [Vector search and RAG](https://github.com/nlmatics/llmsherpa#vector-search-and-retrieval-augmented-generation-with-smart-chunking)
llama-index-storage-chat-store-tablestore 0.2.1
llama-index storage-chat-store tablestore integration
Requires Python: <4.0,>=3.9

# LlamaIndex Chat_Store Integration: Tablestore Chat Store

Using `TablestoreChatStore`, you can store your chat history remotely, without having to worry about manually persisting and loading the chat history.

## Installation

```bash
pip install llama-index-storage-chat-store-tablestore
```

## Usage

```python
from llama_index.storage.chat_store.tablestore import TablestoreChatStore
from llama_index.core.memory import ChatMemoryBuffer

# 1. create tablestore vector store
chat_store = TablestoreChatStore(
    endpoint="<end_point>",
    instance_name="<instance_name>",
    access_key_id="<access_key_id>",
    access_key_secret="<access_key_secret>",
)
# You need to create a table for the first use
chat_store.create_table_if_not_exist()

chat_memory = ChatMemoryBuffer.from_defaults(
    token_limit=3000,
    chat_store=chat_store,
    chat_store_key="user1",
)
```
llama-index-readers-azcognitive-search 0.4.1
llama-index readers azcognitive_search integration
Requires Python: <4.0,>=3.9

# Azure Cognitive Search Loader

```bash
pip install llama-index-readers-azcognitive-search
```

The AzCognitiveSearchReader Loader returns a set of texts corresponding to documents retrieved from specific index of Azure Cognitive Search.
The user initializes the loader with credentials (service name and key) and the index name.

## Usage

Here's an example usage of the AzCognitiveSearchReader.

```python
from llama_index.readers.azcognitive_search import AzCognitiveSearchReader

reader = AzCognitiveSearchReader(
    "<Azure_Cognitive_Search_NAME>",
    "<Azure_Cognitive_Search_KEY>",
    "<Index_name>",
)


query_sample = ""
documents = reader.load_data(
    query="<search_term>",
    content_field="<content_field_name>",
    filter="<azure_search_filter>",
)
```

## Usage in combination with langchain

```python
from llama_index.core import VectorStoreIndex, download_loader
from langchain.chains.conversation.memory import ConversationBufferMemory
from langchain.agents import Tool, AgentExecutor, load_tools, initialize_agent

from llama_index.readers.azcognitive_search import AzCognitiveSearchReader

az_loader = AzCognitiveSearchReader(
    COGNITIVE_SEARCH_SERVICE_NAME, COGNITIVE_SEARCH_KEY, INDEX_NAME
)

documents = az_loader.load_data(query, field_name)

index = VectorStoreIndex.from_documents(
    documents, service_context=service_context
)

tools = [
    Tool(
        name="Azure cognitive search index",
        func=lambda q: index.query(q),
        description=f"Useful when you want answer questions about the text on azure cognitive search.",
    ),
]
memory = ConversationBufferMemory(memory_key="chat_history")
agent_chain = initialize_agent(
    tools, llm, agent="zero-shot-react-description", memory=memory
)

result = agent_chain.run(input="How can I contact with my health insurance?")
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-readers-lilac 0.4.1
llama-index readers lilac integration
Requires Python: <4.0,>=3.9

# Lilac reader

```bash
pip install llama-index-readers-papers

pip install llama-index-readers-lilac
```

[Lilac](https://lilacml.com/) is an open-source product that helps you analyze, enrich, and clean unstructured data with AI.

It can be used to analyze, clean, structure, and label data that can be used in downstream LlamaIndex and LangChain applications.

## Lilac projects

This assumes you've already run Lilac locally, and have a project directory with a dataset. For more details on Lilac projects, see [Lilac Projects](https://lilacml.com/projects/projects.html)

You can use any LlamaIndex loader to load data into Lilac, clean data, and then bring it back into LlamaIndex Documents.

## Usage

### LlamaIndex => Lilac

See [this notebook](https://github.com/lilacai/lilac/blob/main/notebooks/LlamaIndexLoader.ipynb) for getting data into Lilac from LlamaHub.

```python
import lilac as ll

# See: https://llamahub.ai/l/papers-arxiv
from llama_index.readers.papers import ArxivReader

loader = ArxivReader()
documents = loader.load_data(search_query="au:Karpathy")

# Set the project directory for Lilac.
ll.set_project_dir("./data")

# This assumes you already have a lilac project set up.
# If you don't, use ll.init(project_dir='./data')
ll.create_dataset(
    config=ll.DatasetConfig(
        namespace="local",
        name="arxiv-karpathy",
        source=ll.LlamaIndexDocsSource(
            # documents comes from the loader.load_data call in the previous cell.
            documents=documents
        ),
    )
)

# You can start a lilac server with. Once you've cleaned the dataset, you can come back into GPTIndex.
ll.start_server(project_dir="./data")
```

### Lilac => LlamaIndex Documents

```python
from llama_index.core import VectorStoreIndex, download_loader

from llama_index.readers.lilac import LilacReader

loader = LilacReader()
documents = loader.load_data(
    project_dir="~/my_project",
    # The name of your dataset in the project dir.
    dataset="local/arxiv-karpathy",
)

index = VectorStoreIndex.from_documents(documents)

index.query("How are ImageNet labels validated?")
```

This loader is designed to be used as a way to load data into [GPT Index](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently used in a [LangChain](https://github.com/hwchase17/langchain) Agent.
llama-index-storage-chat-store-sqlite 0.2.1
llama-index storage-chat-store sqlite integration
Requires Python: <4.0,>=3.9

# LlamaIndex Chat_Store Integration: SQLite Chat Store

## Installation

`pip install llama-index-storage-chat-store-sqlite`

## Usage

Using `SQLiteChatStore`, you can store your chat history remotely, without having to worry about manually persisting and loading the chat history.

```python
from llama_index.storage.chat_store.sqlite import SQLiteChatStore
from llama_index.core.memory import ChatMemoryBuffer

chat_store = SQLiteChatStore.from_uri(
    uri="sqlite+aiosqlite:///chat_store.db",
)

chat_memory = ChatMemoryBuffer.from_defaults(
    token_limit=3000,
    chat_store=chat_store,
    chat_store_key="user1",
)
```
llama-index-readers-asana 0.4.1
llama-index readers asana integration
Requires Python: <4.0,>=3.9

# Asana Loader

```bash
pip install llama-index-readers-asana
```

This loader loads documents from Asana. The user specifies an API token to initialize the AsanaReader. They then specify a `workspace_id` OR a `project_id` to load in the corresponding Document objects.

## Usage

Here's an example usage of the AsanaReader.

```python
import os

from llama_index.readers.asana import AsanaReader

reader = AsanaReader("<ASANA_TOKEN>")

# Option 1
documents = reader.load_data(workspace_id="<WORKSPACE_ID>")

# Option 2
documents = reader.load_data(project_id="<PROJECT_ID>")
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-readers-stackoverflow 0.4.1
llama-index readers stackoverflow integration
Requires Python: <4.0,>=3.9
Keywords: answers, posts, questions

# StackoverflowReader (In Beta)

Using the Stackoverflow API, this class will read the Stackoverflow Teams API and return a list of questions and answers based on posts.

It also supports caching the results to a local directory, so that you can run the load_data() method multiple times without hitting the API.

## getting a token

Visit: https://stackoverflowteams.com/users/pats/

1. Click Create a new PAT
2. Name the token, and pick the team scope
3. Select an expiration date
4. Click Create

Add this to your env, or to the instantiation of the `StackoverflowReader(pa_token, team_name, cache_dir='./stackoverflow_cache')`

```bash
export STACKOVERFLOW_PAT=your_token
export STACKOVERFLOW_TEAM_NAME=your_team
```

Other features which could be added:

- Add articles
- Add comments
- Add tags
- Add users
- Add votes
- Add badges