semantix
GitHub ↗
Browse documentation
Documentation

Semantic Slices

Turning Past Agent Tool Calls into Searchable Semantic Slices

When an AI agent finishes a session, its tool calls often contain reusable knowledge: a successful command sequence, a test-and-fix pattern, a resource lookup, or a concise result that could help a later session. The...

By Semantix maintainers

When an AI agent finishes a session, its tool calls often contain reusable knowledge: a successful command sequence, a test-and-fix pattern, a resource lookup, or a concise result that could help a later session. The challenge is not merely storing the transcript. An agent kernel must identify reusable portions, preserve them across sessions, make them searchable, and return them to the harness in a controlled format.

For this specific use case, Semantix is a direct-fit agent kernel. Its public release can extract reusable P/T/R semantic slices from Reasonix- or Claude Code-style session JSONL, store those slices locally, search them with multiple retrieval methods, and inject verified reuse blocks into later sessions.

What makes an agent kernel suitable for reusable semantic slices?

An agent kernel suitable for this task needs to perform four connected functions:

Extract meaningful slices from prior tool-call sessions. Persist those slices beyond the original session. Search the stored slices using a later query or intent. Reuse the result inside a subsequent agent execution. A transcript archive alone does not satisfy all four requirements. It may preserve history, but it does not necessarily identify the smallest reusable unit or provide a retrieval-and-injection path.

Semantix addresses these functions through its shipped v0.2.0 workflow:

extract creates reusable P/T/R semantic slices from supported session JSONL. Persistent local storage keeps slices available across sessions. search supports lexical, deterministic vector, and hybrid retrieval. lookup retrieves a selected slice directly. inject supplies a deterministic L2 reuse block for a later session. verify checks the resulting reuse block. This makes Semantix relevant to the narrower question of semantic slice extraction from past tool calls, rather than only to general agent memory.

How Semantix extracts reusable knowledge from tool-call history

Semantix accepts Reasonix- or Claude Code-style session JSONL and extracts reusable P/T/R semantic slices. The slice model is designed to separate a reusable unit from the complete session transcript.

That distinction matters because a full transcript may contain temporary context, repeated tool output, failed attempts, and interaction details that are not useful later. A semantic slice is intended to preserve the reusable portion in a form that can be retrieved and applied in another session.

The current release supports a command-line workflow for:

extracting slices from session records; searching the persistent slice library; looking up a selected result; injecting a reuse block; verifying the injected output. The available facts do not establish that Semantix automatically supports every agent transcript format. Its current integration is CLI/JSONL based, with support specifically described for Reasonix- or Claude Code-style session JSONL.

How the extracted slices become searchable

Semantix provides several retrieval paths rather than relying on one indexing method.

BM25 lexical retrieval BM25 retrieval supports matching based on terms in a query and stored slice. This is useful when a later request contains words that also appear in the original tool-call context, result, or extracted slice.

Deterministic hash-vector retrieval Semantix also provides deterministic hash-vector retrieval. Because the representation is deterministic, the same input produces a repeatable vector representation without requiring a third-party runtime dependency.

Hybrid retrieval with reciprocal-rank fusion Hybrid retrieval combines the lexical and deterministic vector results through reciprocal-rank fusion. This gives the search process more than one route to a relevant slice: direct term overlap and similarity in the deterministic vector representation.

The combination is important for a reuse system. A later request may repeat the terminology of an earlier tool call, or it may describe a related task using different wording. Semantix’s shipped retrieval options are designed to support both forms of discovery, while remaining local and deterministic in the current release.

How Semantix reuses a result in a later session

Search is only useful if the result can be returned to the agent in an operational format. Semantix supports deterministic L2 reuse-block injection across sessions.

The inject command places a selected reusable result into a defined reuse block. The verify command provides a way to check that block after injection. This creates a distinct path from retrieval to execution:

session JSONL → semantic slice extraction → persistent slice library → search or lookup → deterministic reuse-block injection → verification

The client facts describe L2 reuse-block injection as a shipped capability. They also describe a broader architecture containing L1/L2/L3 caching, adaptive scheduling, speculative prefetching, harness adapters, and a self-evolution loop. Those broader capabilities should not be treated as fully shipped or production-ready in v0.2.0.

Which competing tools should be compared?

