Skip to main content

Langchain Outline Document Loader

Overview

langchain-outline provides a DocumentLoader for Langchain that allows you to load documents directly from an Outline knowledge base instance.

This loader uses the Outline API to fetch all documents within your instance.

Installation

pip install langchain-outline

Configuration

The loader requires the URL of your Outline instance and an API key for authentication.

Usage

import os
from langchain_outline.outline import OutlineLoader

# Option 1: Using environment variables (ensure they are set)
# os.environ["OUTLINE_INSTANCE_URL"] = "YOUR_OUTLINE_URL"
# os.environ["OUTLINE_API_KEY"] = "YOUR_API_KEY"
# loader = OutlineLoader()

# Option 2: Passing parameters directly
loader = OutlineLoader(
    outline_base_url="YOUR_OUTLINE_URL",
    outline_api_key="YOUR_API_KEY"
)

# Load documents (iteratively)
docs_iterator = loader.lazy_load()
for doc in docs_iterator:
    print(f"Loaded document: {doc.metadata['title']}")
    # Process the document...

# Or load all documents into a list (might consume more memory for large instances)
all_docs = loader.load()
print(f"Loaded {len(all_docs)} documents.")

Replace "YOUR_OUTLINE_URL" and "YOUR_API_KEY" with your actual Outline instance URL and API key.

Async usage

OutlineLoader also supports non-blocking async loading, backed by httpx.AsyncClient, for use in async applications:

import asyncio
from langchain_outline.outline import OutlineLoader

async def main():
    loader = OutlineLoader(
        outline_base_url="YOUR_OUTLINE_URL",
        outline_api_key="YOUR_API_KEY"
    )

    # Load documents (iteratively)
    async for doc in loader.alazy_load():
        print(f"Loaded document: {doc.metadata['title']}")
        # Process the document...

    # Or load all documents into a list (might consume more memory for large instances)
    all_docs = await loader.aload()
    print(f"Loaded {len(all_docs)} documents.")

asyncio.run(main())

httpx is a direct dependency of this package used for the async loading path.

For maintainers

To build and test publishing to TestPyPi

To publish a new version of the package you can use poetry (or twine, etc). First test using TestPyPi first.

  1. Make sure you have TestPyPi as a repo:

poetry config repositories.testpypi https://test.pypi.org/legacy/

  1. Obtain API token from TestPyPi and add it to poetry config:

poetry config pypi-token.testpypi <<token from testpypi>>

  1. Publish the package to TestPypi (make sure version defined in pyproject.toml follows PEP440):

poetry publish --build --repository testpypi

To publish to PyPi

To publish a new version of the package you can use poetry (or twine, etc). First test using TestPyPi first.

  1. Obtain API token from PyPi and add it to poetry config:

poetry config pypi-token.pypi <<token from pypi>>

  1. Publish the package to PyPi (make sure version defined in pyproject.toml follows PEP440):

poetry publish --build

Metadata

Release files for langchain-outline 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-outline 0.5.0
File Size Uploaded
langchain_outline-0.5.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-outline 0.5.0
File Interpreter ABI Platform
langchain_outline-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / langchain_outline-0.5.0.tar.gz

Download URL langchain_outline-0.5.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0423419301ffa566b52263da284237f354f6913173a8b6646bd5e52bf103a9a0
BLAKE2b-256 checksum
How to use checksums
b0b2f0228e768a065d5f778d8055c778c472a91485b096f6e6749353ba328c23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.11 Darwin/25.5.0

Release files / langchain_outline-0.5.0-py3-none-any.whl

Download URL langchain_outline-0.5.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
256cd04cde08bc797e059e6e291ca01be859c08cdddcd387dc9e3749660f4d63
BLAKE2b-256 checksum
How to use checksums
9c4e156979c14721f1fce4c71456d3b1e656723de728af4ababa53758435a718
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.11 Darwin/25.5.0

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page