fenecdb for Python
A client for fenec-pg's HTTP endpoint (fenec-pg --http <address>), and
vector stores for LangChain and LlamaIndex on top of it.
pip install "fenecdb[langchain]" # or "fenecdb[llama-index]"
from fenecdb import Client
db = Client("http://127.0.0.1:8080", token="...")
db.query("get articles select title near embed $1 limit 5", [[0.1, 0.2, 0.3]])
In an event loop -- FastAPI, aiohttp, an agent -- AsyncClient makes the
same calls awaited, over one kept-alive connection, the standard library
alone:
from fenecdb import AsyncClient
async with AsyncClient("http://127.0.0.1:8080", token="...") as db:
rows = await db.query("get articles select title near embed $1 limit 5", [[0.1, 0.2, 0.3]])
await db.batch([("put articles {title: $1}", ["a"]), ("put articles {title: $1}", ["b"])])
from fenecdb.langchain import FenecVectorStore
store = FenecVectorStore(embeddings, "docs", url="http://127.0.0.1:8080", token="...",
metadata_fields={"source": "text"})
store.add_documents(documents)
store.similarity_search("how do I compact", k=4, filter={"source": "handbook"})
from fenecdb.llama_index import FenecVectorStore
from llama_index.core import StorageContext, VectorStoreIndex
store = FenecVectorStore("docs", url="http://127.0.0.1:8080", token="...")
index = VectorStoreIndex.from_documents(
documents, storage_context=StorageContext.from_defaults(vector_store=store)
)
A document or node is a row -- its id, text, metadata as JSON and vector
under @hnsw -- in a collection created on the first write. Fields named in
metadata_fields get columns of their own under @hash, and filters over
them are answered by the index before the search runs.
With full_text=True the text is indexed for BM25 too, and both stores search
by the words alone or by the words and the vector fused -- LangChain's
mode="text" and mode="hybrid", LlamaIndex's TEXT_SEARCH and HYBRID.
quant="int8" or "bit" keeps the graph over codes.
store = FenecVectorStore(embeddings, "docs", url=..., token=..., full_text=True)
store.similarity_search("how do I compact", k=4, mode="hybrid")
./run-tests.sh runs LangChain's standard vector store suite and the tests
LlamaIndex's own integrations run against a fenec-pg it builds and starts.
Full reference: https://fenecdb.com/docs/integrations
Metadata
Release files for fenecdb 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fenecdb-0.1.6.tar.gz | 16.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fenecdb-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.7 kB
Release files / fenecdb-0.1.6.tar.gz
| Download URL | fenecdb-0.1.6.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3072333d5e7f1bd9caef7e9ee5e11b096223c8a2fbb0d70e1f9dff937a3bbef9
|
|
BLAKE2b-256 checksum How to use checksums |
c6c6eafd2437a12001001be5766cd418dcd2935c69e7b1d475036c405a7f83a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / fenecdb-0.1.6-py3-none-any.whl
| Download URL | fenecdb-0.1.6-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4e8fa94dcec051dc05bfce01be8064ace3d2be8518837cb9fbdca76699b2f23
|
|
BLAKE2b-256 checksum How to use checksums |
dc31268b15fa73dfa1aecf36c27b02b65c8a45acd76e1a74fa7a0ce9203377a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|