Engineering
basic-usage avatar

basic-usage

Essential guide to llmemory for document storage and search: installation, database setup with pgvector, document ingestion, hybrid/semantic retrieval, and building RAG systems with multi-tenant support.

Introduction

The basic-usage skill provides the foundational interface for integrating llmemory into Python applications. Designed for developers and engineers, this skill covers the end-to-end lifecycle of managing document-based knowledge, from initial PostgreSQL schema deployment using the pgvector extension to complex retrieval workflows. It is intended for those building RAG (Retrieval-Augmented Generation) systems, enterprise search engines, or multi-tenant SaaS applications requiring high-performance document isolation.

  • Full document lifecycle management including creation, pagination-supported listing, retrieval, and deletion of documents.

  • Advanced retrieval capabilities such as hybrid search (combining vector embeddings and BM25 full-text), semantic search, and automatic query routing via answerability detection.

  • Multi-tenant data architecture using owner-scoped isolation, ensuring secure separation of document sets for different clients or workspaces.

  • Deep integration with Postgres via the pgdbm library, supporting connection pooling, migration management, and health diagnostics.

  • Support for configurable chunking strategies, contextual retrieval, and reranking mechanisms to improve response precision.

  • Ensure PostgreSQL 14+ and the pgvector 0.5.0+ extension are properly configured before initialization.

  • Use the LLMemory class as the primary entry point; it handles the internal coordination of database connections, OpenAI API keys, and embedding generation.

  • Always initialize the library via the async initialize() method to ensure the underlying database schema is correctly migrated.

  • Leverage SearchType.HYBRID for the best balance of semantic understanding and keyword precision.

  • Use search_with_routing for conversational AI agents to intelligently determine whether a query can be answered from stored documentation before triggering extensive retrieval processes.

  • Manage document chunks efficiently by using owner_id parameters in all operations to maintain strict data boundaries in multi-user production environments.

Repository Stats

Stars
6
Forks
1
Open Issues
1
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 10:07 PM
View on GitHub