Threads Explained
Threads Explained
Threads in Gen AI Builder represent persistent conversation history — a complete sequence of interactions between a user and an AI Assistant.
Threads enable traceability, observability, and state management for AI-powered applications built with EDB Postgres® AI (EDB PG AI).
Each Thread stores:
- Full message flow
- Tool invocations and results
- Memory state (if enabled)
- System-level metadata and timestamps
Without Threads, Assistants would be stateless and untraceable — Threads provide the foundation for production-grade, auditable, stateful AI experiences.
Before you start
Prerequisites for understanding Threads:
- Familiarity with Assistants in Gen AI Builder
- Understanding of Memory and multi-turn AI conversations
- Awareness of Tools and Rulesets in AI Factory
Suggested reading:
- Assistants Explained
- Rulesets Explained
- Structures Explained
- Knowledge Bases Explained
- AI Factory Concepts
Why it matters
Threads are essential for:
- Traceability — Review and audit AI behavior
- Debugging — Analyze issues and user reports
- Compliance — Maintain auditable conversation records
- Analytics — Improve Assistant quality and Knowledge Base coverage
- Stateful experiences — Enable multi-turn memory for personalized interactions
Without Threads, AI applications built with EDB PG AI would lack critical observability and governance features — incompatible with enterprise AI and Sovereign AI requirements.
What is a Thread?
A Thread represents a persistent, versioned record of a conversation between a user and an AI Assistant.
Each Thread includes:
- Full sequence of messages (user → Assistant → user → ...).
- Tool invocations and responses.
- Memory state across turns (if enabled).
- System metadata:
- Timestamps
- Assistant configuration
- Knowledge Bases and Retriever used
- Rulesets applied
- Model serving runtime and version
In short: Threads are the single source of truth for understanding what happened in an AI conversation.
How Threads work
At runtime:
- User initiates conversation → new Thread is created.
- Each user input and Assistant response is recorded in the Thread.
- Tool calls and responses are logged.
- Memory state is updated and stored (if enabled).
- Thread persists across turns → enabling coherent multi-turn conversations.
- Thread can be:
- Reviewed via UI or API
- Exported for compliance or analysis
- Monitored as part of QA processes
Data flow:
→ Message added to Thread → Memory updated → Tool results recorded → Next user input → repeat
When to use Threads
Use Threads when you need:
- Production AI deployments — Trace and govern every interaction
- Debugging workflows — Investigate specific user reports
- Compliance auditing — Maintain long-term, auditable conversation history
- Analytics and QA — Analyze common questions, identify gaps, tune Assistants
- Stateful experiences — Implement Assistants with personalized memory
Threads are required for any enterprise-grade AI Factory deployment — they are not optional for production use cases.
Patterns of use
Conversation QA
- Regular review of Threads to:
- Identify tone/style issues
- Spot hallucination risks
- Validate Rule and Knowledge Base adherence
Debugging
- Investigate specific user reports:
- Locate Thread
- Trace step-by-step what happened
- Verify memory and Tool behavior
Compliance auditing
- Export Threads for:
- Regulated Assistants (finance, healthcare, legal)
- Internal compliance programs
- Third-party audits
Conversation analytics
- Analyze Threads to:
- Understand user interaction patterns
- Identify content gaps in Knowledge Bases
- Tune Rulesets and Retriever settings
- Guide Assistant design improvements
Stateful Assistants with Memory
- Enable Assistants to maintain context across turns and sessions:
- Personalization (name, preferences)
- Conversation continuity
- Contextual summarization for long-term memory
Best practices
- Establish Thread review processes for production Assistants.
- Implement Thread naming conventions or metadata for easier search and filtering.
- Use Thread filtering and search tools to locate conversations by:
- Assistant
- User ID (where applicable)
- Date/time
- Rule / Knowledge Base / Retriever
- Monitor Tool usage inside Threads — validate that Tools perform reliably.
- For memory-enabled Assistants:
- Monitor summarization quality and memory window behavior.
- Regularly review multi-turn memory flow.
- Define and enforce Thread retention policies:
- Comply with privacy and data protection requirements.
- Meet audit and compliance needs.
- Balance storage costs with retention value.
Sovereign AI alignment
Threads are a critical component of Sovereign AI with EDB PG AI:
- Stored and governed in your infrastructure
- Fully auditable and exportable
- Support for enterprise compliance requirements
- Enable robust QA and continuous improvement of Assistants
- Integrated with Hybrid Manager observability
Without Threads, Sovereign AI is not possible — they provide the essential observability layer for AI-powered experiences.
Summary
Threads make AI Factory production-capable:
- Persistent, versioned conversation history
- Auditable for compliance
- Critical for debugging and QA
- Enable personalized, memory-driven experiences
- Aligned with Sovereign AI principles
Threads are not just a log — they are the operational backbone of enterprise AI in EDB PG AI.
Next steps
- View and Manage Threads
- Working with Threads
- Assistants Explained
- Structures Explained
- Rulesets Explained
- AI Factory Concepts
- Hybrid Manager: Using Gen AI Builder
Threads turn AI Factory from a “chatbot builder” into a governed, auditable enterprise AI platform.
- On this page
- Threads Explained
Could this page be better? Report a problem or suggest an addition!