Skip to main content

Module helpers

Module helpers 

Source
Expand description

Pure helper functions for context assembly.

These functions are called by assembly.rs in zeph-core (via a module alias) and by the crate::service::ContextService stubs that will be filled in during subsequent migration steps.

All functions operate on crate::state::ContextAssemblyView instead of the zeph-core-internal MemoryState, keeping this crate free of zeph-core types.

Structs§

BudgetHint
Budget state injected into the volatile system prompt section.

Constants§

CODE_CONTEXT_PREFIX
System message prefix for code-context (repo-map / file context) injections.
CORRECTIONS_PREFIX
System message prefix for past user corrections injected into context.
CROSS_SESSION_PREFIX
System message prefix for cross-session context entries.
DOCUMENT_RAG_PREFIX
System message prefix for document RAG results.
GRAPH_FACTS_PREFIX
System message prefix for graph memory facts injected into context.
LSP_NOTE_PREFIX
System message prefix for LSP context notes (diagnostics, hover data, etc.).
PERSONA_PREFIX
System message prefix for persona context injected into the system prompt.
REASONING_PREFIX
System message prefix for reasoning strategy context.
RECALL_PREFIX
System message prefix for semantic recall entries.
SESSION_DIGEST_PREFIX
User message prefix for session digest summaries from the previous interaction.
SUMMARY_PREFIX
System message prefix for session summary entries.
TRAJECTORY_PREFIX
System message prefix for trajectory (past experience) context.
TREE_MEMORY_PREFIX
System message prefix for tree-based memory summaries.

Functions§

effective_recall_timeout_ms
Return the effective spreading-activation recall timeout in milliseconds.
fetch_cross_session
Fetch cross-session context summaries for the given query and enforce the token budget.
fetch_cross_session_raw
Fetch cross-session context summaries using individual field arguments.
fetch_graph_facts
Fetch graph memory facts for the given query and inject them into the context budget.
fetch_graph_facts_raw
Fetch graph memory facts using individual field arguments.
fetch_semantic_recall
Fetch semantically recalled messages for the given query and enforce the token budget.
fetch_semantic_recall_raw
Fetch semantically recalled messages using individual field arguments.
fetch_summaries
Fetch session summaries for the current conversation and enforce the token budget.
fetch_summaries_raw
Fetch session summaries using individual field arguments.
format_correction_note
Format a user correction as a single bullet point for injection into the system prompt.
truncate_chars
Truncate s to at most max_chars Unicode scalar values.