Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b36fb12
spec(0001-org-memory-ai-knowledge-base): create task specifications
pasilastbot Mar 26, 2026
1c7f1cc
feat(org-memory): scaffold plugin with manifest, build system, and en…
pasilastbot Mar 26, 2026
941a3fd
feat(org-memory): add configuration management and plugin lifecycle
pasilastbot Mar 26, 2026
c09de21
feat(store): add database schema and knowledge store for org-memory p…
pasilastbot Mar 26, 2026
e078b08
feat(gemini): add Gemini client with circuit breaker and rate limiter
pasilastbot Mar 26, 2026
8b27b73
feat(org-memory): implement chunking engine for semantic text splitting
pasilastbot Mar 26, 2026
d8de823
feat(org-memory): implement event ingestion hooks for step 006
pasilastbot Mar 26, 2026
53a62b9
feat(org-memory): implement processing worker for embedding and extra…
pasilastbot Mar 26, 2026
3361563
feat(debounce): implement thread debounce and summarization handler
pasilastbot Mar 26, 2026
41624fe
feat(org-memory): implement RAG query engine with permission filtering
pasilastbot Mar 27, 2026
7aa2db2
feat(org-memory): add HTTP API router and slash command handler
pasilastbot Mar 27, 2026
9d85f0b
feat(org-memory): add channel summary generation worker
pasilastbot Mar 27, 2026
3d92948
feat(org-memory): add outbound webhook dispatcher for extraction events
pasilastbot Mar 27, 2026
8ec4004
feat(retention): implement RunDataRetention hook for lifecycle cleanup
pasilastbot Mar 27, 2026
0f69e7e
feat(metrics): add Prometheus metrics collector and ServeMetrics hook
pasilastbot Mar 27, 2026
e99b120
feat(webapp): add RHS panel with query interface for org-memory plugin
pasilastbot Mar 27, 2026
bbaf0eb
feat(webapp): add multi-turn conversation and WebSocket event handling
pasilastbot Mar 27, 2026
96736df
feat(backfill): implement historical backfill system for retroactive …
pasilastbot Mar 27, 2026
806fc6c
test(org-memory): add comprehensive server-side unit and integration …
pasilastbot Mar 27, 2026
5da4845
test(org-memory): add browser and E2E tests for webapp plugin
pasilastbot Mar 27, 2026
f89e9ba
refactor: boy scout cleanup of org-memory E2E test helpers
pasilastbot Mar 27, 2026
7bea741
fix(lint): exclude test files from plugin webapp tsconfig type checking
pasilastbot Mar 27, 2026
781f5b1
fix(webapp): add X-CSRF-Token header to plugin API requests
pasilastbot Mar 27, 2026
f3feddc
docs(agent-memory): update e2e test learnings with CSRF fix and explo…
pasilastbot Mar 27, 2026
3ca0884
docs: add screenshots for plugin config and CSRF fix verification
pasilastbot Mar 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions agent-memories/org-memory-chunking-engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Org-Memory Chunking Engine (Step 005)

## File Location
- `server/plugins/org-memory/server/chunker.go` — main implementation
- `server/plugins/org-memory/server/chunker_test.go` — comprehensive tests

## Key Types
- `ChunkResult` — contains Text, Index (0-based), StartByte, EndByte
- `ChunkConfig` — TargetChunkTokens, OverlapPercent, MaxChunks, Logger
- `segment` — internal type for pipeline processing with byte offsets

## Constants
- `DefaultTargetChunkTokens = 500` (~2000 chars)
- `DefaultOverlapPercent = 10`
- `DefaultMaxChunksPerPost = 32`
- `runesPerToken = 4` (heuristic: 1 token ≈ 4 runes)

## Public API
- `ChunkText(text string, config ChunkConfig) []ChunkResult` — main entry point, pure function
- `EstimateTokens(text string) int` — rune-based token count approximation

## Algorithm Pipeline
1. Strip markdown (regex-based, no goldmark dependency)
2. Split at paragraph boundaries (double newlines)
3. Split oversized paragraphs at sentence boundaries
4. Merge small segments up to target size
5. Add 10% overlap between adjacent chunks (word-boundary-aware)
6. Truncate to MaxChunks with logging
7. Assign sequential 0-based indices

## Important Notes
- The plugin does NOT use goldmark — markdown stripping is regex-based
- Code blocks (indented content) are treated as atomic segments, never sentence-split
- Sentence boundary: `[.!?]\s+[A-Z\p{Lu}]` — splits on "Dr. Smith" but not "e.g. test"
- The function is source-agnostic — accepts any text, caller determines SourceType
- All text processing uses rune counts, not byte counts (Unicode-aware)
Loading