Back to blog
Product · Agents

Knowledge spaces for AI agents: query multiple documents and connect their data

Group persistent documents under a space_id so AI agents compare, sum, reconcile, and detect discrepancies across invoices, contracts, reports, and more — without reprocessing files.

An AI agent working with business documents rarely needs to answer about a single file alone. In practice, a useful question usually spans several sources: a vendor’s invoices, the framework contract that governs them, an audit report, and the agreed payment terms.

With Claix persistent document memory, each processed file receives a document_id. Knowledge spaces go one step further: they let you group those document_id values under a shared space_id — by customer, vendor, project, case file, or any business entity — so an agent can query the set in a single request.

Processed documents
   ↓
Persistent mode enabled
   ↓
Grouped under space_id
   ↓
User or agent asks a question
   ↓
Claix queries multiple documents in the space
   ↓
Comparison, calculation, or cross-document synthesis
   ↓
Structured or natural-language response

What a knowledge space is

A knowledge space is a logical grouping of persisted documents identified by a space_id. It is not a file or a folder: it is a query layer that lets Claix and your agents reason over several related documents as if they formed a coherent case file.

  • Customer space: contracts, invoices, formalized emails, and applicable policies.
  • Vendor space: framework agreements, delivery notes, invoices, and payment terms.
  • Project space: budgets, minutes, deliverables, and scope changes.
  • Legal case file space: contracts, annexes, amendments, and correspondence.
  • Candidate space: resume, cover letter, certificates, and evaluations.
  • Audit space: reports, evidence, checklists, and compliance responses.
  • Support ticket space: manuals, exported logs, policies, and communications.
ResourceIdentifierWhat it lets you query
Individual documentdocument_idQuestions about a single file: clauses, amounts, dates, tables, or specific fields
Knowledge spacespace_idCross-document questions on the set: comparisons, sums, reconciliations, discrepancies, and multi-document synthesis
QueryquestionsUp to five questions per request, phrased clearly and actionably
Agent responseia_responseNatural language or structured JSON, with documentary sources or null when there is no evidence
// Query on a single document
{
  "document_id": "doc_invoice_83f4",
  "questions": [
    "What is the total amount on this invoice?"
  ]
}

// Cross-document query on a knowledge space
{
  "space_id": "space_supplier_acme_2026",
  "questions": [
    "What is the total invoiced amount for this supplier in Q1?",
    "Does any invoice exceed the contract limit?",
    "Are there discrepancies between the invoices and the framework agreement?"
  ]
}

From a single-document query to a cross-document query

Querying a document_id works well for point questions about one specific file. Querying a space_id works for questions that require context distributed across several persisted documents.

Example with document_id: “What is the expiration date of this contract?” Claix searches one document and returns the applicable clause.

Example with space_id: “Does the total invoiced by this vendor in the quarter match the framework contract limit?” Claix queries the invoices in the space, the associated contract, and returns a comparison with sources.

AspectQuery by document_idQuery by space_id
ScopeOne persisted documentSeveral grouped persisted documents
Question typePoint extraction, summary, or validationComparison, aggregation, reconciliation, or cross-document synthesis
Example“What is the VAT on line 3?”“Does the sum of invoices exceed the contractual cap?”
ReprocessingNo: reuses the document_idNo: reuses all document_id values in the space
Best forDetail from one specific fileCase files, reconciliations, audits, and multi-source analysis

What questions it can answer

A space_id expands the kind of reasoning an agent can delegate to Claix. These are representative questions a knowledge space can resolve:

  • “What is the total invoiced amount for this vendor in the period?”
  • “Does any invoice in the space exceed the contract liability limit?”
  • “Are there discrepancies between invoice totals and the approved budget?”
  • “Which clauses in the framework contract are not reflected in the annexes?”
  • “Which documents in the case file mention the same delivery date?”
  • “Summarize the vendor’s obligations by cross-referencing the contract and general terms.”
  • “How many invoices include the same purchase order number?”
  • “Which candidate in the space meets the minimum experience requirement?”
  • “Are there inconsistencies between the audit report and the attached evidence?”
  • “Return a JSON comparison of net amounts by document in the space.”

This type of query fits multi-document question answering: instead of asking the model to “remember” several files in one prompt, the agent delegates retrieval and evidence cross-referencing to a specialized layer with identifiable persisted documents.

Process once and query the set

The operational advantage of knowledge spaces is the same as persistent memory, applied to a set: you process each document once and query the group whenever the workflow requires it.

Upload invoice A → document_id
Upload invoice B → document_id
Upload contract C → document_id
   ↓
Associate all three with space_id: "supplier_acme_2026"
   ↓
