Files
coyote/docs/restful-api/testing/plans/12-rag.md
T

1.7 KiB

Test Plan: RAG

Behaviors to test

  • Rag::init creates new RAG with embedding model (requires LLM client)
  • Rag::load loads existing RAG from disk (requires filesystem)
  • Rag::create builds vector store from documents (requires embedding model)
  • Rag::refresh_document_paths updates document list (requires filesystem)
  • RAG search returns relevant embeddings (requires embedding model)
  • RAG template contains required placeholders
  • Reranker model applied when configured (requires LLM client)
  • top_k controls number of results (requires embedding model)
  • RAG sources tracked for .sources command (requires full Rag struct)
  • exit_rag clears RAG from context (tested in iteration 8)

Additional behaviors tested

  • DocumentId: new/split round-trip, zero/zero, large values
  • DocumentId: Debug format ("file-doc"), equality, inequality, ordering
  • RagDocument: new with content, default empty
  • RagData: new sets all defaults, empty collections
  • RagData::get: returns document, None for missing file, None for missing doc index
  • RagData::del: removes files + associated vectors, noop for nonexistent
  • RagData::add: inserts files, vectors, updates next_file_id
  • RagData::build_bm25: empty data returns no results
  • RagData::build_bm25: finds documents by keyword (BM25 ranking)
  • RAG_TEMPLATE: contains CONTEXT, SOURCES, INPUT
  • get_separators: Rust/Python/Markdown return language-specific
  • get_separators: unknown extension returns defaults
  • get_separators: all 22 known extensions have language-specific separators

Old code reference

  • src/rag/mod.rs — Rag struct and methods
  • src/config/request_context.rs — use_rag, edit_rag_docs, rebuild_rag