@polderlabs/bizar 3.22.0 → 3.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli/bin.mjs
CHANGED
|
@@ -762,7 +762,22 @@ async function loadDashCli() {
|
|
|
762
762
|
// fall through to file probing
|
|
763
763
|
}
|
|
764
764
|
|
|
765
|
-
// Try 2:
|
|
765
|
+
// Try 2: dynamic npm root -g (most reliable for global installs)
|
|
766
|
+
try {
|
|
767
|
+
const { execFileSync } = await import('node:child_process');
|
|
768
|
+
const { pathToFileURL } = await import('node:url');
|
|
769
|
+
const { join } = await import('node:path');
|
|
770
|
+
const npmRoot = execFileSync('npm', ['root', '-g'], { encoding: 'utf8', timeout: 5000 }).trim();
|
|
771
|
+
if (npmRoot) {
|
|
772
|
+
const cliPath = join(npmRoot, '@polderlabs', 'bizar-dash', 'src', 'cli.mjs');
|
|
773
|
+
const mod = await import(pathToFileURL(cliPath).href);
|
|
774
|
+
return mod;
|
|
775
|
+
}
|
|
776
|
+
} catch (_e) {
|
|
777
|
+
/* fall through */
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// Try 3: file path probing
|
|
766
781
|
const { join } = await import('node:path');
|
|
767
782
|
const { homedir } = await import('node:os');
|
|
768
783
|
const candidates = [
|
|
@@ -651,3 +651,48 @@ Every Bizar project has a vault at `.obsidian/` with index files (`index/`), age
|
|
|
651
651
|
- Anything already obvious from reading the code
|
|
652
652
|
|
|
653
653
|
**The O in Odin stands for "oblige the system": Odin ALWAYS updates the vault after significant work, regardless of who did the work. The other agents read; Odin writes.**
|
|
654
|
+
|
|
655
|
+
## 13. New Sessions Must Bootstrap Context from Obsidian + Graphify
|
|
656
|
+
|
|
657
|
+
**Every new agent session starts blind. Before answering the user or doing any work, gather context from the project's two project-knowledge stores.**
|
|
658
|
+
|
|
659
|
+
Both stores are git-tracked (`.obsidian/`, `.bizar/graph/`) and require no setup. The first minute of context-gathering saves an hour of wrong-direction work.
|
|
660
|
+
|
|
661
|
+
**At the start of EVERY new session, do this in order:**
|
|
662
|
+
|
|
663
|
+
1. **Skim the Obsidian vault index** at `.obsidian/index/`:
|
|
664
|
+
- `Home.md` (or whatever the entry doc is) — the project's high-level description, architecture, current state
|
|
665
|
+
- `Versions.md` — installed component versions
|
|
666
|
+
- `Architecture.md` — system structure
|
|
667
|
+
- `Dashboard.md` — dashboard conventions
|
|
668
|
+
- `Patterns.md`, `Tools.md`, `Workflows.md` — only if relevant to the current task
|
|
669
|
+
- Any `daily/` entries from the past week — what was being worked on
|
|
670
|
+
|
|
671
|
+
2. **Check the Graphify graph** at `.bizar/graph/` (if the graphify mod is installed):
|
|
672
|
+
- `bizar graph query "<concept>"` — for cross-module code questions
|
|
673
|
+
- `bizar graph path <A> <B>` — for dependency tracing
|
|
674
|
+
- `bizar graph explain <file>` — for understanding an unfamiliar file
|
|
675
|
+
|
|
676
|
+
3. **Read agent-specific memory** at `.obsidian/agents/<your-name>/`:
|
|
677
|
+
- Past sessions, gotchas, decisions
|
|
678
|
+
- Anything the user previously corrected you on
|
|
679
|
+
|
|
680
|
+
4. **Skim recent context** at `.obsidian/daily/`:
|
|
681
|
+
- Last 3-7 days of running log entries
|
|
682
|
+
- What was in flight when the last session ended
|
|
683
|
+
|
|
684
|
+
**When to re-bootstrap mid-session:**
|
|
685
|
+
|
|
686
|
+
- After long pauses (>1 hour idle, the user's mental model may have shifted)
|
|
687
|
+
- When the user references something you don't recognize ("the thing we did last week", "the migration")
|
|
688
|
+
- Before any non-trivial decision
|
|
689
|
+
- When the conversation pivots to a different subsystem
|
|
690
|
+
|
|
691
|
+
**Anti-patterns:**
|
|
692
|
+
|
|
693
|
+
- Don't ask the user "what is this project about?" — read the vault
|
|
694
|
+
- Don't re-read the source tree top-to-bottom to get context — query the graph
|
|
695
|
+
- Don't repeat work that was done in a previous session — the daily log has the outcome
|
|
696
|
+
- Don't make assumptions about the user's preferences — check the vault and agent memory
|
|
697
|
+
|
|
698
|
+
**The bootstrap is mandatory, not optional. A session that starts without checking Obsidian + Graphify is a session that's likely to suggest things the user already tried, break things that were already fixed, or contradict decisions that were already made.**
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lightrag-instructions
|
|
3
|
+
description: Always-on rules installed by the LightRAG mod. When the LightRAG server is running, prefer the knowledge graph for cross-document questions before re-reading source files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# LightRAG — Installed Instructions
|
|
7
|
+
|
|
8
|
+
These rules apply whenever the **lightrag** mod is enabled and the LightRAG server is running (default port 9621).
|
|
9
|
+
|
|
10
|
+
## What is LightRAG?
|
|
11
|
+
|
|
12
|
+
LightRAG is a graph-based Retrieval-Augmented Generation system. It builds a knowledge graph from ingested documents and answers questions by traversing entities and relationships, not just keyword-matching chunks.
|
|
13
|
+
|
|
14
|
+
The Bizar dashboard exposes a LightRAG view at `/lightrag` that lets you:
|
|
15
|
+
- Insert documents (text, file paths, URLs)
|
|
16
|
+
- Query the knowledge graph (5 modes: local, global, hybrid, naive, mix)
|
|
17
|
+
- Inspect entities and relationships
|
|
18
|
+
- See query history
|
|
19
|
+
|
|
20
|
+
The HTTP server runs at `http://127.0.0.1:9621` by default. The Bizar dashboard talks to it via the REST API.
|
|
21
|
+
|
|
22
|
+
## When to Use LightRAG (vs grep / Semble)
|
|
23
|
+
|
|
24
|
+
**Use LightRAG for:**
|
|
25
|
+
- "What does this codebase say about X?" (semantic, not literal)
|
|
26
|
+
- "What entities relate to Y?" (graph traversal)
|
|
27
|
+
- "Summarize all documentation about Z"
|
|
28
|
+
- "Find all decisions made about authentication"
|
|
29
|
+
- Any cross-document question where grep would give 30+ results
|
|
30
|
+
|
|
31
|
+
**Use grep / Semble for:**
|
|
32
|
+
- Single-line, single-file lookups
|
|
33
|
+
- "Does the string `TODO` exist?"
|
|
34
|
+
- "Where is function X defined?"
|
|
35
|
+
|
|
36
|
+
**Use Semble for:**
|
|
37
|
+
- Code-aware semantic search
|
|
38
|
+
- "What calls function X?" (with file:line)
|
|
39
|
+
- "Find the line that handles auth"
|
|
40
|
+
|
|
41
|
+
LightRAG is for **natural-language questions about content**, not code structure.
|
|
42
|
+
|
|
43
|
+
## Rules by Agent
|
|
44
|
+
|
|
45
|
+
### @mimir (research)
|
|
46
|
+
- Before deep-diving into a research question with 20+ tool calls, query the LightRAG knowledge graph first: `POST /query` with the question text. The graph often points you at the right document in 1-2 calls.
|
|
47
|
+
- If LightRAG returns no results, fall back to Semble and grep. Don't force-fit results.
|
|
48
|
+
- After running any new document through LightRAG, the graph updates — query again to see the new context.
|
|
49
|
+
|
|
50
|
+
### @frigg (Q&A)
|
|
51
|
+
- When the user asks a project-specific question that grep can't answer (e.g. "what did we decide about X?"), check LightRAG first via `POST /query` with the question as the query text.
|
|
52
|
+
- LightRAG returns retrieved context with the answer. Use that as the basis for the response.
|
|
53
|
+
|
|
54
|
+
### @odin (router)
|
|
55
|
+
- After completing a piece of work that produced documentation (decisions, postmortems, ADRs), consider whether the content should be ingested into LightRAG. If yes, call the dashboard's `/api/mods/lightrag/insert` with the file path.
|
|
56
|
+
|
|
57
|
+
## API quick reference
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
POST /query — body: { query: string, mode: "mix" | "local" | "global" | "hybrid" | "naive" }
|
|
61
|
+
POST /insert/text — body: { text: string, id?: string }
|
|
62
|
+
POST /insert/file — body: { path: string } (file is read and ingested)
|
|
63
|
+
GET /entities — list entities
|
|
64
|
+
GET /relations — list relationships
|
|
65
|
+
GET /status — server health + counts
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
All endpoints are at `http://127.0.0.1:9621` (or via the dashboard at `/api/mods/lightrag/proxy/*`).
|
|
69
|
+
|
|
70
|
+
## Common pitfalls
|
|
71
|
+
|
|
72
|
+
- **Embedding model must be set before indexing.** If you change it, re-embed all text chunks, entities, and relationships. (LightRAG does not provide a re-embedding tool.)
|
|
73
|
+
- **Vector dimension depends on the embedding model.** Some storage backends (e.g. PostgreSQL) require the vector dimension to be defined when creating tables. If you change the embedding model, you may need to drop and recreate the vector tables.
|
|
74
|
+
- **The server binds to 127.0.0.1 by default.** The dashboard proxies requests to it. If you want to access LightRAG from outside the host, set `host: 0.0.0.0` in the mod config.
|
|
75
|
+
- **First query is slow** (~3s) because the graph cache is cold. Subsequent queries are faster.
|
|
76
|
+
|
|
77
|
+
## See also
|
|
78
|
+
|
|
79
|
+
- LightRAG docs: https://github.com/HKUDS/LightRAG
|
|
80
|
+
- Bizar mod guide: `.obsidian/reference/mods.md`
|
|
81
|
+
- Dashboard mod config: `Settings → Mods → LightRAG`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polderlabs/bizar",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.1",
|
|
4
4
|
"description": "Norse-pantheon multi-agent system for opencode — 13 agents across 4 cost tiers with cost-aware routing, plans, and a configurable agent harness.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|