LangChain integration for FoxNose - the knowledge layer for RAG and AI agents
Project description
langchain-foxnose
LangChain integration for FoxNose — the serverless knowledge platform purpose-built as the knowledge layer for RAG and AI agents.
Installation
pip install langchain-foxnose
Quick Start
from foxnose_sdk.flux import FluxClient
from foxnose_sdk.auth import SimpleKeyAuth
from langchain_foxnose import FoxNoseRetriever
# Create a FoxNose Flux client
client = FluxClient(
base_url="https://<env_key>.fxns.io",
api_prefix="my_api",
auth=SimpleKeyAuth("YOUR_PUBLIC_KEY", "YOUR_SECRET_KEY"),
)
# Create the retriever
retriever = FoxNoseRetriever(
client=client,
folder_path="knowledge-base",
page_content_field="body",
search_mode="hybrid",
top_k=5,
)
# Use it
docs = retriever.invoke("How do I reset my password?")
for doc in docs:
print(doc.page_content)
print(doc.metadata)
Features
- All search modes: text, vector, hybrid, and vector-boosted search
- Flexible content mapping: single field, multiple fields, or custom mapper function
- Metadata control: whitelist, blacklist, or include system metadata
- Native async: uses
AsyncFluxClientfor true async when available - Structured filtering: pass FoxNose
wherefilters for precise retrieval - Full configuration: search fields, thresholds, hybrid weights, sort, and more
Search Modes
# Pure vector (semantic) search
retriever = FoxNoseRetriever(
client=client,
folder_path="articles",
page_content_field="body",
search_mode="vector",
)
# Hybrid search (text + vector)
retriever = FoxNoseRetriever(
client=client,
folder_path="articles",
page_content_field="body",
search_mode="hybrid",
hybrid_config={"vector_weight": 0.6, "text_weight": 0.4},
)
# Text search with vector boost
retriever = FoxNoseRetriever(
client=client,
folder_path="articles",
page_content_field="body",
search_mode="vector_boosted",
vector_boost_config={"boost_factor": 1.3},
)
Filtered Retrieval
retriever = FoxNoseRetriever(
client=client,
folder_path="articles",
page_content_field="body",
where={
"$": {
"all_of": [
{"status__eq": "published"},
{"category__in": ["tech", "science"]},
]
}
},
)
Async Usage
from foxnose_sdk.flux import AsyncFluxClient
async_client = AsyncFluxClient(
base_url="https://<env_key>.fxns.io",
api_prefix="my_api",
auth=SimpleKeyAuth("YOUR_PUBLIC_KEY", "YOUR_SECRET_KEY"),
)
retriever = FoxNoseRetriever(
async_client=async_client,
folder_path="knowledge-base",
page_content_field="body",
)
docs = await retriever.ainvoke("search query")
Documentation
License
Apache-2.0 — see LICENSE for details.
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
langchain_foxnose-0.1.0.tar.gz
(23.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_foxnose-0.1.0.tar.gz.
File metadata
- Download URL: langchain_foxnose-0.1.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
709b7ac8b96567042c256159f08e639c16fb05a56d7f5a477fa6239cd3073394
|
|
| MD5 |
0afd3796f9a40a54d7ea37bd887ad4e5
|
|
| BLAKE2b-256 |
c933a7303d563df30784f9c891935f1ee1f776d1c33d7df492e87b07ba90c982
|
File details
Details for the file langchain_foxnose-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_foxnose-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1118168f0995121c422e98b0b069fc5e2eb2e710d49365917e6fb1233600811a
|
|
| MD5 |
d9c09389f63effa9b06c3377b30ff9f8
|
|
| BLAKE2b-256 |
a8011e7b6444c42537e0b2246c52e13dd9586c2cb8c42b50d3ba151452dbae5d
|