agent-framework-dxmt
DXMT, the open-source memory database for personal agents, for Microsoft Agent Framework: a vector store with keyword-hybrid search, and memory as a context provider.
pip install agent-framework-dxmt
A DXMT server has to be running (vectordb serve, or
docker run -p 127.0.0.1:9999:9999 -v dxmt:/data dxmtai/dxmt). Connection settings are
DXMT_URL (default http://localhost:9999) and DXMT_API_KEY, or the url / api_key
arguments, resolved through Agent Framework's load_settings like every other connector.
Vector store
DXMTCollection and DXMTStore implement BaseVectorCollection / BaseVectorSearch and
BaseVectorStore. A collection is one DXMT table; the record's single vector field is the
row's vector and its data fields are the payload.
from dataclasses import dataclass
from typing import Annotated
from agent_framework import Filter, VectorStoreField, vectorstoremodel
from agent_framework_dxmt import DXMTStore
@vectorstoremodel
@dataclass
class Document:
id: Annotated[str, VectorStoreField("key")]
title: Annotated[str, VectorStoreField("data", is_full_text_indexed=True)]
year: Annotated[int, VectorStoreField("data", is_indexed=True)]
embedding: Annotated[list[float] | None, VectorStoreField("vector", dimensions=3)] = None
async with DXMTStore() as store:
collection = store.get_collection(Document, collection_name="documents")
await collection.ensure_collection_exists()
await collection.upsert([Document("1", "Hello DXMT", 2026, [1.0, 0.0, 0.0])], generate_vectors=False)
results = await collection.search(vector=[1.0, 0.0, 0.0], filter=Filter("year", "gte", 2020), top=3)
async for item in results:
print(item["record"].title, item["score"])
What is specific to DXMT:
- Keyword-hybrid search. A data field marked
is_full_text_indexedgets the table's BM25 index, andcollection.search("hello", search_type="keyword_hybrid", additional_property_name="title")is the server's hybrid search (vector and keywords fused on the server). Most in-tree connectors declare{"vector"}only. - Server-side embedding.
DXMTCollection(..., server_embedding={"model": "text-embedding-3-small"}, server_embedding_field="title")has the server embed records whose vector isNoneand queries given as text, so no embedding client runs in the agent's process. - Filters. Every portable operator (
eq,ne, ranges,between,in,not_in,is_null,is_not_null,exists,contains,contains_any,contains_all,starts_with,ends_with,contains_text) andand/or/notgroups, translated exactly to the server's flat filter; a shape the server has no flat form for ((a and b) or c) raisesNotImplementedErrorrather than being approximated. - Scores are similarities (1.0 is identical under cosine);
score_thresholdis in those units. One vector field per collection;cosine_similarity(default),dot_prod,euclidean_distance.
Memory as a context provider
DXMTContextProvider recalls memories before a run (by meaning and keyword) and remembers
the exchange after it, using DXMT's own memory API. Scope is tags: memories are written under
user_id / agent_id / application_id and recalled by the separate search_* ids, the
split the mem0 provider uses so a memory written under a shared agent is not read back for an
unrelated user by accident.
from agent_framework import Agent
from agent_framework_dxmt import DXMTContextProvider
memory = DXMTContextProvider(user_id="alice", search_user_id="alice")
agent = Agent(chat_client, instructions="...", context_providers=[memory])
await agent.run("I prefer answers in Chinese.")
await agent.run("How should you answer me?") # the preference is recalled into the context
memory.remember(text, kind=..., supersedes=[...]), memory.recall(query) and
memory.forget(ids) expose the three operations directly. A memory said twice is kept once;
a new fact can supersede an old one, which is kept as history and left out of recall. The
same store is what every other agent on the machine sees over MCP and REST.
Tests
pytest # unit tests, client mocked
DXMT_TEST_URL=http://127.0.0.1:9999 pytest -m integration # against a server
Metadata
Release files for agent-framework-dxmt 1.6.0
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 |
|---|---|---|---|---|
| agent_framework_dxmt-1.6.0.tar.gz | 25.0 kB | Without provenance | Details for agent_framework_dxmt-1.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_framework_dxmt-1.6.0-py3-none-any.whl | Python 3 | none | any | Details for agent_framework_dxmt-1.6.0-py3-none-any.whl |
Total release size: 44.9 kB
Release files / agent_framework_dxmt-1.6.0.tar.gz
| Download URL | agent_framework_dxmt-1.6.0.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80b2560f2f174535a225d05f68f83b7b49c80e56d3570008a979ba7a3a2a3477
|
|
BLAKE2b-256 checksum How to use checksums |
aea1bcab2b3dabf7c12f6e9d28045a5eda0db8f0e38481e71091dd4bd9ae9c7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / agent_framework_dxmt-1.6.0-py3-none-any.whl
| Download URL | agent_framework_dxmt-1.6.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85b306b0279a89df3aa9d0912d1604ebf98e02609896024a93cecd4c4a5da9aa
|
|
BLAKE2b-256 checksum How to use checksums |
119a90e3329f15812b6628293f27355f1c420ab48e1525be1278aa34b04b59b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for agent-framework-dxmt 1.6.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.