Skip to main content

llama-index managed postgresml integration

Project description

LlamaIndex Managed Integration: PostgresML

PostgresML provides an all in one platform for production ready RAG applications.

Setup

First, make sure you have the latest LlamaIndex version installed and a connection string to your PostgresML database.

If you don't already have a connection string, you can get one on postgresml.org.

pip install llama-index-indices-managed-postgresml

Usage

Getting started is easy!

import os

os.environ[
    "PGML_DATABASE_URL"
] = "..."  # Can provide in the environment or constructor later on

from llama_index.core import Document
from llama_index.indices.managed.postgresml import PostgresMLIndex

# Create an index
index = PostgresMLIndex.from_documents(
    "llama-index-test-1", [Document.example()]
)

# Connect to an index
index = PostgresMLIndex("llama-index-test-1")

You can use the index as a retriever

# Create a retriever from an index
retriever = index.as_retriever()

results = retriever.retrieve("What managed index is the best?")
print(results)

You can also use the index as a query engine

# Create an engine from an index
query_engine = index.as_query_engine()

response = retriever.retrieve("What managed index is the best?")
print(response)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file llama_index_indices_managed_postgresml-0.3.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_indices_managed_postgresml-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c39cd7dd6cb18d15238a4654ea5215dcf8f1b822a4465f707ca8cba18c607831
MD5 af46f4b7365f23dfd70ce372efc8db95
BLAKE2b-256 0e18c0462ffec968f7da6294e08cc620b109d96815945c31218c500d7301190a

See more details on using hashes here.

File details

Details for the file llama_index_indices_managed_postgresml-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_indices_managed_postgresml-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84c60d2011e5f38593af91254d27c06374dcacdff0708fc20fcd7cc2a3b2cb38
MD5 dce7d93a55022f18a870921ad96fb036
BLAKE2b-256 178851cec59fdf1508d1fc2d67a6e0987ee33fb1f4c8684ef9932cfef198a67d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page