Question: "What is the total invoiced amount, and are there discrepancies with the contract?"
   ↓
Claix queries the set without reprocessing files

This approach avoids:

  • Resending several PDFs or Excel files on every agent interaction.
  • Reprocessing files that were already converted into persistent context.
  • Loading dozens of pages into the prompt and expecting coherence.
  • Building your own chunking, embedding, and indexing pipelines per case file.
  • Losing traceability between an answer and the documents that support it.
  • Mixing information from different customers or vendors in conversational memory.
Your application:
→ defines the space_id and its business relationships
→ controls permissions, tenants, and agent access
→ decides when to create, update, or close a space

Claix:
→ processes documents once
→ retains persistent context per document_id
→ answers queries on a document_id or space_id
→ returns structured data, natural language, or null when there is no evidence

Compare documents with AI

One of the most valuable uses of a space_id is document comparison. The agent does not need to manually read the contract, invoices, and annexes: it asks a comparison question and Claix returns the result with source references.

  • Compare delivery dates between the contract and delivery notes in the space.
  • Verify whether the framework agreement payment terms appear on each invoice.
  • Contrast versions of a clause between the main contract and its annexes.
  • Identify which documents in the case file mention the same entity or amount.
  • Detect whether a report correctly summarizes the data in the attached evidence.

Add up, reconcile, and detect discrepancies

Knowledge spaces enable analytical operations on document sets that a single document_id cannot resolve on its own.

Add up

  • Total net amounts across all invoices in the space.
  • Sum of billed hours on a project from several timesheets.
  • Aggregation of order lines spread across several delivery notes.
  • Total penalties mentioned in reports from the same case file.

Reconcile

  • Verify whether the sum of invoices matches the approved budget.
  • Check whether delivery note totals align with the consolidated invoice.
  • Validate that framework contract amounts fit the invoices issued.
  • Confirm that final report data matches the evidence in the space.

Detect inconsistencies

  • Invoices with amounts above the contractual cap.
  • Contradictory delivery dates between contract and delivery notes.
  • Framework agreement clauses missing from signed annexes.
  • Candidate data that does not match between resume and certificates in the space.
  • Duplicate or inconsistent purchase order references across documents.

Use cases: invoices, contracts, and vendors

Documents in the spaceTypical questionValue for the agent
Framework contract + invoices + delivery notes“Does cumulative billing exceed the annual limit?”Spend control and alerts before approving new orders
Payment terms + quarterly invoices“Does any invoice breach the agreed payment deadline?”Treasury prioritization and collections
Confidentiality agreement + correspondence“Which communications in the space mention sensitive data?”Third-party compliance review

Example query:

{
  "space_id": "space_supplier_acme_2026",
  "questions": [
    "What is the total invoiced amount in Q1?",
    "Does any invoice exceed the framework contract limit?",
    "Are there discrepancies between delivery notes and invoices in the space?"
  ]
}
Documents in the spaceTypical questionValue for the agent
Main contract + annexes + amendments“Which termination clauses differ between versions?”Fast review before a negotiation or renewal
NDA + commercial contract + SLA“Are there conflicts between confidentiality and service obligations?”Legal risk detection in a deal
Contracts for the same customer“What is the nearest renewal date in the space?”Portfolio management planning

Example query:

{
  "space_id": "space_deal_customer_284",
  "questions": [
    "What is the cancellation notice period in the current contract?",
    "Do the annexes keep the same jurisdiction as the main contract?",
    "Summarize the confidentiality obligations across all documents in the space."
  ]
}

Use cases: accounting and finance

Documents in the spaceTypical questionValue for the agent
Invoices + credit notes + statements“Does the vendor’s net balance match the invoices in the space?”Automated reconciliation
Budget + invoices + closing report“Which line item has the largest deviation from the budget?”Budget variance control
Invoices from different periods“What was the month-over-month change in net amount?”Trend analysis without reprocessing files

Example query:

{
  "space_id": "space_finance_q1_2026",
  "questions": [
    "What is the sum of net amounts across all invoices?",
    "Are there duplicate invoices by number or reference?",
    "Return a JSON breakdown by vendor."
  ]
}

Use cases: human resources and recruiting

Documents in the spaceTypical questionValue for the agent
Resume + cover letter + certificates + evaluations“Does the candidate meet the minimum job requirements?”Automated pre-screening with documentary evidence
Employment contracts for one department“How many contracts in the space include a non-compete clause?”Workforce portfolio review
Onboarding policies + submitted documentation“Which mandatory documents are missing from the employee file?”Onboarding compliance control

Example query:

{
  "space_id": "space_candidate_126",
  "questions": [
    "How many years of relevant experience appear in the documents?",
    "Are there inconsistencies between the resume and the certificates?",
    "Summarize the accredited qualifications in the space."
  ]
}

