Skip to main content

Python library for loading and retrieving Logseq documents

Project description

Logseq Retriever

Python library for loading and retrieving Logseq documents.


Components

This section provides an overview of the components provided, listed by type

Retrievers

Retrievers inject context into a conversation. Works in tandem with a Contextualizer and Document Loader.

  • Input:
    • natural-language user-input, usually query-like
    • (optional) chat history
  • Output:
    • list of Documents to provide context for an LLM to answer the user-input

Implementations

  • LogseqJournalDateRangeRetriever
    • retrieve Logseq journal Documents, intended for queries that require context from a date range
    • required to set up:
      • RetrieverContextualizer
      • LogseqJournalLoader
    • examples:
      • "What did I do over Christmas break 2024?"
      • "How did I spend the last Independence Day?"

Contextualizers

Contextualizers serve as the bridge between natural-language input and a downstream component that handles fetching of relevant Documents.

  • Input:
    • natural-language user-input, usually query-like
    • (optional) chat history
  • Output:
    • structured downstream query, based on

In this library, an instance of RetrieverContextualizer is provided directly to Retrievers during the latter's instantiation. To set up the RetrieverContextualizer, provide RetrieverContextualizerProps, which includes:

  • llm - this is the backbone of the contextualizer
  • prompt - instructions provided to the LLM
  • output_schema - (optional) structured schema used to fetch relevant Documents
    • if no schema is provided, a string shall be returned instead
  • other flags and settings

Loaders

Loaders are one type of component that can fetch relevant Documents. Loaders are typically specific to a corresponding Retriever component.

  • Input:
    • each loader specifies its own schema
      • the Contextualizer is usually responsible for creating an instance of the query obj to act upon
  • Output:
    • list[Document]

Implementations

  • LogseqJournalFilesystemLoader
    • loads from the filesystem, where journal files are expected to be present at specified path

Scripts

PGVector

upload_journal

usage: python scripts/upload_journal_to_pgvector.py [-h] [-p PATH] from_date to_date

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

logseq_retriever-0.4.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

logseq_retriever-0.4.2-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file logseq_retriever-0.4.2.tar.gz.

File metadata

  • Download URL: logseq_retriever-0.4.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for logseq_retriever-0.4.2.tar.gz
Algorithm Hash digest
SHA256 67b434bba79c8a6c0305e3544d0e000528c28a10e7d5f22918d6157654a5a689
MD5 a66aaa2a08783ec203c59ac62c8ea4c4
BLAKE2b-256 748c9fbc841279a0dfbe5a3a92514d47265f835a6d93f940362780ec412b2f1b

See more details on using hashes here.

File details

Details for the file logseq_retriever-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: logseq_retriever-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for logseq_retriever-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ddd8f0a9902badb2a63d29c87fd0f59036c12eb0e21788e5bdc9afcdad17a1c6
MD5 5b1fe3aeed2ec6ebe6f75cfe2899c526
BLAKE2b-256 849b9813037927ae9ec429ad6db4171ddcfd3ba3c30b0bbbb055716bd8a4af25

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