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
Release history Release notifications | RSS feed
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
Close
Hashes for llama_index_indices_managed_postgresml-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7482d9c8e79b0272919a269b6cb3ead18c29f6db11f196197147b8f48c95d65 |
|
MD5 | 6fdaa3671d126475bd8a69f1880dbefe |
|
BLAKE2b-256 | bf729919fa9fddf23c74552cf51866e003b53a6e5f1d78e4f3871bb3725231e9 |
Close
Hashes for llama_index_indices_managed_postgresml-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19d674040f7a228b1111547bfda5df88b771ad027094fd7325b867424743eb89 |
|
MD5 | e71163e7c40726e5ebcb0f56c9bfeb9a |
|
BLAKE2b-256 | 368d9f2acea0c14aa4fce7cba1469c4c2b6215e5f68b84c51e896817729f23e2 |