Bid Testing Strategy Spec
Bid Testing Strategy Spec
Section titled “Bid Testing Strategy Spec”Testing plan for using real UK procurement templates with the Knowledge Hub bid management features. Covers UAT scenarios, import workflows, and validation against the existing knowledge base.
Created: 10 March 2026 Source research:
docs/reference/test-bid-resources.md
Part 1: Template Download Plan
Section titled “Part 1: Template Download Plan”Priority 1 — Core Document Types (Immediate)
Section titled “Priority 1 — Core Document Types (Immediate)”Download these first. They are free, publicly available, and cover the most common formats a UK SMB encounters.
| # | Template | Format | Storage Location | Testing Purpose |
|---|---|---|---|---|
| 1 | Standard Selection Questionnaire (PPN 03/24) | PDF (57pp) | test-data/templates/gov-sq-ppn0324.pdf | PDF question extraction, SQ response workflow |
| 2 | GOV.UK Evaluation Matrix | XLSX | test-data/templates/gov-evaluation-matrix.xlsx | XLSX handling (gap identification) |
| 3 | GDS Example ITT | test-data/templates/gds-example-itt.pdf | Full ITT extraction: requirements, timetable, criteria | |
| 4 | GOV.UK Method Statement Template | DOCX | test-data/templates/gov-method-statement.docx | DOCX upload, section extraction |
| 5 | GOV.UK Pricing Template | DOC | test-data/templates/gov-pricing-template.doc | Legacy DOC handling (convert to DOCX first) |
Priority 2 — Broader Coverage
Section titled “Priority 2 — Broader Coverage”| # | Template | Format | Storage Location | Testing Purpose |
|---|---|---|---|---|
| 6 | Charnwood ITT — Services | DOCX | test-data/templates/charnwood-itt-services.docx | Real council ITT with evaluation criteria |
| 7 | Charnwood Evaluation Scoring Matrix | XLSX | test-data/templates/charnwood-eval-matrix.xlsx | Alternative evaluation matrix format |
| 8 | Scottish Procurement Evaluation Matrix | XLSX | test-data/templates/scot-eval-matrix.xlsx | Variant spreadsheet layout |
| 9 | National TOMs Framework 2021 | test-data/templates/national-toms-2021.pdf | Social value question extraction | |
| 10 | H&S Assessment Questionnaire (Contracts Finder) | test-data/templates/hs-assessment-questionnaire.pdf | Sector-specific questionnaire extraction |
Priority 3 — Real-World Scenarios
Section titled “Priority 3 — Real-World Scenarios”| # | Template | Format | Storage Location | Testing Purpose |
|---|---|---|---|---|
| 11 | GLA London Development Panel 2 ITT | test-data/templates/gla-ldp2-itt.pdf | Real restricted procedure ITT | |
| 12 | ORR ITT and Statement of Requirement | test-data/templates/orr-itt.pdf | ITT with detailed specification | |
| 13 | 3—5 complete tender packs from Contracts Finder | Mixed | test-data/templates/contracts-finder/ | Full multi-document bid scenarios |
Storage Convention
Section titled “Storage Convention”All test templates go into test-data/templates/ at project root. This
directory should be added to .gitignore (procurement documents should not be
committed, even public ones, to keep the repository lean).
test-data/ templates/ gov-sq-ppn0324.pdf gov-evaluation-matrix.xlsx gds-example-itt.pdf gov-method-statement.docx gov-pricing-template.doc charnwood-itt-services.docx charnwood-eval-matrix.xlsx scot-eval-matrix.xlsx national-toms-2021.pdf hs-assessment-questionnaire.pdf contracts-finder/ <opportunity-name>/ itt.pdf specification.pdf pricing-schedule.xlsx terms-and-conditions.pdfPart 2: Import Workflows
Section titled “Part 2: Import Workflows”2.1 PDF Documents
Section titled “2.1 PDF Documents”Existing tools:
- Web upload (
POST /api/upload): Accepts PDF up to 50 MB. Usesunpdf(JavaScript) for text extraction. Creates acontent_itemsrecord with extracted text, stores file in Supabase Storagedocumentsbucket. - Tender upload (
POST /api/bids/:id/tender): Accepts PDF/DOCX up to 50 MB. Stores in Supabase Storagetender-documentsbucket. Validates magic bytes. Does NOT extract text — that happens in the separate extract step. - Question extraction (
POST /api/bids/:id/questions/extract): Downloads fromtender-documentsbucket, sends PDF as base64 to Claude for structured question extraction. Returns sections, questions, word limits, evaluation weights. Also attempts tender metadata extraction (buyer, deadline, reference number). - Python CLI (
scripts/extract_pdf_text.py): Usespdfplumberfor text and table extraction. Outputs JSON withtext,page_count,tables. Better table extraction thanunpdfbut requires Python environment. - Python CLI (
scripts/extract_pdf_images.py): Extracts embedded images from PDFs. Filters decorative images (<50x50), deduplicates, returns base64.
Preprocessing needed:
- None for direct upload. The tender upload + question extract pipeline handles PDF natively via Claude’s vision capability (base64 input).
- For the 57-page Standard SQ (PPN 03/24), the Claude extraction may need to
process in chunks if the document exceeds context limits. The
extractPDFQuestionsfunction sends the full base64 — monitor formaxDuration(120s) timeouts on large documents.
Entity mapping: | PDF Content | Knowledge Hub Entity |
|-------------|---------------------| | Tender document as a whole | Content
item (content_type: pdf) via /api/upload | | Tender document for a bid |
File in tender-documents bucket via /api/bids/:id/tender | | Extracted
questions | bid_questions rows via /api/bids/:id/questions/extract | |
Evaluation criteria/weights | evaluation_weight field on bid_questions | |
Tender metadata (buyer, deadline) | domain_metadata on bid workspace |
Gaps:
unpdf(used in web upload) does not extract tables. For PDFs with tabular question data (like the evaluation matrix), the Pythonpdfplumberscript gives better results but is not integrated into the web upload flow.- No XLSX support in web upload — evaluation matrix spreadsheets cannot be uploaded directly (see section 2.3).
2.2 DOCX Documents
Section titled “2.2 DOCX Documents”Existing tools:
- Web upload (
POST /api/upload): Accepts DOCX. Usesmammothfor raw text extraction. Createscontent_itemsrecord. - Tender upload (
POST /api/bids/:id/tender): Accepts DOCX. Validates magic bytes and checks for password protection viaisEncryptedDocx. - Question extraction (
POST /api/bids/:id/questions/extract): For DOCX, converts to HTML viamammoth, then sends to Claude for structured extraction. - Q&A import (
scripts/import_bid_library.py): Full pipeline for extracting Q&A pairs from structured DOCX tables. Handles three table patterns (audit 6-col, draft 5-col, numbered 6-col). Includes dedup, keyword classification, embedding, and Supabase storage. This is the tool used for the existing 173 Q&A pairs from the client documentation. - Table extraction (
scripts/extract_docx_tables.py): Lower-level script thatimport_bid_library.pyuses. Detects table format from headers, extracts Q&A pairs with section tracking from document headings.
Preprocessing needed:
- The Method Statement template and ITT templates from Charnwood are standard DOCX — no conversion needed.
- For the GOV.UK Pricing Template (
.docformat, not.docx): convert to DOCX using LibreOffice before upload. Command:libreoffice --headless --convert-to docx gov-pricing-template.doc - The tender upload pipeline handles DOCX natively.
Entity mapping: | DOCX Content | Knowledge Hub Entity |
|--------------|---------------------| | Full document text | Content item via
/api/upload | | Tender document for a bid | File in tender-documents bucket
| | Extracted questions | bid_questions via extract endpoint | | Q&A table
pairs | content_items (content_type: q_a_pair) via import_bid_library.py |
| Method statement sections | Could map to content items with
content_type: methodology |
Gaps:
- No web UI for running
import_bid_library.py— it is CLI-only. - The DOCX table extraction is optimised for the client’s specific Q&A table
formats. Government template tables (like the Standard SQ) may not match any
of the three detected patterns and would need header mapping additions to
extract_docx_tables.py.
2.3 XLSX/XLS Spreadsheets
Section titled “2.3 XLSX/XLS Spreadsheets”Existing tools:
- None. There is no native XLSX ingestion capability in Knowledge Hub.
Preprocessing needed:
- Manual extraction: open in a spreadsheet application, copy relevant data, and
either:
- Create question records manually via the UI or API
- Convert to a DOCX table format that
import_bid_library.pycan handle - Export as CSV and write a simple conversion script
- The evaluation matrix templates contain scoring criteria and weightings that
map to
evaluation_weightonbid_questions.
Entity mapping: | XLSX Content | Knowledge Hub Entity |
|--------------|---------------------| | Evaluation criteria | bid_questions
with evaluation_weight populated | | Scoring methodology | Content item
(content_type: methodology) or bid workspace notes | | Price schedule
structure | Not directly mappable — informational reference only |
Gaps:
- No XLSX import is the biggest capability gap. Evaluation matrices are a
core procurement document type. A purpose-built script using
openpyxl(Python) orxlsx(JavaScript) would be needed. - XLS (legacy Excel) files require conversion to XLSX first.
2.4 Import Capability Summary
Section titled “2.4 Import Capability Summary”| Format | Web Upload | Tender Upload | Question Extract | Q&A Import | Gap? |
|---|---|---|---|---|---|
| Yes (unpdf) | Yes | Yes (Claude vision) | No | Table extraction weak in web flow | |
| DOCX | Yes (mammoth) | Yes | Yes (mammoth + Claude) | Yes (CLI) | Q&A import is CLI-only |
| DOC | No | No | No | No | Requires conversion to DOCX |
| XLSX | No | No | No | No | No support — needs new script |
| XLS | No | No | No | No | Requires conversion to XLSX |
| MD/TXT | Yes | No | No | No | Not relevant for bid templates |
Part 3: UAT Test Scenarios
Section titled “Part 3: UAT Test Scenarios”Scenario 1: Standard Selection Questionnaire Response
Section titled “Scenario 1: Standard Selection Questionnaire Response”Template: Standard SQ (PPN 03/24) — PDF Exercises: Tender upload, PDF question extraction, KB matching, response drafting
- Create a new bid workspace (“Test Council — Office Supplies 2026”)
- Upload the Standard SQ PDF via
/api/bids/:id/tender - Extract questions via
/api/bids/:id/questions/extract(format:pdf) - Verify: sections detected (exclusion grounds, economic standing, technical capability, modern slavery, H&S, carbon reduction), questions have correct word limits and evaluation weights where specified
- Run KB matching via
/api/bids/:id/questions/match - Verify: confidence postures assigned (expect
strongfor H&S, compliance and quality topics where existing Q&A pairs exist;partialorno_contentfor topics not covered in the current 173 Q&A pairs) - Draft responses via
/api/bids/:id/responses/draftfor questions withstrongposture - Verify: responses reference existing KB content, word limits respected, quality scores reported
- Review responses in the bid UI, edit one, mark as
approved
Expected coverage from current KB: The existing Q&A library covers H&S,
quality management, environmental management, data security, and compliance —
these are core SQ topics. Expect strong matches for ~40-60% of questions.
Topics likely missing: modern slavery statement specifics, carbon reduction plan
details, specific financial standing data.
Scenario 2: Full ITT Workflow
Section titled “Scenario 2: Full ITT Workflow”Template: GDS Example ITT — PDF Exercises: End-to-end bid lifecycle from draft through to export
- Create bid workspace with metadata (buyer: “Government Digital Service”, deadline, reference number)
- Upload ITT PDF as tender document
- Extract questions (should find specification requirements, evaluation criteria, submission instructions)
- Run KB matching for all questions
- Advance bid status to
drafting - Draft responses for all matched questions
- Review and edit responses
- Export via
/api/bids/:id/export/docx— verify DOCX output - Export via
/api/bids/:id/export/xlsx— verify XLSX output - Record bid outcome (submitted, then won/lost)
Key validation: The GDS Example ITT is a well-structured government
document. It should produce clean question extraction with clear section
boundaries. This scenario tests the complete bid state machine: draft ->
questions_extracted -> matching -> drafting -> in_review ->
ready_for_export -> submitted.
Scenario 3: Method Statement Drafting
Section titled “Scenario 3: Method Statement Drafting”Template: GOV.UK Method Statement Template — DOCX Exercises: DOCX upload, section-based content mapping, narrative response drafting
- Upload method statement template via
/api/upload(creates content item) - Create a bid workspace, manually add questions matching method statement sections (approach, methodology, resources, timeline, risk management)
- Run KB matching — expect matches against
methodologyandcapabilitycontent types - Draft responses — these should be longer narrative responses, not short Q&A answers
- Verify: the drafting pipeline produces coherent multi-paragraph responses that address method statement expectations (not just Q&A-style answers)
Expected coverage: The existing KB has limited methodology content. This
scenario will highlight coverage gaps and test how the system handles partial
and no_content postures.
Scenario 4: Multi-Document Bid Pack
Section titled “Scenario 4: Multi-Document Bid Pack”Template: Charnwood Borough Council template pack (multiple DOCX + XLSX) Exercises: Multi-document handling, different format imports, workspace organisation
- Create bid workspace (“Charnwood BC — Facilities Management 2026”)
- Upload ITT Services DOCX as tender document
- Extract questions from the ITT
- Separately upload supporting documents as content items:
- TUPE Transfer Clause (DOCX) —
content_type: policy - GDPR Data Processing Appendix (DOCX) —
content_type: compliance - Community Benefit Clause (DOCX) —
content_type: policy
- TUPE Transfer Clause (DOCX) —
- Link supporting content items to the bid workspace
- Manually review the Evaluation Scoring Matrix (XLSX) and add evaluation weights to questions
- Run matching and drafting for ITT questions
- Verify: responses to GDPR and TUPE questions reference the uploaded supporting documents
Key validation: Tests how multiple documents within a single bid are managed. The supporting documents should enrich the KB and improve match quality for related questions.
Scenario 5: Social Value Response
Section titled “Scenario 5: Social Value Response”Template: National TOMs Framework 2021 — PDF Exercises: Specialist domain extraction, coverage gap identification
- Upload TOMs framework PDF via
/api/upload - Use
/api/extractto extract structured content (the 5 themes, 20 outcomes, 48 measures) - Create a bid workspace, manually create questions based on TOMs themes:
- “Describe your approach to local employment and skills development”
- “How do you measure and report environmental sustainability?”
- “What community engagement initiatives do you undertake?”
- Run KB matching
- Verify: expect
no_contentorpartialfor most social value questions (the existing KB is focused on technical/operational content, not social value) - Use this to validate the coverage gap analysis:
- Run
/api/coverageand check that social value appears as a gap - Use the MCP
get_coverage_gapstool to confirm
- Run
Key validation: This deliberately tests a weak area of the current KB. The value is in demonstrating coverage analysis, not successful drafting.
Scenario 6: Q&A Library Integration
Section titled “Scenario 6: Q&A Library Integration”Template: Client documentation DOCX files (already imported) Exercises: Using existing Q&A pairs to answer tender questions
- Create a bid workspace
- Manually add 10 questions typical of a services procurement PQQ:
- “Describe your quality management system”
- “What health and safety accreditations do you hold?”
- “Describe your data protection and GDPR compliance approach”
- “Provide details of your insurance coverage”
- “Describe your approach to environmental management”
- “Provide two relevant case studies”
- “What is your business continuity plan?”
- “Describe your approach to continuous improvement”
- “What subcontracting arrangements do you use?”
- “Describe your complaints handling procedure”
- Run KB matching
- Verify: these questions should produce strong matches against the existing 173 Q&A pairs since they are the bread-and-butter of the client’s existing bid library
- Draft responses using the MCP
search_qa_librarytool directly - Compare: MCP tool results vs the bid matching pipeline results
Key validation: Tests the core value proposition — reusing existing Q&A content for new bids.
Scenario 7: MCP-Driven Bid Workflow
Section titled “Scenario 7: MCP-Driven Bid Workflow”Template: Any extracted set of questions Exercises: Using MCP tools for the full workflow (Claude Desktop/Claude.ai integration)
- Use MCP
list_active_bidsto see existing bids - Use MCP
get_bid_detailto inspect a bid - Use MCP
get_bid_questionfor individual question detail - Use MCP
search_knowledge_baseto find relevant content - Use MCP
search_qa_libraryfor Q&A pair matching - Use MCP
cite_contentto record content usage in a response - Use MCP
get_content_effectivenessto check win rates - Use MCP
show_coverage_matrixto visualise coverage against bid needs - Use MCP
show_bid_dashboardto see bid pipeline overview
Key validation: Tests the MCP integration layer end-to-end. This scenario is performed entirely through Claude Desktop or Claude.ai, not the web UI.
Scenario 8: Evaluation Matrix Analysis
Section titled “Scenario 8: Evaluation Matrix Analysis”Template: GOV.UK Evaluation Matrix (XLSX) + Scottish Evaluation Matrix (XLSX) Exercises: Manual XLSX processing, evaluation weight assignment
- Open GOV.UK Evaluation Matrix in a spreadsheet application
- Identify evaluation criteria and their weightings
- Create a bid workspace, manually add questions with
evaluation_weightvalues matching the matrix - Run matching and drafting
- Compare response quality scores against evaluation weights — higher-weighted questions should receive more attention (longer responses, more sources)
- Repeat with Scottish Evaluation Matrix to test different scoring methodology (0-4 scale vs percentage weighting)
Key validation: Tests how evaluation weightings influence response prioritisation. This is a manual process due to the XLSX gap.
Part 4: Knowledge Hub Content Testing
Section titled “Part 4: Knowledge Hub Content Testing”4.1 Response Drafting with Existing KB Content
Section titled “4.1 Response Drafting with Existing KB Content”The existing knowledge base contains 186 items (173 Q&A pairs, plus articles,
PDFs, and other content types). The Q&A pairs were imported from the client’s
bid library DOCX files (listed in docs/client-documentation/):
- 2026 Audit templates (FAQs, Functionality, Implementation & Support, Security & Compliance)
- DRAFT 2026 Phew templates (Implementation & Support, FAQs, Security and Compliance)
- Sector Intelligence Brief
- Telehouse South Fact Sheet (PDF)
Testing approach:
-
Direct Q&A matching: Create bid questions that are reworded versions of existing Q&A pairs. Verify that semantic search finds the original despite different wording.
- Existing: “What health and safety accreditations do you hold?”
- Test variant: “Please detail your H&S certifications and standards”
- Expected:
strongmatch with similarity > 0.75
-
Cross-document synthesis: Create questions that require combining content from multiple Q&A pairs.
- “Describe your overall approach to information security, including certifications, incident response, and data handling”
- Expected: multiple matched content items from security & compliance section, response synthesises across sources
-
Content type coverage: Map existing Q&A pairs by domain to understand which tender question categories are well-supported:
Domain Expected Q&A Coverage Typical Tender Sections Health & Safety Strong SQ Part 3, PQQ H&S section Quality Management Strong SQ Part 3, method statements Data Security Strong SQ Part 3, GDPR schedules Environmental Moderate SQ Part 3, carbon reduction Implementation Strong Method statements, mobilisation FAQs/General Strong General company information Financial Standing Weak/None SQ Part 2 Social Value None TOMs-based questions Case Studies Weak ITT evaluation sections Pricing None Commercial schedules
4.2 Coverage Analysis Against Real Bid Requirements
Section titled “4.2 Coverage Analysis Against Real Bid Requirements”- Run coverage analysis (
GET /api/coverage) after uploading each Priority 1 template - Compare coverage gaps against the template’s question domains:
- Standard SQ sections that map to covered domains vs uncovered
- ITT specification areas that lack KB content
- Use MCP tools:
get_coverage_gaps— identify domains with thin coverageshow_coverage_matrix— visualise the coverage heatmapget_freshness_report— check that existing content is fresh enough to use in bidsget_quality_summary— verify content quality is sufficient for bid responses
4.3 Search Quality Validation
Section titled “4.3 Search Quality Validation”Use real bid questions from downloaded templates to test search relevance. Create a test set of 10-15 questions extracted from the Standard SQ and GDS Example ITT, then:
- Run semantic search via
POST /api/searchfor each question - Record results: top-5 items, similarity scores, content types
- Assess relevance: manually score each result as relevant/partially relevant/irrelevant
- Compare with existing evaluation: The project has 20 search test cases in
scripts/search-evaluation.json— add bid-specific queries to expand coverage - MCP search comparison: Run the same queries through
search_knowledge_baseandsearch_qa_libraryMCP tools, compare result sets
Key metrics:
- Precision@5 for bid-specific queries (target: > 0.6)
- Recall of known-relevant Q&A pairs (target: > 0.8 for direct matches)
- Mean similarity score for
strongposture matches (target: > 0.7)
Part 5: Implementation Order
Section titled “Part 5: Implementation Order”Phase A: Immediate — No Development Required
Section titled “Phase A: Immediate — No Development Required”These items use existing tools and can be done right away.
| # | Action | Tool | Time Estimate |
|---|---|---|---|
| A1 | Download Priority 1 templates (5 files) | Browser | 15 min |
| A2 | Create test-data/templates/ directory, add to .gitignore | Manual | 5 min |
| A3 | Run Scenario 6 (Q&A Library Integration) using existing KB content | Web UI + API | 1 hour |
| A4 | Run Scenario 1 with Standard SQ PDF (tender upload + extract + match + draft) | Web UI + API | 1-2 hours |
| A5 | Run Scenario 2 with GDS Example ITT (full lifecycle) | Web UI + API | 2 hours |
| A6 | Run Scenario 3 with Method Statement DOCX | Web UI + API | 1 hour |
| A7 | Run Scenario 7 (MCP-driven workflow) via Claude Desktop | MCP tools | 1-2 hours |
| A8 | Run search quality validation (Part 4.3) | API + manual scoring | 1-2 hours |
Total Phase A: approximately 1 day
Phase B: Quick Wins — Minor Development
Section titled “Phase B: Quick Wins — Minor Development”| # | Action | Effort | Impact |
|---|---|---|---|
| B1 | Add Standard SQ header patterns to extract_docx_tables.py so its Q&A format is recognised if someone converts the PDF to DOCX | Small (extend _HEADER_MAP) | Enables Q&A import from government SQ format |
| B2 | Convert GOV.UK Pricing Template from DOC to DOCX (one-time LibreOffice conversion) | Trivial | Enables upload of pricing template |
| B3 | Download Priority 2 templates and run Scenarios 4, 5, 8 | No dev | Broader test coverage |
| B4 | Add bid-specific queries to scripts/search-evaluation.json | Small | Improves search quality benchmarking |
| B5 | Create a test data seed script that creates a bid workspace with sample questions (for repeatable testing) | Medium | Enables consistent UAT across sessions |
Total Phase B: approximately 1 day
Phase C: Medium-Term — New Capabilities
Section titled “Phase C: Medium-Term — New Capabilities”| # | Action | Effort | Impact |
|---|---|---|---|
| C1 | XLSX import script (scripts/import_evaluation_matrix.py): Read evaluation criteria and weightings from XLSX files, create bid_questions with evaluation_weight populated | Medium (2-4 hours) | Closes the biggest format gap |
| C2 | Web UI for Q&A import: Surface import_bid_library.py functionality through the web interface (upload DOCX, preview extracted Q&A pairs, confirm import) | Large (1-2 days) | Removes CLI dependency for Q&A import |
| C3 | PDF table extraction in web upload: Integrate pdfplumber (or a JavaScript alternative) for table extraction during web upload, replacing unpdf for PDFs that contain structured tables | Medium (4-6 hours) | Better extraction quality for tabular PDFs |
| C4 | Tender pack upload: Allow uploading multiple documents to a bid at once (zip file or multi-file form) | Medium (4-6 hours) | Supports Scenario 4 (multi-document bid) |
| C5 | Evaluation weight auto-population: When extracting questions from an ITT that specifies percentage weightings, automatically populate evaluation_weight on bid_questions | Small (2 hours) | Already partially implemented in question extract; needs reliability testing |
Phase D: Longer-Term — Strategic
Section titled “Phase D: Longer-Term — Strategic”| # | Action | Effort | Impact |
|---|---|---|---|
| D1 | Register on Contracts Finder and download 3-5 real complete tender packs for Scenario 13 | No dev (registration + browsing) | Most realistic test data possible |
| D2 | Register on ProContract or The Chest for live portal testing | No dev (registration) | Tests real supplier workflow |
| D3 | Build a repeatable E2E test that creates a bid, uploads a template, extracts questions, matches, drafts, and exports — fully automated via Playwright | Large (2-3 days) | Regression safety for bid pipeline |
| D4 | Add social value and case study content to the KB to fill coverage gaps identified in Scenario 5 | Content work, not dev | Improves bid response quality for scored sections |
Appendix: Current Import Capabilities Reference
Section titled “Appendix: Current Import Capabilities Reference”Web Upload Endpoint (POST /api/upload)
Section titled “Web Upload Endpoint (POST /api/upload)”- Accepted: PDF, DOCX, Markdown, plain text
- Max size: 50 MB
- Extraction:
unpdffor PDF (text only, no tables),mammothfor DOCX (raw text), passthrough for MD/TXT - Output:
content_itemsrecord with extracted text, file indocumentsstorage bucket - Auth: Editor or admin role required
Tender Upload Endpoint (POST /api/bids/:id/tender)
Section titled “Tender Upload Endpoint (POST /api/bids/:id/tender)”- Accepted: PDF, DOCX
- Max size: 50 MB
- Validation: Magic byte verification, encrypted DOCX detection
- Output: File in
tender-documentsstorage bucket, path added to bid’sdomain_metadata.tender_document_ids - Auth: Editor or admin role required
Question Extraction (POST /api/bids/:id/questions/extract)
Section titled “Question Extraction (POST /api/bids/:id/questions/extract)”- Input:
document_path(intender-documentsbucket) +format(pdfordocx) - Extraction: Claude AI structured extraction (PDF via base64 vision, DOCX via mammoth HTML conversion)
- Output:
bid_questionsrows with section names, sequence numbers, word limits, evaluation weights. Also extracts tender metadata (buyer, deadline, reference). - Dedup: Skips questions that already exist for the bid (case-insensitive text match)
- Max duration: 120 seconds
KB Matching (POST /api/bids/:id/questions/match)
Section titled “KB Matching (POST /api/bids/:id/questions/match)”- Process: For each question, Claude generates search queries, embeddings are generated, vector search runs against KB, results are deduplicated and scored
- Output: Confidence posture (
strong,partial,no_content) and matched content IDs on eachbid_question - Batch: Processes 5 questions in parallel
Response Drafting (POST /api/bids/:id/responses/draft)
Section titled “Response Drafting (POST /api/bids/:id/responses/draft)”- Process: Three-pass drafting pipeline using matched content items
- Output:
bid_responsesrecords withresponse_text, source content IDs, quality metadata - Controls:
model_tierselection,forceflag to redraft existing responses - Respects: Word limits from questions, confidence postures (skips
no_contentunless forced)
Bid Export
Section titled “Bid Export”- DOCX:
GET /api/bids/:id/export/docx - XLSX:
GET /api/bids/:id/export/xlsx
Python CLI Tools
Section titled “Python CLI Tools”| Script | Purpose | Input | Output |
|---|---|---|---|
scripts/extract_pdf_text.py | PDF text + table extraction | PDF file path | JSON (text, tables, page count) |
scripts/extract_pdf_images.py | PDF image extraction | PDF file path | JSON (base64 images) |
scripts/extract_docx_tables.py | DOCX Q&A table extraction | DOCX file path(s) | Printed Q&A pairs |
scripts/import_bid_library.py | Full Q&A import pipeline | Directory of DOCX files | Supabase records |
scripts/ingest.py | URL content ingestion | URL(s) | Supabase records |
scripts/ingest_markdown.py | Markdown file ingestion | File/directory path | Supabase records |
MCP Tools (Bid-Related)
Section titled “MCP Tools (Bid-Related)”| Tool | Purpose |
|---|---|
list_active_bids | List all active bids with status and stats |
get_bid_detail | Full bid detail with questions and responses |
get_bid_question | Individual question with response and confidence |
search_knowledge_base | Semantic search across all KB content |
search_qa_library | Search Q&A pairs specifically |
create_content_item | Create new KB content (editor+) |
cite_content | Record content usage in bid responses |
get_content_effectiveness | Win rate stats for content items |
get_coverage_gaps | Identify domains with thin coverage |
show_coverage_matrix | MCP App: visual coverage heatmap |
show_bid_dashboard | MCP App: bid pipeline overview |