This release is a pre-release and may not be stable for production use.
Antfly for LangChain
Persistent vector and hybrid retrieval, text/image embeddings, reranking, document and media storage, and graph context backed by an Antfly server. Python 3.11 or newer. Apache-2.0 licensed.
Release candidate: 0.1.0rc2. Requires antfly-sdk>=0.2.1 and a compatible
Antfly server; 0.3.0-rc.5 is the tested baseline. See the
server setup.
Install
pip install langchain-antfly==0.1.0rc2
# Graph ingestion and tools are included; no extra is required.
The package connects to an existing Antfly server; it does not install or start one. Configure a compatible server with inference enabled and choose an installed embedding model using the setup guide. Models are not downloaded automatically.
Retrieve three documents
import os
from antfly import AntflyClient
from langchain_antfly import AntflyEmbeddings, AntflyVectorStore
from langchain_core.documents import Document
with AntflyClient(
base_url=os.environ["ANTFLY_URL"], token=os.getenv("ANTFLY_TOKEN")
) as client:
embeddings = AntflyEmbeddings(
client=client, model=os.environ["ANTFLY_EMBEDDING_MODEL"]
)
store = AntflyVectorStore.from_documents(
[
Document(id="owner", page_content="Mira Chen owns operations."),
Document(id="target", page_content="The shipment target is 120 crates."),
Document(id="storage", page_content="Apples are stored in the cool warehouse."),
],
embeddings,
client=client,
table="langchain_example",
distance_metric="cosine",
)
documents = store.as_retriever(search_kwargs={"k": 1}).invoke(
"Who owns operations?"
)
print(documents[0].page_content)
The factory creates a missing table or reuses a compatible one. Stable document
IDs make repeated writes update the same records. To attach without writing,
construct AntflyVectorStore(client=client, table="langchain_example", embedding=embeddings).
Delete this example's dedicated table with client.drop_table("langchain_example")
inside the client context when finished. Async factories, retrieval and mutations
are also available.
Graph input migration in 0.1.0rc2
Starting with 0.1.0rc2, this package provides GraphDocument, Node, and
Relationship directly from langchain_antfly; graph storage no longer needs
Community. Existing
structurally compatible graph documents remain valid inputs. Published 0.1.0rc1
is unchanged and still requires its [graph] extra. See the
migration guide
for imports, source ownership and base-class compatibility.
More examples
- Persistent PDF and image RAG: extract text and images, retrieve persistent parents and original media, and generate answers with an existing vision provider.
- Hybrid search, reranking, graph context and caching.
- API reference and limitations.
- Validation evidence.
Persistent LangGraph agent memory is available separately in
langgraph-store-antfly. This package does not include a chat-model adapter or
an execution checkpointer.
Metadata
Release files for langchain-antfly 0.1.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_antfly-0.1.0rc2.tar.gz | 29.4 kB | With provenance | Details for langchain_antfly-0.1.0rc2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_antfly-0.1.0rc2-py3-none-any.whl | Python 3 | none | any | Details for langchain_antfly-0.1.0rc2-py3-none-any.whl |
Total release size: 64.6 kB
Release files / langchain_antfly-0.1.0rc2.tar.gz
| Download URL | langchain_antfly-0.1.0rc2.tar.gz |
|---|---|
| Size | 29.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9156607fba3ddf35b85b6a23ad65759e46ced053fe44ac13c461953c63e1d1a6
|
|
BLAKE2b-256 checksum How to use checksums |
2e796bbfcf0426ab44cc65d99f065ac1f20f1ad42db24b3ca996150de8927770
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logRelease files / langchain_antfly-0.1.0rc2-py3-none-any.whl
| Download URL | langchain_antfly-0.1.0rc2-py3-none-any.whl |
|---|---|
| Size | 35.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c97e65bc3fed6c5ee084e0c8e28f9a21391fbd364ef297e6b4c924704d95bc71
|
|
BLAKE2b-256 checksum How to use checksums |
6d83ef731afaaf41a453605de2eea1be8b7de7d94ecb3911e1c73c18544b411b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logSecurity for langchain-antfly 0.1.0rc2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for langchain_antfly-0.1.0rc2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.