Skip to content

docs: chunk-level search PRDs + entity-spec consolidation + PDF-agent tutorial - #249

Merged
arantespp merged 5 commits into
mainfrom
claude/awesome-gauss-8kmhiq
Jun 24, 2026
Merged

docs: chunk-level search PRDs + entity-spec consolidation + PDF-agent tutorial#249
arantespp merged 5 commits into
mainfrom
claude/awesome-gauss-8kmhiq

Conversation

@arantespp

@arantespp arantespp commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

Docs-only PR with three related pieces of work around the Knowledge/Documents/Memory feature area.

1. Chunk-level document search (issue #244 / PR #245)

prd-knowledge.md previously described document search as document-level via mapRawDocument() reading file content from disk — that path no longer exists.

  • Status table, Phase 1 note, response example, Implementation Architecture (mapChunkResult() + DocumentChunk → Document → File → Project join), and Data Model now reflect chunk-level search (DocumentChunk.embedding, chunk_id + page).

2. Single source of truth for knowledge_config + entity-query spec

The two PRDs duplicated "Knowledge Config", "Three Retrieval Paths", "Merge Behavior", and the entity-query parameters — and had drifted (actor_id vs actor_ids, entity_types/relationship/direction present in one but not the other).

  • knowledge PRD now holds the canonical KnowledgeConfig schema and remains owner of the entity-query surface (Phase 3).
  • memory PRD reduces its copies to links; keeps only memory-owned fields (write_memory_id, extraction) and the memory-side data layer (resolveEntitySearch()).

Plus verified factual fixes: VECTOR(1536)VECTOR(EMBEDDING_DIMENSIONS); write_memory takes { content } only; added memories:ListEntityEntries permission; fixed Phase 5 heading nesting; noted stale-link cleanup on entry update.

3. New tutorial — "Agent over a Library of PDFs"

packages/website/docs/tutorials/agent-with-pdfs.md validates the PDF-agent build plan end-to-end:

  • A. Ingest two PDFs into chunked/embedded Documents under /manuals/ (page vs size chunking).
  • B. Scope an agent with one knowledge_config prefix.
  • C. Retrieve automatically (injection) and via an explicit search-knowledge query.
  • D. Cite answers down to document_id + page.

Two real single-page PDFs are embedded as base64 — validated with unpdf (the server's own parser) — with short facts so a small local model (qwen2.5:0.5b) answers reliably from injected context. CLI / SDK / curl tabs.

Gated in tests/.tutorialsignore until #245 (POST /documents/ingest) is merged. Remove that line once the server supports ingestion so the tutorial runs end-to-end in CI.

Not included (need a decision, raised in review)

  • Resilience policy mismatch: MemoryEntry.embedding is NOT NULL (hard-fail) while DocumentChunk.embedding is nullable/non-fatal.
  • Context-injection label uses [Memory: <id>] in code vs [Memory: <name>] in the PRDs — a code bug, out of scope for a docs PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF

Update prd-knowledge.md to match the DocumentChunk model from issue #244 /
PR #245: document search now runs against DocumentChunk.embedding (not
Document), results carry chunk_id + page, and mapRawDocument's disk-read
path is replaced by mapChunkResult. Updates the status table, Phase 1
note, response example, implementation architecture, and data model.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF
@github-actions

Copy link
Copy Markdown

Deploy Outputs

Package Stack Output Key Output Value
@soat/website SoatWebsite-claude-awesome-gauss-8kmhiq BucketWebsiteURL http://soatwebsite-claude-awesome-gauss-8kmh-staticbucket-mqg6do9gcmci.s3-website-us-east-1.amazonaws.com

…c + knowledge_config

Make prd-knowledge.md authoritative for the knowledge_config shape and the
entity-based query surface; reduce prd-memories.md's duplicated copies to
links so the two PRDs stop drifting.

knowledge PRD:
- Add canonical KnowledgeConfig schema (all read-scope + write-side fields)
  under Knowledge Config, marked as the single source of truth.

memories PRD (consolidation):
- Knowledge Config / Three Retrieval Paths / Merge Behavior → link to
  knowledge PRD; keep only memory-owned fields (write_memory_id, extraction).
- Phase 5c entity-query params → link to knowledge PRD Phase 3.
- Stale KnowledgeConfig TS interface → link to canonical schema.

memories PRD (verified factual fixes):
- VECTOR(1536) → VECTOR(EMBEDDING_DIMENSIONS) on MemoryEntry + MemoryEntity
  (matches the models; embeddings are env-dimensioned, not 1536).
- write_memory tool takes { content } only (target bound from write_memory_id),
  correcting the { content, memoryId } example.
- Add memories:ListEntityEntries permission for GET /entities/:id/entries.
- Fix malformed Phase 5 heading nesting (5a/5b/dedup/5c now sub-sections).
- Note stale MemoryEntryEntity links must be cleared on entry update.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF
@arantespp arantespp changed the title docs(knowledge): reflect chunk-level document search (DocumentChunk) docs(knowledge,memories): chunk-level search + consolidate entity-query spec Jun 24, 2026
End-to-end tutorial validating the PDF-agent build plan: upload PDFs →
ingest into chunked/embedded Documents under a path prefix → scope an agent
with knowledge_config → retrieve automatically and via search-knowledge →
cite document_id + page.

- Two real, tiny single-page PDFs embedded as base64 (validated with unpdf,
  the server's parser) with short facts so a small local model (qwen2.5:0.5b)
  answers reliably from injected context.
- Covers page vs size chunk strategies, chunk-level citations, and both
  retrieval modes. CLI / SDK / curl tabs.
- Gated in .tutorialsignore until #245 (POST /documents/ingest) is merged;
  remove that line once the server supports ingestion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF
@arantespp arantespp changed the title docs(knowledge,memories): chunk-level search + consolidate entity-query spec docs: chunk-level search PRDs + entity-spec consolidation + PDF-agent tutorial Jun 24, 2026
claude added 2 commits June 24, 2026 08:16
Remove agent-with-pdfs from .tutorialsignore. POST /documents/ingest and the
DocumentChunk model are now on main, so the tutorial runs end-to-end in CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF
@arantespp
arantespp merged commit cfaf0f0 into main Jun 24, 2026
6 of 8 checks passed
@arantespp
arantespp deleted the claude/awesome-gauss-8kmhiq branch June 24, 2026 08:44
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.

2 participants