Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ __pycache__/
*.pyc
.DS_Store
.idea/
summaries/
vendor/
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,50 @@
Notable changes to Graphicle: the graph engine (`graphicle-graph`), the memory
library (`graphicle-memory`) and the `graphicle` program.

## 0.1.19

### Added

- Private memory per key. The owner can give a key a `memory_namespace`
(and `self_review`) when making it. Such a key reads the shared project as
before, and reads and writes only its namespace's memory: memories and
their revisions, work state, claims, entities, events, jobs, embeddings,
cached query vectors and cached model results. It never sees shared memory
or another namespace's, through any tool or cache, and another namespace's
memory id gets the answer an unknown id gets. Everything else works as for
any key: dense retrieval, cached query vectors, Qdrant, observer notes and
the MCP tools and their descriptions, and its replies have the same fields
as a key without a namespace. Keys without a namespace are unchanged. The
owner API adds `stats`, `export`, `import` and `delete` for a namespace
(`/api/workspaces/W/memory-namespaces/N/…`); deleting a project deletes
its namespaced memory.

### Behaviour changes

- Qdrant points carry a `partition` (`source`, `memory` or
`memory:<namespace>`), and a reader accepts only the sources' and its own
memory's. An owner's publication includes every namespace's memory
vectors. Points published by earlier releases have none and are read as
before; publish again to partition them.
- The opt-in embedding cache (`GRAPHICLE_EMBEDDING_CACHE`) keeps each
namespace's memory passages in their own key space. Source passages and
shared memory keep the shared one, so existing entries are still used.
- Cached query vectors are evicted per namespace (the newest 500 each), so
one namespace's questions never evict another's.

### After upgrading

- Once the owner makes a key with a memory namespace, the store records that
it needs Graphicle 0.1.19 or newer (store format 2), so 0.1.3 to 0.1.18
refuse to open it instead of reading namespaced keys as ordinary keys and
namespaced memory as shared. A store without a namespace can still be
opened by earlier releases.
- The store gains a nullable `memory_namespace` column on credentials and on
the tables of agent-written memory and their caches, and an
`am_memory_namespaces` table. Existing rows stay shared (NULL); nothing is
rewritten. Code that inserts into these tables without naming its columns
must name them now.

## 0.1.18 - 2026-11-16

