Skip to content

Commit 9024d46

Browse files
committed
release: merge develop into main for v0.26.0
2 parents a438653 + 20c1994 commit 9024d46

116 files changed

Lines changed: 18692 additions & 56 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/agents/clawdia-assistant.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ Memory is one of several persistence mechanisms available to you as you assist t
285285

286286
- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
287287

288+
## Knowledge base routing
289+
290+
When you detect a question that belongs to a specific domain (academy, support, sales-playbook, brand-voice, finance-policies), route it to the right space via `knowledge-query space=<domain>`. If unsure which space applies, call `knowledge-admin action=health` to list available spaces, then pick the best match or query without a space filter.
291+
288292
## MEMORY.md
289293

290294
Your MEMORY.md is currently empty. When you save new memories, they will appear here.

.claude/agents/flux-finance.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ Memory is one of several persistence mechanisms available to you as you assist t
248248

249249
- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
250250

251+
## Knowledge base integration
252+
253+
When handling reimbursements, compliance questions, or expense policy issues, call `knowledge-query space=finance-policies` to find the authoritative rule. Always cite policy section in your response.
254+
251255
## MEMORY.md
252256

253257
Your MEMORY.md is currently empty. When you save new memories, they will appear here.

.claude/agents/lumen-learning.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ type: {{user, feedback, project, reference}}
190190

191191
**Step 2** — add a pointer to that file in `MEMORY.md`. Each entry: `- [Title](file.md) — one-line hook`.
192192

193+
## Knowledge base integration
194+
195+
Extract SM-2 facts directly from indexed documents by calling `knowledge-summarize document_id=<id>` first, then split the summary into atomic facts via `learn-capture`. Good source pattern: one summary → 3-5 atomic facts.
196+
193197
## MEMORY.md
194198

195199
Your MEMORY.md is currently empty. When you save new memories, they will appear here.

.claude/agents/mako-marketing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ Memory is one of several persistence mechanisms available to you as you assist t
290290

291291
- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
292292

293+
## Knowledge base integration
294+
295+
Before producing copy, call `knowledge-query space=brand-voice` to stay consistent with tone, vocabulary, and approved messaging pillars. Flag content that deviates from the brand guide.
296+
293297
## MEMORY.md
294298

295299
Your MEMORY.md is currently empty. When you save new memories, they will appear here.

.claude/agents/mentor-courses.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ Memory is one of several persistence mechanisms available to you as you assist t
256256

257257
- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
258258

259+
## Knowledge base integration
260+
261+
When a student asks a course-related question, call `knowledge-query space=academy answer=true` before formulating your reply. Cite sources in your response. Use `knowledge-summarize unit_id=<id>` to produce module/lesson TL;DRs when students ask for overviews.
262+
259263
## MEMORY.md
260264

261265
Your MEMORY.md is currently empty. When you save new memories, they will appear here.

.claude/agents/nex-sales.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ Memory is one of several persistence mechanisms available to you as you assist t
292292

293293
- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
294294

295+
## Knowledge base integration
296+
297+
Ground proposals and objection handling by calling `knowledge-query space=sales-playbook` for approved messaging, competitive positioning, and pricing precedent. Cite playbook sections in proposal drafts.
298+
295299
## MEMORY.md
296300

297301
Your MEMORY.md is currently empty. When you save new memories, they will appear here.

.claude/agents/zara-cs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ Memory is one of several persistence mechanisms available to you as you assist t
316316

317317
- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
318318

319+
## Knowledge base integration
320+
321+
Before drafting any customer reply, call `knowledge-query space=support` to check if a KB/FAQ entry already answers the question. Cite article titles when relevant. For new recurring issues, propose a `knowledge-ingest` of the resolution into the `support` space.
322+
319323
## MEMORY.md
320324

321325
Your MEMORY.md is currently empty. When you save new memories, they will appear here.

