Skip to main content
All Python modules · Import and compatibility guidance

PostgreSQL configuration

Public API and bounds

The shared boundary permits at most 1,000 documents, 50 million source characters, and 10,000 generated chunks per ingestion request. Documents may contain up to 10 million characters, individual chunks up to 1 million, queries up to 16,384, and embeddings up to 65,536 dimensions. Metadata and filters allow 64 fields, with up to 100 scalar values in one membership filter. Empty text, duplicate identities, nested metadata, boolean vector values, and non-finite numbers fail before model or datastore I/O.

Exports

Chunker

Split one document into ordered text passages.

Chunker.split

Return non-empty chunks in source order.

Embedder

Turn text into vectors without coupling RAG to a model provider.

Embedder.embed

Return one finite vector for every supplied text.

FilterValue

FixedSizeChunker

Split text on nearby whitespace with deterministic overlap.

FixedSizeChunker.split

Return stable non-empty passages without dropping source text.

MemoryBackend

Store a bounded corpus in process behind the standard backend contract.

MemoryBackend.start

Activate the backend without allocating external resources.

MemoryBackend.close

Deactivate the backend while retaining its development corpus.

MemoryBackend.replace

Replace complete documents without exceeding configured capacity.

MemoryBackend.delete

Delete matching document chunks inside one namespace.

MemoryBackend.fetch

Return exact chunks in caller order and omit missing identities.
Filter, score, sort, and limit the development corpus in memory.

PostgresBackend

Persist chunks in PostgreSQL with full-text and array-vector ranking.

PostgresBackend.start

Open an owned pool and ensure the isolated RAG schema is usable.

PostgresBackend.close

Close only a pool created by this backend.

PostgresBackend.replace

Replace complete documents atomically so obsolete chunks cannot survive.

PostgresBackend.delete

Delete complete documents inside one namespace.

PostgresBackend.fetch

Fetch exact chunks in caller order with ordering performed by PostgreSQL.
Filter, rank, order, and limit one query entirely in PostgreSQL.

RAGBackend

Storage adapter required by the provider-neutral RAG service.

RAGBackend.start

Open backend resources and validate required indexes.

RAGBackend.close

Release only resources owned by this backend.

RAGBackend.replace

Atomically replace complete documents and remove obsolete chunks.

RAGBackend.delete

Delete documents only inside the supplied namespace.

RAGBackend.fetch

Fetch exact chunks without performing relevance ranking.
Apply filtering, ranking, ordering, and limiting in the backend.

RAGChunk

One independently retrievable, namespace-scoped document passage.
Fields (— means no declared default):

RAGDocument

One source document supplied to the chunking and indexing pipeline.
Fields (— means no declared default):

RAGExtension

Create lifecycle-owned RAG services without choosing a storage provider.

RAGExtension.start

Initialize application-scoped resources after dependencies start.

RAGExtension.stop

Release application-scoped resources before dependencies stop.

RAGExtension.create_context

Adapt the managed invocation base to an extension-specific context.

RAGExtension.context

Return the task-local extension context for the active invocation.

RAGExtension.service

Wrap any compatible backend in the shared ingestion and retrieval API.

RAGExtension.memory

Create a bounded in-memory service for development and unit tests.

RAGExtension.postgres

Create a PostgreSQL-backed lexical, semantic, or hybrid service.

RAGHit

One ranked passage returned from a RAG backend.
Fields (— means no declared default):

RAGQuery

A bounded retrieval request understood by every backend.
Fields (— means no declared default):

RAGService

Own one backend and expose the same RAG API to Tools and Tasks.

RAGService.backend

Expose the configured adapter for provider-specific administration.

RAGService.start

Open the backend once under application lifecycle ownership.

RAGService.close

Close the backend once and make later calls fail closed.

RAGService.aenter

Allow direct use as a Harnest lifecycle resource.

RAGService.aexit

Release the backend when its lifecycle resource exits.

RAGService.ingest

Chunk, optionally embed, and atomically audit one ingestion request.

RAGService.delete

Delete namespaced documents through the audited mutation boundary.

RAGService.fetch

Fetch exact namespaced chunks in backend-defined source order.
Embed when required and delegate bounded ranking to the backend.

Scalar

SearchMode

Choose lexical, vector, or rank-fused retrieval.

extension

Create lifecycle-owned RAG services without choosing a storage provider.

extension.start

Initialize application-scoped resources after dependencies start.

extension.stop

Release application-scoped resources before dependencies stop.

extension.create_context

Adapt the managed invocation base to an extension-specific context.

extension.context

Return the task-local extension context for the active invocation.

extension.service

Wrap any compatible backend in the shared ingestion and retrieval API.

extension.memory

Create a bounded in-memory service for development and unit tests.

extension.postgres

Create a PostgreSQL-backed lexical, semantic, or hybrid service.

rag

Create lifecycle-owned RAG services without choosing a storage provider.

rag.start

Initialize application-scoped resources after dependencies start.

rag.stop

Release application-scoped resources before dependencies stop.

rag.create_context

Adapt the managed invocation base to an extension-specific context.

rag.context

Return the task-local extension context for the active invocation.

rag.service

Wrap any compatible backend in the shared ingestion and retrieval API.

rag.memory

Create a bounded in-memory service for development and unit tests.

rag.postgres

Create a PostgreSQL-backed lexical, semantic, or hybrid service.