API reference

Subpackages

Submodules

insightvault.constants module

Module contents

class insightvault.Document(*, id: str = <factory>, title: str, content: str, metadata: ~collections.abc.Mapping[str, ~typing.Any] = <factory>, embedding: ~collections.abc.Sequence[float] | None = None, created_at: ~datetime.datetime = <factory>, updated_at: ~datetime.datetime = <factory>)

Bases: BaseModel

Document model

Attributes:

id: str title: str content: str metadata: dict[str, Any] embedding: list[float] | None created_at: datetime updated_at: datetime

content: str
created_at: datetime
embedding: Sequence[float] | None
id: str
metadata: Mapping[str, Any]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

title: str
updated_at: datetime
class insightvault.RAGApp(name: str = 'insightvault.app.rag')

Bases: SearchApp

RAG application for retrieval-augmented generation

This application extends the SearchApp with RAG-specific query functionality. All other methods (add_documents, delete_documents, etc.) are inherited from SearchApp.

async async_clear() None

Async version of clear

async async_query(query: str) list[str]

Async version of query

clear() None

Clears the chat history

async init() None

Initialize the RAG app

query(query: str) list[str]

Query the database for documents similar to the query

This RAG-specific implementation returns Document objects instead of strings.

class insightvault.SearchApp(name: str = 'insightvault.app.search')

Bases: BaseApp

Search application for semantic search

This application is used to query the database and add documents to the database.

Attributes:

db (Database): The database service.

async async_query(query: str) list[str]

Async version of query

async init() None

Initialize the search app

query(query: str) list[str]

Query the database for documents similar to the query.

Returns an alphabetically sorted list of document titles.

class insightvault.SummarizerApp(name: str = 'insightvault.app.summarizer')

Bases: BaseApp

Summarizer application

This application is used to summarize documents.

async async_summarize(text: str) str | None

Async version of summarize

async init() None

Initialize the summarizer app

summarize(text: str) str | None

Summarize a list of documents