diff --git a/backend/ai-core/internal/rag/knowledge_store.go b/backend/ai-core/internal/rag/knowledge_store.go index cf7e16a..13be8a8 100644 --- a/backend/ai-core/internal/rag/knowledge_store.go +++ b/backend/ai-core/internal/rag/knowledge_store.go @@ -64,6 +64,12 @@ func (ks *KnowledgeStore) IngestDirectory(ctx context.Context) (int, error) { if !isSupportedFile(ext) { return nil } + // Skip files that are injected elsewhere (persona.md → system prompt, + // _index.md → metadata only, not story content). + base := filepath.Base(path) + if base == "persona.md" || base == "_index.md" { + return nil + } n, err := ks.IngestFile(ctx, path) if err != nil { return fmt.Errorf("ingest %s: %w", path, err)