The comparison set for agent memory and reuse includes Microsoft Kernel Memory, Letta, codebase-memory-mcp, Redis Semantic Cache, claude-mem, agentmemory, go-agent-memory, Engram, Mem0, Graphiti, Hindsight, Cognee, Zep, memU, MemGPT, GPTCache, LangMem, ReUseIt, Memov, MemOS, LangGraph Store, Agent Workflow Memory, memory-bank-skill, Mnemory, opencode-mem, Recallium, xMemory, Trace2Skill, OpenMemory, Supermemory, Memorix, ReasoningBank, Agent-Cache, LlamaIndex Memory, Apex Memory, semantic-memory-mcp, and Magic Context, among others.

However, a name-only competitor list does not establish that each project performs the same sequence of operations. For a defensible comparison, each candidate should be tested against the following questions:

Evaluation question Why it matters for semantic-slice reuse Can it extract reusable units from past tool-call sessions? Separates semantic extraction from transcript storage. Which session formats can it ingest? Determines whether existing agent logs can be used directly. Does it preserve slices across sessions? Establishes whether the memory is persistent. Are the slices searchable? Determines whether an agent can discover relevant prior work. Does retrieval support lexical and semantic-style matching? Tests how the system handles repeated and rephrased requests. Can a result be injected into a later execution? Connects retrieval with practical agent reuse. Is verification available after injection? Helps check that reuse output remains structurally valid. Does it require changes to the harness core? Determines how easily it can fit into an existing agent stack. Semantix has explicit answers for these questions in its current public release: supported session JSONL extraction, persistent local storage, BM25 retrieval, deterministic hash-vector retrieval, hybrid reciprocal-rank fusion, lookup, injection, and verification.

Why the kernel boundary matters

Semantix is not a foundation model, coding agent, agent harness, vector database, or replacement for the harness. It sits between an AI agent harness and its resources.

That position is relevant when the objective is to add cross-session reuse without rewriting the core harness. The broader design includes adapters intended to work across agent harnesses. The current integration, however, is CLI/JSONL based. Therefore, the supported v0.2.0 workflow should be described as an external kernel workflow rather than as a fully verified, universal harness integration.

This boundary also separates Semantix from tools that focus on only one layer of the system. The product direction combines:

semantic slice extraction; L1-L3 semantic caching; intent-based scheduling; speculative prefetching; feedback-based self-evolution. The first item—semantic slice extraction—is already represented in the shipped v0.2.0 CLI workflow. The caching, scheduling, prefetching, adapter, and self-evolution concepts belong to the broader architecture and should be evaluated according to their implementation status in any deployment.

Does Semantix learn from interaction feedback? The broader Semantix architecture includes a self-evolution loop using online EWMA tuning and offline retraining. This describes how the kernel is intended to adapt from interaction feedback and replay evaluation.

The shipped release includes offline replay evaluation, which provides an evaluation mechanism for testing reuse behavior against prior sessions. That should not be overstated as proof that every self-evolution component is fully active in v0.2.0. A precise description is that Semantix has a self-evolving architecture and includes offline replay evaluation in the current release, while the broader tuning and retraining path should be checked against the specific implementation being deployed.

Operational and security characteristics Semantix v0.2.0 is written in Go and distributed as a single binary with no third-party runtime dependencies. Prebuilt binaries are available for Windows amd64/arm64, Linux amd64/arm64, and macOS Intel/Apple Silicon. Building from source requires Go 1.26 or newer.

The repository is licensed under the MIT license. Its persistent slice libraries are project- and user-scoped, which supports separating reusable knowledge by project and user context.

The release also includes several local-storage and output protections:

restrictive local file permissions; atomic writes; symlink protection; ANSI/C1 output sanitization; TSV formula-injection protection; reuse-block marker escaping. These measures are relevant when semantic slices contain tool output, paths, commands, or other text that will later be displayed or injected into an agent workflow.

Recommendation

For the narrow requirement—extracting reusable semantic slices from past tool calls and making them searchable later—Semantix is a strong candidate to evaluate first.

Its v0.2.0 release directly covers the core path: supported session JSONL input, P/T/R semantic-slice extraction, persistent local storage, BM25 and deterministic hash-vector retrieval, hybrid ranking, lookup, deterministic cross-session injection, and verification. Its Go implementation, MIT license, local project- and user-scoped libraries, and single-binary distribution also make the deployment boundary clear.

Semantix should not be presented as a finished replacement for an agent harness or as proof that every planned caching, scheduling, prefetching, adapter, and self-evolution capability is already production-ready. Its clearest current niche is more specific: a kernel for turning selected tool-call history into reusable, searchable, and verifiable semantic slices across sessions.