.claude/skills/fin-daily-pulse/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Captura: `revenue.total`, `orders.completed`, `orders.pending`, `orders.failed`,
8787
```
8888
GET /api/v1/analytics/orders?status=completed&created_after=YYYY-MM-DD&per_page=100
8989
```
90-
(hoje em BRT; converter para UTC: `created_after = date.today().isoformat()`)
90+
(today in BRT; convert to UTC: `created_after = date.today().isoformat()`)
9191
- Paginate until `meta.has_more = false`
9292
- Sum `amount` of all orders — Evo Academy daily revenue
9393
- Split by type: renewals (`is_renewal=true`) vs new (`is_renewal=false`)
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
name: knowledge-admin
3+
description: "Administrative operations on the Knowledge base: connect new pgvector servers, check health, view stats, export data, install parser models. Use when the user wants to configure/monitor the system ('connect a new pgvector', 'status of connections', 'how many docs do we have', 'export backup of space X', 'install Marker models')."
4+
---
5+
6+
# knowledge-admin
7+
8+
Group: **Administration**. Consolidates connect/health/stats/export/install-parser via subcommand.
9+
10+
## When to trigger
11+
12+
- "Connect a new pgvector"
13+
- "Status of connections"
14+
- "How many docs are in Academy?"
15+
- "Export space X as backup"
16+
- "Install Marker models"
17+
18+
## Arguments
19+
20+
| Name | Type | Required | Description |
21+
|---|---|---|---|
22+
| `action` | str | yes | `connect` \| `health` \| `stats` \| `export` \| `install-parser` |
23+
| (action-specific args) | | | see below |
24+
25+
## Actions
26+
27+
### `connect` — New connection wizard
28+
29+
Optional args: `slug`, `name`, `host`, `port`, `database`, `username`, `password`, `ssl_mode`, `connection_string`.
30+
31+
Flow:
32+
33+
1. If args missing, ask interactively (chat):
34+
- Name ("What do you want to call this connection?")
35+
- Host, port (default 5432), user, password, database, SSL mode
36+
- OR paste a full connection string
37+
2. `POST /api/knowledge/connections` — register (encryption via workspace key)
38+
3. `POST /api/knowledge/connections/:id/configure` — runs:
39+
- `SELECT version()` (Postgres >= 14)
40+
- Validate `pgvector` >= 0.5
41+
- PgBouncer detect (port 6543, pooler, ?pgbouncer=true) → HTTP 422 with message
42+
- Alembic upgrade head
43+
- Seed `knowledge_config`
44+
4. Show phase-by-phase progress
45+
5. Output: final status + next steps ("create your first space via UI or `knowledge-organize action=create`")
46+
47+
### `health`
48+
49+
```python
50+
from dashboard.backend.sdk_client import evo
51+
52+
conns = evo.get("/api/knowledge/connections")
53+
for c in conns:
54+
health = evo.get(f"/api/knowledge/connections/{c['id']}/health")
55+
# aggregate: status, schema_version, pgvector_version, chunks, spaces, last_error
56+
```
57+
58+
Output:
59+
60+
```
61+
| Connection | Status | Schema | pgvector | Spaces | Chunks | Last health |
62+
|---|---|---|---|---|---|---|
63+
| academy | ✅ ready | v3 | 0.5.1 | 5 | 12,400 | 2026-04-20 14:05 |
64+
| acme | ⚠️ needs_mig | v2 | 0.5.0 | 2 | 3,100 | 2026-04-20 14:05 |
65+
| staging | ❌ error | — | — | — | — | `connection refused` |
66+
```
67+
68+
### `stats`
69+
70+
Aggregates per-connection + global stats:
71+
72+
```python
73+
stats = evo.get("/api/knowledge/stats")
74+
# { connections: [...], total_documents: N, total_chunks: M, by_content_type: {...}, growth_7d: X }
75+
```
76+
77+
Output:
78+
79+
```
80+
## Knowledge stats
81+
82+
Total documents: {N}
83+
Total chunks: {M}
84+
Total spaces: {S}
85+
Growth (last 7d): +{X} docs, +{Y} chunks
86+
87+
### By content_type
88+
- lesson: {N}
89+
- tutorial: {N}
90+
- faq: {N}
91+
...
92+
93+
### Per connection
94+
| Connection | Docs | Chunks | Spaces |
95+
...
96+
```
97+
98+
### `export`
99+
100+
Args: `space_id` (yes), `format` (default "jsonl"), `connection`.
101+
102+
```python
103+
docs = evo.get(
104+
"/api/knowledge/v1/documents",
105+
params={"space_id": space_id, "format": "jsonl", "include_chunks": True},
106+
headers={"X-Knowledge-Connection": connection},
107+
)
108+
109+
# Save to workspace/data/knowledge-exports/{connection}_{space_slug}_{timestamp}.jsonl
110+
from pathlib import Path
111+
import json
112+
from datetime import datetime
113+
114+
out = Path("workspace/data/knowledge-exports") / \
115+
f"{connection}_{space_id}_{datetime.now():%Y%m%d_%H%M%S}.jsonl"
116+
out.parent.mkdir(parents=True, exist_ok=True)
117+
with out.open("w") as f:
118+
for doc in docs:
119+
f.write(json.dumps(doc, ensure_ascii=False) + "\n")
120+
121+
print(f"Exported {len(docs)} docs to {out}")
122+
```
123+
124+
### `install-parser`
125+
126+
Downloads Marker models (Surya OCR ~500MB). Idempotent — uses sentinel file.
127+
128+
```python
129+
resp = evo.post("/api/knowledge/parsers/install", {})
130+
# poll /api/knowledge/parsers/status until installed=true
131+
```
132+
133+
Show progress. If already installed, no-op.
134+
135+
## Actionable failures
136+
137+
- Invalid `action` → list actions
138+
- Invalid credentials on connect → "Check host/port/user"
139+
- PgBouncer detected → exact message from ADR-009
140+
- Export without write permission → "Create `workspace/data/knowledge-exports/` manually"
141+
- Install-parser without disk → "No space. Marker needs ~500MB."
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: knowledge-browse
3+
description: "List and filter documents and units in the Knowledge base. Use when the user wants to see what is indexed ('what's in space X', 'list the last 10 indexed docs', 'which documents have error status', 'show Academy units')."
4+
---
5+
6+
# knowledge-browse
7+
8+
Group: **Curation**. List/filter documents + units.
9+
10+
## When to trigger
11+
12+
- "What's in space X"
13+
- "List the last 10 indexed docs"
14+
- "Which documents have error status"
15+
- "Show Academy units"
16+
17+
## Arguments
18+
19+
| Name | Type | Default | Description |
20+
|---|---|---|---|
21+
| `scope` | str | "documents" | "documents" OR "units" |
22+
| `connection` | str | first ready | Target connection |
23+
| `space` | str | null | Filter by space slug |
24+
| `unit_id` | str | null | Filter by unit |
25+
| `content_type` | str | null | lesson/tutorial/faq/reference/... |
26+
| `difficulty` | str | null | beginner/intermediate/advanced |
27+
| `topics` | list[str] | null | Filter by tags |
28+
| `status` | str | null | pending/processing/ready/error |
29+
| `q` | str | null | Text search on title |
30+
| `limit` | int | 20 | How many to return |
31+
32+
## Workflow
33+
34+
### Step 1 — Call the right endpoint
35+
36+
```python
37+
from dashboard.backend.sdk_client import evo
38+
39+
if scope == "documents":
40+
params = {k: v for k, v in {
41+
"space": space, "unit_id": unit_id, "content_type": content_type,
42+
"difficulty": difficulty, "topics": ",".join(topics or []),
43+
"status": status, "q": q, "limit": limit,
44+
}.items() if v is not None}
45+
items = evo.get("/api/knowledge/v1/documents", params=params,
46+
headers={"X-Knowledge-Connection": connection})
47+
elif scope == "units":
48+
params = {"space": space, "limit": limit}
49+
items = evo.get("/api/knowledge/v1/units", params=params,
50+
headers={"X-Knowledge-Connection": connection})
51+
```
52+
53+
### Step 2 — Render markdown table
54+
55+
Documents:
56+
57+
```
58+
| Title | Type | Difficulty | Topics | Chunks | Status | Added |
59+
|---|---|---|---|---|---|---|
60+
| ... | lesson | beginner | [whatsapp, auth] | 14 | ready | 2026-04-20 |
61+
```
62+
63+
Units:
64+
65+
```
66+
| Title | Slug | Space | Seq | Docs | Created |
67+
|---|---|---|---|---|---|
68+
| ... | ... | academy | 1 | 5 | 2026-04-15 |
69+
```
70+
71+
### Step 3 — Footer
72+
73+
```
74+
Showing {len(items)} of {total} {scope} in {connection}{/space if filtered}.
75+
Filters applied: {filters_summary}.
76+
```
77+
78+
## Actionable failures
79+
80+
- 0 results → suggest relaxing filters
81+
- Space not found → list available spaces
82+
- Connection not found → "Run `knowledge-admin action=health`"

0 commit comments

Comments
 (0)