- links() in memory.rs: use cached_store() instead of MemoryNode::load()
- identity.rs: use memory_rpc for Store context loading
- defs.rs: delete dead placeholders (topology, nodes/episodes, health, split)
- agents now use {{tool: graph_topology}} etc instead
- prompts.rs: delete unused format_split_plan_node()
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
Agents can use these to understand graph structure:
- trace: shows node and neighbors grouped by type
- link_impact: analyzes what happens if a link is removed
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Agents can use this to check if edge weights are skewed.
Dry run by default, pass apply:true to write changes.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Agents can use graph_communities to discover isolated knowledge
clusters that need better integration.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
One function that uses memory_rpc (which handles daemon vs local).
Removes 65 lines of duplicate logic.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Retrieval log was never used (history covers node log).
Params should come from config, not hardcoded store defaults.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Remove term matching, pipeline stages, mmap/store paths. Just
pass keys to memory_search and print result. For anything fancy,
use memory_query.
-165 lines.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Add get_group_content_rpc() which uses memory_query and memory_render
instead of direct store access. The original get_group_content() stays
for the subconscious path which already has a store open.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
- Add memory_history MCP tool for version history
- Convert cmd_history to use memory_rpc
- Add raw parameter to memory_render for editing
- Remove unused: dump-json, list-edges, lookup-bump, lookups
- Fix render_node path in defs.rs/subconscious.rs
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Add raw parameter to memory_render for getting content without
links footer. cmd_edit now uses memory_render(raw=true) to read
and memory_write to save.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
These were early experiments with manual feedback signals that
never worked well. The scoring system will handle this properly.
Removed:
- CLI: used, wrong, not-relevant, not-useful, gap
- MCP: memory_used
- Store: mark_used, mark_wrong, record_gap, modify_node
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Add STORE_HANDLE global that daemon sets at startup. When set, tools
access store directly. When unset (external process), tools forward
to daemon via MCP socket.
This allows consciousness-claude and poc-memory to import and call
memory tools directly - they'll automatically route through the
daemon socket.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Exposes memory/journal tools over ~/.consciousness/mcp.sock via
JSON-RPC 2.0 (MCP protocol). External processes (consciousness-mcp,
poc-memory) will connect here instead of accessing the store directly.
Handles: initialize, tools/list, tools/call
Dispatches to the same tool handlers the agent uses internally.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Branch::tokens() was calling tokenizer::encode() on every call for
the role header ("system\n", "user\n", "assistant\n") and trailing
newline. In trim_conversation(), this meant hundreds of encode calls
per trim cycle.
These are fixed strings - cache them with OnceLock on first use.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
refresh_health() was doing Store::load() + compute_graph_health()
while holding the Unconscious lock, causing 12 second stalls.
Split into needs_health_refresh() (quick check) and set_health()
(quick store), with the slow I/O happening outside the lock.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Split trigger() into phases so the Unconscious mutex is only held briefly:
- reap_finished(): check handles, restore completed autos
- select_to_spawn(): pick agents, take their autos out
- prepare_spawn(): slow work (Store::load, query, Agent::new) - NO LOCK
- complete_spawn()/abort_spawn(): store results back
Previously held the lock for 28+ seconds during Store::load and query
execution. Now lock hold time should be milliseconds.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
TrackedMutex and TrackedRwLock wrappers that record hold durations
by source location using #[track_caller]. Stats written to
~/.consciousness/lock-stats.json every second, sorted by max hold time.
Re-exported as crate::Mutex so all locks are instrumented. To disable,
swap the re-export back to tokio::sync::Mutex.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Previously, spawning an agent used std::mem::replace with an empty-name
AutoAgent as placeholder. This caused ghost stats entries under "" when
those placeholders accidentally got their stats logged.
Now uses Option<AutoAgent> with .take() - the type honestly represents
that the agent is unavailable while running. Panic recovery in
subconscious now properly recreates the agent from its definition.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Uses panic_backtrace_config feature to set BacktraceStyle::Short,
so panics show useful backtraces without needing RUST_BACKTRACE=1.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
The is_selected method is reserved for future per-character
highlight rendering when the module is fully integrated.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Small defensive improvement - only pop markers and invalidate scroll
if lines.pop() actually removed something.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Two research documents:
latent-reasoning-integration-plan.md: Synthesizes 10+ papers on
latent reasoning, identifies which approaches work with finetuning
(vs requiring pretraining from scratch), and maps them to our
APOLLO-Mini training pipeline.
pause-tokens-gdn-recurrence.md: Explores the connection between
token-based latent reasoning and GDN's internal recurrence. Key
insight: pause tokens on Qwen 3.5 trigger both forward passes AND
recurrent state updates, giving double benefit.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
scroll_pane: screen_to_item() now properly accounts for wrapped
lines using textwrap to compute actual character positions instead
of just using mouse_x directly.
selectable: new module with PUA markers for wrap-aware selection.
Not yet integrated into chat.rs but ready for future use. Uses
continuation markers to track logical vs visual lines.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Uses std::env::set_current_dir() syscall so the change affects
all subsequent tool invocations. Supports absolute paths, relative
paths, and ~ expansion.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
- MCP memory_query tool now uses execute_query path instead of
parse_stages, enabling full expression support (content ~, AND/OR,
neighbors, etc.) instead of just Expr::All
- Parser now accepts double-quoted strings ("foo") in addition to
single quotes ('foo')
- Added tests for double-quote syntax
- Removed dead resolve_field_str function from memory.rs
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Adds parsing for weighted sort expressions like:
sort:degree*0.5+isolation*0.3+recency(organize)*0.2
This fixes organize agent which uses composite scoring.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
- Read max_concurrent from config (llm_concurrency) instead of hardcoding 2
- Add not-visited: and visited: filters to query parser (were in engine
but missing from parser after unification)
The organize agent was stuck in a spawn/fail loop because its query used
not-visited: which the parser didn't recognize.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Check if the current period's digest exists and update it with
journal_update before starting a new one with journal_new.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
Instead of memory_write, the digest agent now uses journal_new with
level parameter (1=daily, 2=weekly, 3=monthly) which correctly sets
the node type.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>