Use cases: support and customer success

Documents in the spaceTypical questionValue for the agent
Manuals + policies + exported logs“Which document in the space describes the procedure for this error?”Incident resolution with a verifiable source
Service contract + SLA + documented tickets“Is the customer entitled to credit according to the documents in the space?”Evidence-based compensation decisions
Customer document history“Which configuration changes appear in the documents for the period?”Continuity across agents and support teams

Example query:

{
  "space_id": "space_customer_992",
  "questions": [
    "Which product version does the documentation in the space cover?",
    "Is there a known limitation described in any manual?",
    "What is the response time according to the current SLA?"
  ]
}

Use cases: operations and logistics

Documents in the spaceTypical questionValue for the agent
Orders + delivery notes + invoices“Do all delivery notes in the space have a corresponding invoice?”Detection of uninvoiced deliveries
Logistics contract + transport records“Does any record breach the contract temperature conditions?”Quality control in the supply chain
Inventories from different dates“Which products show critical stock in the most recent documents?”Operational alerts without reprocessing Excel files

Example query:

{
  "space_id": "space_logistics_project_47",
  "questions": [
    "How many delivery notes in the space lack a purchase order reference?",
    "Are delivery dates consistent between the order and delivery notes?",
    "Return a JSON list of products with quantity discrepancies."
  ]
}

Use cases: compliance and audit

Documents in the spaceTypical questionValue for the agent
Audit report + evidence + checklists“Does the report correctly reflect the evidence in the space?”Cross-validation before issuing an opinion
Internal policies + compliance records“Which policy requirements are not documented in the case file?”Compliance gap detection
Contracts + authorizations + communications“Are there data transfers not covered by the current agreement?”Privacy and regulatory review

Example query:

{
  "space_id": "space_audit_2026_h1",
  "questions": [
    "Are there inconsistencies between the report and the attached evidence?",
    "Which documents in the space mention personal data processing?",
    "Summarize the critical findings with source references."
  ]
}

A more efficient system for agents

Knowledge spaces complete Claix’s evolution: from processing a document to querying it, and from querying it to querying related sets with traceability.

Resend files on every interaction
   ↓
Query a single document_id
   ↓
Load everything into the agent chat
   ↓
Query a space_id with persisted documents
   ↓
Cross-document, traceable, reusable response
ApproachLimitationClaix knowledge space
Resend files on every interactionSlow, expensive, no persistent traceabilityDocuments processed once, queryable by space_id
Query a single document_idDoes not solve multi-document questionsGroups document_id values under a shared space_id
Load everything into the agent chatContext saturation, mixed sourcesSelective query over the space set
Build your own RAG per case fileDuplicated infrastructure and maintenanceManaged layer for processing and cross-document query

Clear questions for better answers

The quality of a space_id query depends as much on phrasing as on the content of the space. Vague questions produce vague answers; specific questions enable useful comparisons, calculations, and discrepancy detection.

// Low-value question
"What can you tell me about these documents?"

// Clear, actionable question
"What is the sum of net amounts across the invoices in the space,
 and which document contributes the largest deviation from the contract?"

Best practices when formulating questions for a space_id:

  • Specify what to compare, add up, or verify.
  • Indicate the period, entity, or criterion when applicable.
  • Request structured format (JSON) if the agent needs to act programmatically.
  • Ask one question per concept; use the five-question limit to cover distinct angles.
  • Avoid questions that mix several goals without a clear criterion.

Five questions per query

Each request to a space_id supports up to five questions. This limit favors focused queries and traceable answers instead of open-ended requests that dilute documentary evidence.

Example query with five complementary questions:

  • “What is the total net amount of the invoices in the space?”
  • “Does any invoice exceed the framework contract limit?”
  • “Are there delivery notes without a corresponding invoice?”
  • “Which document contributes the largest deviation from the budget?”
  • “Return a JSON breakdown by vendor with document_id references.”

If Claix cannot find sufficient evidence in the documents in the space to answer a specific question, it returns null for that question. This lets the agent distinguish between “no data” and “data exists” instead of inventing an answer.

Conclusions based on documents, not assumptions

A reliable agent should not infer totals, deadlines, or discrepancies without a documentary basis. Knowledge spaces let conclusions rest on evidence retrieved from the persisted set.

Agent question
   ↓
Query space_id
   ↓
Claix searches for evidence in the documents in the space
   ↓
Returns an answer with sources or null if there is no documentary basis
   ↓
The agent acts on facts, not assumptions

Example response with traceability:

