Skip to content

feat(arcan): wire lago-knowledge into agent lifecycle (BRO-604)#657

Merged
broomva merged 1 commit intomainfrom
feature/arcan-knowledge-integration
Apr 8, 2026
Merged

feat(arcan): wire lago-knowledge into agent lifecycle (BRO-604)#657
broomva merged 1 commit intomainfrom
feature/arcan-knowledge-integration

Conversation

@broomva
Copy link
Copy Markdown
Owner

@broomva broomva commented Apr 8, 2026

Summary

Three-layer integration of lago-knowledge into Arcan's agent loop. Every Life/Arcan agent becomes knowledge-aware natively — no hooks, no Python, pure Rust.

Layer 1 — Knowledge Tools (agent self-directs)

  • WikiSearchTool: hybrid BM25 + graph proximity search exposed as an agent tool
  • WikiLintTool: knowledge graph health check exposed as an agent tool

Layer 2 — Context Compiler Block (automatic injection)

  • build_knowledge_block(): assembles L0+L1 from entity pages as ContextBlock::Retrieval (~600 tokens)
  • build_index_from_dir(): builds KnowledgeIndex from local .md files with backing BlobStore

Layer 3 — Lifecycle Events (observability)

  • knowledge.indexed: emitted when index is built (note count + health score)
  • knowledge.searched: emitted on searches (query + result count + top score)

Files changed

  • arcan-lago/Cargo.toml — add lago-knowledge dependency
  • arcan-lago/src/knowledge_tools.rs (new) — WikiSearchTool, WikiLintTool
  • arcan-lago/src/knowledge_context.rs (new) — context block builder + index helper
  • arcan-lago/src/knowledge_events.rs (new) — lifecycle event constructors
  • arcan-lago/src/lib.rs — module registration + exports

Test plan

  • cargo check -p arcan-lago passes
  • cargo clippy -p arcan-lago — zero warnings
  • 146 tests pass (145 existing + 1 fixed float comparison)
  • 7 new tests (context block assembly, budget limits, event types)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added wiki search capability to query and retrieve ranked knowledge base results.
    • Added wiki linting tool to analyze knowledge base health and identify issues.
    • Added knowledge indexing functionality to build retrievable knowledge blocks from wiki directories.
    • Added event tracking for knowledge indexing and search operations.

…t, events (BRO-604)

Three-layer knowledge integration for Arcan agents:

Layer 1 — Knowledge Tools:
  - WikiSearchTool: hybrid BM25 + graph proximity search as an agent tool
  - WikiLintTool: knowledge graph health check as an agent tool

Layer 2 — Context Compiler Block:
  - build_knowledge_block(): assembles L0+L1 from entity pages as
    ContextBlock::Retrieval (~600 tokens), injected into every LLM call
  - build_index_from_dir(): builds KnowledgeIndex from local .md files

Layer 3 — Lifecycle Events:
  - knowledge.indexed: emitted when index is built, carries note count + health
  - knowledge.searched: emitted on searches, carries query + result count

Every Life/Arcan agent is now knowledge-aware natively — no hooks, no Python,
pure Rust in the agent loop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear bot commented Apr 8, 2026

@broomva broomva merged commit 860809e into main Apr 8, 2026
8 of 9 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ee365c6-707e-4563-ba76-877b048417b6

📥 Commits

Reviewing files that changed from the base of the PR and between a45b0e6 and 5d37bf9.

📒 Files selected for processing (5)
  • crates/arcan/arcan-lago/Cargo.toml
  • crates/arcan/arcan-lago/src/knowledge_context.rs
  • crates/arcan/arcan-lago/src/knowledge_events.rs
  • crates/arcan/arcan-lago/src/knowledge_tools.rs
  • crates/arcan/arcan-lago/src/lib.rs

📝 Walkthrough

Walkthrough

This PR introduces knowledge management integration into the arcan-lago crate by adding the lago-knowledge workspace dependency and implementing four new modules: knowledge context building from markdown files, knowledge lifecycle event generation, and two agent tools for wiki searching and linting with index access.

Changes

Cohort / File(s) Summary
Dependency Integration
crates/arcan/arcan-lago/Cargo.toml
Added lago-knowledge workspace dependency to extend available types and modules.
Knowledge Management Core
crates/arcan/arcan-lago/src/knowledge_context.rs, crates/arcan/arcan-lago/src/knowledge_events.rs, crates/arcan/arcan-lago/src/knowledge_tools.rs
Introduced three new modules: knowledge_context scans markdown directories and builds retrieval context blocks with knowledge indices; knowledge_events constructs event envelopes for knowledge lifecycle tracking; knowledge_tools implements WikiSearchTool (hybrid search on knowledge index) and WikiLintTool (health reporting) as arcan agent tools.
Public API Export
crates/arcan/arcan-lago/src/lib.rs
Re-exported new modules and key functions (build_knowledge_block, build_index_from_dir, WikiSearchTool, WikiLintTool) to extend crate's public interface.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 wiggles nose excitedly
From markdown files, knowledge takes flight,
Indices bloom, search tools ignite!
Wiki linted, events tracked with care,
Knowledge flows through the agent's air! 📚✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/arcan-knowledge-integration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant