agos-context
A small, deterministic kernel for bounded context graphs. It performs no I/O and grants no authority.
authorized owner records -> Contributions -> SliceOrder -> bounded Slice
-> exact traversal
The package owns four semantics:
| Module | Meaning |
|---|---|
graph |
Stable addresses, exact revisions, owner assertions, bounds, omissions, and Slice identity. |
predicate |
Typed owner-defined construction of lawful links. |
compile |
Explicit retention order and deterministic bounded compilation. |
traversal |
Bounded neighborhoods, directed paths, and exact source closure. |
Authorization, acquisition, storage, search, embeddings, models, prompts, ontologies, entity resolution, canonical records, and writes belong to the integrating application.
Install
python -m pip install agos-context
# or
uv add agos-context
Example
from datetime import datetime, timezone
from agos_context.compile import compile_slice, retention_order
from agos_context.graph import Contribution, Limits, Node, Pin, Policy, Ref, link, stable_hash
from agos_context.traversal import SourceClosure, neighborhood
memory = Pin(ref=Ref(owner="memory", kind="memory", id="m1"), revision="1")
document = Pin(ref=Ref(owner="documents", kind="document", id="d1"), revision="4")
memory_node = Node(pin=memory, record_class="record", label="Debt maturity")
document_node = Node(pin=document, record_class="evidence", label="Credit agreement")
supported_by = link(
owner=memory,
source=memory.ref,
predicate="memory.supported_by",
target=document.ref,
family="source",
)
parts = (
Contribution(
owner="memory",
nodes=(memory_node, document_node),
links=(supported_by,),
policies=(Policy(owner="memory", name="read", revision=stable_hash(["memory-read-v1"])),),
),
Contribution(
owner="documents",
nodes=(document_node,),
policies=(Policy(owner="documents", name="read", revision=stable_hash(["document-read-v1"])),),
),
)
nodes = tuple(node for part in parts for node in part.nodes)
links = tuple(row for part in parts for row in part.links)
now = datetime(2026, 1, 1, tzinfo=timezone.utc)
context = compile_slice(
purpose="research",
roots=(memory.ref,),
effective_as_of=now,
observed_before=now,
nodes=nodes,
order=retention_order(roots=(memory,), nodes=nodes, links=links),
links=links,
policies=tuple(policy for part in parts for policy in part.policies),
limits=Limits(max_nodes=8, max_links=8),
)
selected = neighborhood(
context,
root=memory,
depth=1,
source_closure=SourceClosure(),
limits=Limits(max_nodes=8, max_links=8),
)
assert {node.pin for node in selected.nodes} == {memory, document}
assert selected.links == (supported_by,)
Applications construct closed contributions from already-authorized records. The purpose compiler explicitly chooses which contributions to flatten and how to order them; the generic kernel does not infer policy. The caller supplies purpose, time, order, policy, limits, and finite values explicitly. A Slice is immutable and content-addressed. Traversal can only select records already present in that Slice; selected semantic records can require exact source links or report their absence.
Links are navigation, not inferred truth. Labels are presentation, not authority. Consumers reopen the exact canonical owner revision before relying on a selected record.
Develop
uv sync --locked --all-groups
uv run pytest
uv run ruff check .
uv run mypy agos_context
uv build --no-sources
CI tests the wheel and source archive as external packages on Python 3.12 and 3.13.
Security
See SECURITY.md. Report vulnerabilities privately rather than opening a public issue.
License
Copyright 2026 I am Agos, Inc. Licensed under the Apache License, Version 2.0.
Metadata
Release files for agos-context 0.1.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 | |
|---|---|---|---|---|
| agos_context-0.1.0.tar.gz | 25.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agos_context-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.6 kB
Release files / agos_context-0.1.0.tar.gz
| Download URL | agos_context-0.1.0.tar.gz |
|---|---|
| Size | 25.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31dd6f8db8bdfc8e5cf247851c05bb3ed35a19126160abc72e3460f64aa8e9b0
|
|
BLAKE2b-256 checksum How to use checksums |
d98f0c8493c4c672874b6acaff2cfa720477f7af4934c92b1662cb1a43fbb2d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / agos_context-0.1.0-py3-none-any.whl
| Download URL | agos_context-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8e680b93ed6842e71d691c4afd86548195810bd7e88a5932e11a98cda94ca11
|
|
BLAKE2b-256 checksum How to use checksums |
57c85a536fd4f974bc3acb9e3eb6abe7525538459b7d7fd45a66f5142bb944ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for agos-context 0.1.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.