{
  "total_net_amount": 47250.00,
  "currency": "EUR",
  "exceeds_contract_limit": false,
  "sources": [
    { "document_id": "doc_invoice_001", "field": "net_amount", "value": 15750.00 },
    { "document_id": "doc_invoice_002", "field": "net_amount", "value": 16200.00 },
    { "document_id": "doc_invoice_003", "field": "net_amount", "value": 15300.00 }
  ],
  "contract_reference": {
    "document_id": "doc_contract_marco_7291",
    "annual_limit": 50000.00
  }
}

How it fits with persistent document memory

Knowledge spaces do not replace persistent memory: they extend it. Each document in the space must be processed in persistent mode with its own document_id. The space_id is the layer that relates them for cross-document queries.

LayerIdentifierFunction
Persistent document memorydocument_idRetain the context of a processed document for individual queries
Knowledge spacespace_idGroup related document_id values for multi-document queries
Business entitycustomer_id, project_id, supplier_id…Relate the space_id to your application logic

The progression is natural: first you process and persist individual documents; then you group those that belong to the same business context; finally, your agent queries the full space when the question requires it.

Knowledge spaces for SaaS and automations

For SaaS products and automated flows, the pattern is consistent: your backend creates the space_id, associates the processed document_id values, and delegates cross-document questions to Claix when an agent or workflow needs them.

// Finance agent: vendor reconciliation
POST /query { space_id: "space_vendor_404", questions: [...] }

// Legal agent: clause review in a case file
POST /query { space_id: "space_deal_839", questions: [...] }

// Onboarding automation: candidate documentation
POST /query { space_id: "space_candidate_126", questions: [...] }

// Support agent: customer document history
POST /query { space_id: "space_customer_992", questions: [...] }

Your application keeps the business logic — permissions, states, notifications, and actions — while Claix provides the cross-document query layer over the persisted set.

It is not just a collection of documents

A space_id is not equivalent to a shared folder or an array of files in memory. It is a query resource with business semantics: Claix knows that the documents in the space should be considered together when answering comparison, aggregation, or inconsistency questions.

ApproachWhat it isLimitation
File folderPassive storageThe agent must read and cross-reference each file manually
List of document_id values in a promptReference without a query layerDoes not scale; mixes context without traceability
Claix knowledge spacePersistent multi-document query resourceComparison, sum, reconciliation, and discrepancies with sources

Why this matters for the future of agents

Business agents are evolving from answering isolated questions to running complete workflows: reconciling invoices, reviewing case files, auditing compliance, or preparing negotiations. Those workflows require reliable access to document sets, not just individual files.

  • Less dependence on prompts saturated with multiple PDFs.
  • More structured queries over complete case files.
  • Better traceability between the agent’s answer and source documents.
  • Clear separation between conversational memory and grouped document knowledge.
  • Ability to add up, reconcile, and detect discrepancies without ad hoc logic.
  • Natural integration with automations and multi-tenant SaaS products.

Knowledge spaces turn a set of persisted document_id values into a queryable unit for AI agents: the difference between “I have several files” and “I have a case file I can reason over.”

Conclusion

Claix lets you move from individual document_id queries to cross-document space_id queries while keeping the promise of persistent memory: process once, query many times. Knowledge spaces give your agents the ability to compare, add up, reconcile, and detect discrepancies between related documents, with traceable answers and null when there is no evidence.

"It is not just a collection of PDFs.
It is a queryable knowledge space where your agent
can compare, add up, reconcile, and detect discrepancies
between persisted documents — without reprocessing them."
Loose documents → persisted document_id → grouped space_id
→ cross-document question → answer with sources → agent action

Frequently asked questions (FAQ AEO)

What is a space_id in Claix?
It is an identifier that groups several persisted document_id values in a knowledge space. It enables multi-document queries: comparisons, sums, reconciliations, and discrepancy detection across the documents in the space.
What is the difference between document_id and space_id?
document_id identifies an individual persisted document; space_id groups several document_id values for cross-document queries. Use document_id for questions about one file and space_id when the answer requires cross-referencing several related documents.
What happens if there is no evidence for a question?
Claix returns null for that specific question. This lets the agent distinguish between missing documentary data and present evidence, avoiding invented answers.
How many questions can I send per query?
Up to five questions per request to a space_id. We recommend phrasing them clearly and actionably, one concept per question, to get traceable and useful answers.
Do I need to reprocess documents to query a space?
No. Each document in the space must already be processed in persistent mode. Once associated with the space_id, cross-document queries reuse that context without resending or reprocessing files.
How do knowledge spaces relate to persistent mode?
Persistent mode retains each document with its document_id. Knowledge spaces are the next layer: they group those document_id values under a space_id to enable multi-document queries over case files, vendors, projects, or any business entity.