Python SDK for the Valmar platform
Project description
valmar
Python SDK for the Valmar platform.
Documentation: https://docs.getvalmar.com
Source: https://github.com/TheValmarAI/valmar-python
License: Apache-2.0
Installation
uv add valmar
Quick start
from valmar import Valmar
client = Valmar(
api_key="valmr_proj_sk_...",
base_url="https://your-valmar-deployment.example.com",
organization_id="your-org-id",
project_id="your-project-id",
)
base_url is required because Valmar is deployed per customer. Use the base URL for your own Valmar deployment.
Search context
Find relevant saved knowledge across the configured project.
results = client.context.search("deployment process")
for hit in results.hits:
resource = client.context.read(hit.reference)
print(f"{hit.title} ({hit.score})")
print(resource.content_md)
trace = client.context.trace(hit.reference)
print(trace.source_thread_ids)
Create a context request
Create a context request that gets routed to the right people in your organization.
handle = client.context_requests.create(
"How do we handle database migrations in production?",
background_context="Planning a schema change for the orders table",
hidden_metadata={"external_case_id": "CASE-4821"},
)
print(f"Request created: {handle.context_request_id}")
print(f"Status: {handle.status}")
request = client.context_requests.get(handle.context_request_id)
if request.status == "completed":
print(request.result_summary)
print(request.hidden_metadata["external_case_id"])
hidden_metadata is an immutable string-to-string map copied to every
unstructured context snippet saved from the request. It is returned by the API
and SDK for client-side matching, but is not exposed through MCP or to Valmar AI agents.
List and import people
from valmar import CreatePersonInput
people = client.people.list()
result = client.people.import_bulk(
[
CreatePersonInput(
email="ada@example.com",
display_name="Ada Lovelace",
timezone="UTC",
title="Principal Engineer",
)
]
)
Run Knowledge Gap analysis
Use the active connection configured by a project administrator.
overview = client.knowledge_gaps.overview()
run = client.knowledge_gaps.start_run(custom_instructions="Focus on incident workflows")
# After the run completes:
ranking = client.knowledge_gaps.get_run_artifact(run.run_id, "ranking.json")
submissions = client.knowledge_gaps.submit_ranked_gaps(run.run_id, gap_ranks=[1, 2])
Context manager
with Valmar(
api_key="valmr_proj_sk_...",
base_url="https://your-valmar-deployment.example.com",
organization_id="your-org-id",
project_id="your-project-id",
) as client:
results = client.context.search("onboarding process")
Error handling
The SDK raises httpx.HTTPStatusError for non-2xx responses.
import httpx
try:
client.context.search("test")
except httpx.HTTPStatusError as e:
print(f"API error {e.response.status_code}: {e.response.text}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 valmar-1.0.0.tar.gz.
File metadata
- Download URL: valmar-1.0.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
100d787976abfb6790405efde8e798bbb75a2bd8bf1f9dad6eae5f136532e827
|
|
| MD5 |
e8554041a65f85bca73cd880587bd546
|
|
| BLAKE2b-256 |
a4050452bee682d89e099991e5f81fc4a917fbed0f94a8f856906eedd5c60f58
|
Provenance
The following attestation bundles were made for valmar-1.0.0.tar.gz:
Publisher:
publish.yml on TheValmarAI/valmar-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
valmar-1.0.0.tar.gz -
Subject digest:
100d787976abfb6790405efde8e798bbb75a2bd8bf1f9dad6eae5f136532e827 - Sigstore transparency entry: 2194899017
- Sigstore integration time:
-
Permalink:
TheValmarAI/valmar-python@235e247be732a2bd80c4b1168842e8fafb036e0a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TheValmarAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@235e247be732a2bd80c4b1168842e8fafb036e0a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file valmar-1.0.0-py3-none-any.whl.
File metadata
- Download URL: valmar-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
526fd0b49990ca1c872098710bbae70787779a24b9ed59e3d8b92c01e7a4e36d
|
|
| MD5 |
7e9f96736e7d04020f2ae501d264e4d5
|
|
| BLAKE2b-256 |
253e63dfd9f677de18c5917f25349f767ddd29aada6d5f712c1a4cca193ae450
|
Provenance
The following attestation bundles were made for valmar-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on TheValmarAI/valmar-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
valmar-1.0.0-py3-none-any.whl -
Subject digest:
526fd0b49990ca1c872098710bbae70787779a24b9ed59e3d8b92c01e7a4e36d - Sigstore transparency entry: 2194899023
- Sigstore integration time:
-
Permalink:
TheValmarAI/valmar-python@235e247be732a2bd80c4b1168842e8fafb036e0a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TheValmarAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@235e247be732a2bd80c4b1168842e8fafb036e0a -
Trigger Event:
workflow_dispatch
-
Statement type: