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

If you're not sure about the file name format, learn more about wheel file names.

File details

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

File metadata

File hashes

Hashes for llama_index_indices_managed_postgresml-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8ad6ec90ca4e972dcd115c038dbddfa8b0f4ae400c521a0e66cb0219f5d4e1e7
MD5 daf5f8ba1e4a9fd46ea25215e1b2319d
BLAKE2b-256 df3f88e63233b7ee9f773894f78161b07d1e205a76310d4b25aa5ca0433cf453

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_indices_managed_postgresml-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d36b1d422db4c150cd69d3ae245a6bead5c75f37274d799a916eddb62c28c55
MD5 e1e9c15f82e22ebe141fe307220a9340
BLAKE2b-256 dae1bd800deaab147210f43f99f1e484c99fd103306ca3e9f957a2e2cf8cec03

See more details on using hashes here.

Supported by

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