feat(context-lake): org-wide context lake for agent retrieval - #2
Open
ZaltaClaw wants to merge 2 commits into
Open
feat(context-lake): org-wide context lake for agent retrieval#2ZaltaClaw wants to merge 2 commits into
ZaltaClaw wants to merge 2 commits into
Conversation
- Schema (migrations/003_context_lake.sql): sources, documents, bindings, tags. - Lib (src/lib/context-lake.ts): types, SourceAdapter registry, rankDocuments(), queryLake(), DB row mappers. - Seed (src/lib/seed-context-lake.ts) + 7 markdown docs under data/context-lake/. - API: GET /documents (filter), GET/PATCH/DELETE /documents/[id], POST /query, GET/POST /sources. - Pages: /context-lake (browse + Query Playground), /context-lake/documents/[id] (view/edit/delete), /context-lake/sources (admin). - Sidebar: 'Context Lake' nav entry under Build group. - 7 components in src/components/context-lake/ from prior pass kept in place (unused by current pages; available for future composition).
…docs - Align context-lake page with design system CSS vars throughout - Fix source-card unused Layers import causing lint noise - Switch sidebar Context Lake nav icon to Layers - Add Context Lake section to README with architecture, real-vs-stub table, follow-up plan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Concept
Context Lake is a data lake for company knowledge — a queryable, org-wide store of unstructured and structured context (ADRs, decision logs, customer notes, glossary, code conventions, sales playbooks, security policies) that any agent in Frontier can retrieve from at runtime.
Architecture
What's real vs. stubbed
data/context-lake/)New files
API
src/app/api/context-lake/sources/route.ts— GET (list) + POST (add source)src/app/api/context-lake/documents/route.ts— GET with optional?domain=filtersrc/app/api/context-lake/documents/[id]/route.ts— GET single documentsrc/app/api/context-lake/query/route.ts— POST{query, domains?, limit?}→ ranked chunksPages
src/app/context-lake/page.tsx— main 3-tab page (Sources / Documents / Bindings)src/app/context-lake/sources/page.tsx— sources deep-divesrc/app/context-lake/documents/[id]/page.tsx— document detailComponents (
src/components/context-lake/)source-card.tsx— source type, status badge, doc count, last syncconnect-source-wizard.tsx— 3-step modal: pick type → fill credentials → confirmdocument-row.tsx— table row with domain badge + freshness indicatordocument-detail.tsx— slide-out panel with full metadata + contentdomain-filter.tsx— toggle row for all 6 domains (sales / engineering / product / customer / legal / other)freshness-indicator.tsx— live (green) vs snapshot (orange) badgequery-playground.tsx— text input + domain filter → ranked results with score barsLib / Types
src/lib/context-lake.ts— adapter interface, FileUploadAdapter, 4 stub adapters, keyword rankersrc/lib/seed-context-lake.ts— seed document loader (readsdata/context-lake/*.json)src/types/context-lake.ts—ContextDocument,ContextSource,ContextChunk,ContextBinding, domain/freshness enumsSeed data (
data/context-lake/)Six example documents spanning all domains: ADR, security policy, PRD, sales playbook, on-call runbook, glossary.
Navigation
LayersiconFollow-up plan
Acceptance checklist
npm run lint— no errors in context-lake files (pre-existing warnings elsewhere unchanged)npm run build— compiled successfully,/context-lakebuilds as static page🤖 Generated with Claude Code