Every crate is at 0.1.18, and `graphicle --version` prints
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ No, for most of it. The code graph (with `--code-only`), sync, `context`, the MC
Kubernetes (25,899 code files) builds in minutes on 4 vCPUs (chart above). By default a project can hold up to 100,000 text files and 1 GiB of text; you can raise both ([limits](docs/configuration.md#limits)).
</details>

<details>
<summary><b>Can several developers share one server without sharing memory?</b></summary>

Yes. Give each developer's key a memory namespace: every key reads the same project, and each one's memory stays private to its namespace ([private memory per key](crates/graphicle/README.md#private-memory-per-key)). Keys without one share the project's reviewed memory, as before.
</details>

<details>
<summary><b>Is there a version for teams?</b></summary>

Expand Down
2 changes: 1 addition & 1 deletion crates/graphicle-graph/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/graphicle-graph/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "graphicle"
version = "0.1.18"
version = "0.1.19"
edition = "2024"
rust-version = "1.94.1"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion crates/graphicle-graph/src/dedup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ fn namespace_reference_stub_collisions_in<R: Record, E: EdgeItem<Record = R>>(
}
let mut reserved: HashSet<String> = taken.clone();
reserved.extend(candidates.values().cloned());
for (_, value) in candidates.iter_mut() {
for value in candidates.values_mut() {
let base = value.clone();
let mut candidate = base.clone();
let mut suffix = 2;
Expand Down
4 changes: 3 additions & 1 deletion crates/graphicle-graph/src/detect_ignore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ impl EncodingWarnings {
let le = raw.starts_with(b"\xff\xfe");
if raw.len() % 2 == 0 {
let units = raw[2..]
.chunks_exact(2)
.as_chunks::<2>()
.0
.iter()
.map(|b| {
if le {
u16::from_le_bytes([b[0], b[1]])
Expand Down
2 changes: 1 addition & 1 deletion crates/graphicle-graph/src/export_formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ pub fn spring_layout(graph: &Graph) -> Result<Vec<[f64; 2]>> {
if !result.f.is_finite() || result.x.iter().any(|x| !x.is_finite()) {
return Err("SVG energy layout failed to produce finite positions".into());
}
pos = result.x.chunks_exact(2).map(|p| [p[0], p[1]]).collect();
pos = result.x.as_chunks::<2>().0.to_vec();
}
for d in 0..2 {
let mean = pos.iter().map(|p| p[d]).sum::<f64>() / n as f64;
Expand Down
3 changes: 1 addition & 2 deletions crates/graphicle-graph/src/extract_languages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,9 @@ fn textwrap_shorten(flat: &str, width: usize, placeholder: char) -> String {
break;
}
}
if chunks.last().is_some_and(|c| c.len() > width) {
if let Some(chunk) = chunks.pop_if(|c| c.len() > width) {
// _handle_long_word with break_long_words=True, break_on_hyphens=True
let space_left = if width < 1 { 1 } else { width - cur_len };
let chunk = chunks.pop().unwrap();
let mut end = space_left.min(chunk.len());
if chunk.len() > space_left
&& let Some(h) = chunk[..space_left].iter().rposition(|c| *c == '-')
Expand Down
2 changes: 1 addition & 1 deletion crates/graphicle-graph/src/extract_normalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ pub fn finish<E: Rec>(nodes: &mut [Value], edges: &mut [E], root: &Path, convert
.rec_get(key)
.and_then(Value::as_str)
.filter(|current| !current.is_empty())
.and_then(&canon)
.and_then(canon)
{
e.rec_set_str(key, &new);
}
Expand Down
6 changes: 4 additions & 2 deletions crates/graphicle-graph/src/extractors/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ fn decode_utf16_with_bom(raw: &[u8]) -> Option<String> {
if !body.len().is_multiple_of(2) {
return None;
}
let units = body.chunks_exact(2).map(|u| {
let units = body.as_chunks::<2>().0.iter().map(|u| {
if little {
u16::from_le_bytes([u[0], u[1]])
} else {
Expand All @@ -286,7 +286,9 @@ fn decode_utf32_with_bom(raw: &[u8]) -> Option<String> {
if !body.len().is_multiple_of(4) {
return None;
}
body.chunks_exact(4)
body.as_chunks::<4>()
.0
.iter()
.map(|u| {
char::from_u32(if little {
u32::from_le_bytes([u[0], u[1], u[2], u[3]])
Expand Down
2 changes: 1 addition & 1 deletion crates/graphicle-graph/src/extractors/resolution_facts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ pub fn resolve_python_namespace_dir(
if let Some(p) = namespace(root.join(&rel)) {
return Some(p);
}
if let Some(p) = projected_python_module(module, root).and_then(&namespace) {
if let Some(p) = projected_python_module(module, root).and_then(namespace) {
return Some(p);
}
for dir in current.parent().into_iter().flat_map(Path::ancestors) {
Expand Down
6 changes: 3 additions & 3 deletions crates/graphicle-graph/src/extractors/yaml_frontmatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ fn expand(nodes: &[Node], id: usize, depth: usize) -> Result<Value> {
Node::Mapping(children, kind) => {
let mut entries: Vec<(Value, Value)> = Vec::new();
let mut inherited = Map::new();
for pair in children.chunks_exact(2) {
for pair in children.as_chunks::<2>().0 {
let key = expand(nodes, pair[0], depth + 1)?;
let value = expand(nodes, pair[1], depth + 1)?;
if matches!(nodes[pair[0]], Node::Merge) {
Expand Down Expand Up @@ -585,7 +585,7 @@ fn expand_loaded(nodes: &[Node], id: usize, depth: usize) -> Result<Loaded> {
Node::Mapping(children, _) => {
let mut merged: Vec<(Value, Loaded)> = Vec::new();
let mut own: Vec<(Value, Loaded)> = Vec::new();
for pair in children.chunks_exact(2) {
for pair in children.as_chunks::<2>().0 {
if matches!(nodes[pair[0]], Node::Merge) {
match expand_loaded(nodes, pair[1], depth + 1)? {
Loaded::Map(entries) => merged.extend(entries),
Expand Down Expand Up @@ -725,7 +725,7 @@ impl Tree {
}
let mut merged = vec![];
let mut explicit = vec![];
for pair in children.chunks_exact(2) {
for pair in children.as_chunks::<2>().0 {
let key = self.resolve(pair[0]);
match &self.nodes[key] {
Node::Merge => {
Expand Down
5 changes: 1 addition & 4 deletions crates/graphicle-graph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,7 @@ fn dispatch_streamed(bytes: &[u8]) -> Option<Result<Value>> {
};
let loaded = match graph {
GraphSlot::Missing => None,
GraphSlot::Raw(raw) => match graph::Graph::from_node_link_json(raw.get(), edges_key) {
Some(graph) => Some(graph),
None => return None,
},
GraphSlot::Raw(raw) => Some(graph::Graph::from_node_link_json(raw.get(), edges_key)?),
GraphSlot::Dynamic(_) | GraphSlot::Streamed(_) => return None,
};
return Some(session::dispatch(&request, loaded));
Expand Down
5 changes: 2 additions & 3 deletions crates/graphicle-graph/src/python_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,9 @@ fn siphash13(k0: u64, k1: u64, data: &[u8]) -> u64 {
k0 ^ 0x6c79_6765_6e65_7261,
k1 ^ 0x7465_6462_7974_6573,
];
let chunks = data.chunks_exact(8);
let tail = chunks.remainder();
let (chunks, tail) = data.as_chunks::<8>();
for chunk in chunks {
let m = u64::from_le_bytes(chunk.try_into().expect("an 8-byte chunk"));
let m = u64::from_le_bytes(*chunk);
v[3] ^= m;
round(&mut v);
v[0] ^= m;
Expand Down
7 changes: 3 additions & 4 deletions crates/graphicle-graph/src/transcribe_native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,9 @@ impl NativeSpeech {
if bytes.len() % 4 != 0 {
return Err("ValueError: invalid decoded audio".into());
}
let samples: Vec<f32> = bytes
.chunks_exact(4)
.map(|b| f32::from_le_bytes(b.try_into().unwrap()))
.collect();
// The length is a multiple of 4 (checked above), so no bytes are left over.
let (words, _) = bytes.as_chunks::<4>();
let samples: Vec<f32> = words.iter().map(|b| f32::from_le_bytes(*b)).collect();
if samples.iter().any(|n| !n.is_finite()) {
return Err("ValueError: decoded audio contains nonfinite samples".into());
}
Expand Down
4 changes: 2 additions & 2 deletions crates/graphicle-memory/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/graphicle-memory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "graphicle-memory"
version = "0.1.18"
version = "0.1.19"
edition = "2024"
rust-version = "1.94.1"
publish = false
Expand Down
6 changes: 3 additions & 3 deletions crates/graphicle/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/graphicle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "graphicle-runtime"
version = "0.1.18"
version = "0.1.19"
edition = "2024"
rust-version = "1.94.1"
publish = false
Expand Down
44 changes: 44 additions & 0 deletions crates/graphicle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,50 @@ accepts the account email and site URL. SharePoint, Salesforce and other
connectors are not implemented, nor are Jira attachments and Confluence
macros or attachments.

### Private memory per key

One project can serve many developers without their agents' memories
mixing. The owner gives a key a **memory namespace** when making it, and can
let that namespace approve its own drafts:

```sh
curl -X POST https://memory.example.com/api/workspaces/WORKSPACE_ID/credentials \
-H "Authorization: Bearer OWNER_KEY" -H "Content-Type: application/json" \
-d '{"role":"agent","label":"dev-17","memory_namespace":"dev-17","self_review":true}'
```

A key with a namespace reads the shared project (graph, sources, wiki) as any
key does, and reads and writes only its own namespace's memory: proposed and
reviewed memories, their revisions, work state, claims and entities, its
queued jobs and the model results cached for them. It never sees shared
memory or another namespace's, by any tool: not the text, a count, an id or a
cached answer. Asking for another namespace's memory id gets the answer an
unknown id gets (`Memory unavailable`). Several keys may share a namespace
(one developer's key, rotated); a key's namespace and a namespace's
`self_review` cannot be changed afterwards. A key without a namespace keeps
the shared, reviewed memory it always had, and never sees a namespace's.
Grounding is as strict inside a namespace: quotes of current sources, the
size limits, `<private>` spans dropped and credentials redacted.

Apart from whose memory it reaches, a namespaced key works exactly as any
key: dense retrieval and Qdrant rank its own memory beside the sources,
its query vectors are cached for it, it reads and writes the observer notes
of the sources it can read, and its MCP tools, their descriptions and its
replies are those of a key without a namespace. Embeddings of a namespace's
memory are stored under that namespace (in the store, in the embedding
cache and in Qdrant) and read by nobody else.

The owner manages a namespace across all of the workspace's projects:

| Request | What it does |
| --- | --- |
| `GET /api/workspaces/W/memory-namespaces/N/stats` | rows, bytes and the last read and write |
| `GET /api/workspaces/W/memory-namespaces/N/export` | every row of the namespace, as one archive with its SHA-256 |
| `POST /api/workspaces/W/memory-namespaces/N/import` | restore that archive into the same, empty namespace |
| `POST /api/workspaces/W/memory-namespaces/N/delete` | delete every row in one transaction, with a hash-chained receipt and a residue check |

Deleting a project deletes its namespaced memory too.

## Answering and memory

Use **Connections → Answering models → Configure model**. Save a model name,
Expand Down
Loading
Loading