Documentation
¶
Index ¶
- Constants
- type IngestionResult
- type IngestionService
- func (s *IngestionService) EnqueueTask(ctx context.Context, task *IngestionTask) error
- func (s *IngestionService) GetQueueInfo(ctx context.Context) (map[string]interface{}, error)
- func (s *IngestionService) HealthCheck(ctx context.Context) error
- func (s *IngestionService) Start(ctx context.Context) error
- func (s *IngestionService) Stop()
- type IngestionTask
- type RetrievalRequest
- type RetrievalResponse
- type RetrievalService
- func (rs *RetrievalService) Close() error
- func (rs *RetrievalService) GetSearchStats(ctx context.Context, tenantID types.TenantID) (*retriever.SearchStats, error)
- func (rs *RetrievalService) HealthCheck(ctx context.Context) error
- func (rs *RetrievalService) Retrieve(ctx context.Context, req *RetrievalRequest) (*RetrievalResponse, error)
- func (rs *RetrievalService) SearchOnly(ctx context.Context, req *RetrievalRequest) ([]*retriever.SearchResult, error)
- type StepTimings
Constants ¶
const (
TypeIngestionTask = "ingestion:process"
)
Task type constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IngestionResult ¶
type IngestionResult struct {
TaskID string `json:"task_id"`
EpisodeID string `json:"episode_id"`
EntitiesCreated int `json:"entities_created"`
RelationshipsCreated int `json:"relationships_created"`
ConflictsResolved int `json:"conflicts_resolved"`
ProcessingTime time.Duration `json:"processing_time"`
Errors []string `json:"errors,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
IngestionResult represents the result of processing an ingestion task
type IngestionService ¶
type IngestionService struct {
// contains filtered or unexported fields
}
IngestionService handles asynchronous text ingestion and processing
func NewIngestionService ¶
func NewIngestionService( storageClient *storage.Client, llmAdapter llm.LLMAdapter, config *config.Config, ) *IngestionService
NewIngestionService creates a new ingestion service
func (*IngestionService) EnqueueTask ¶
func (s *IngestionService) EnqueueTask(ctx context.Context, task *IngestionTask) error
EnqueueTask enqueues a new ingestion task
func (*IngestionService) GetQueueInfo ¶
func (s *IngestionService) GetQueueInfo(ctx context.Context) (map[string]interface{}, error)
GetQueueInfo returns information about the task queues
func (*IngestionService) HealthCheck ¶
func (s *IngestionService) HealthCheck(ctx context.Context) error
HealthCheck performs a health check on the ingestion service
type IngestionTask ¶
type IngestionTask struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
SessionID string `json:"session_id"`
Text string `json:"text"`
EventTime *time.Time `json:"event_time,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Source string `json:"source,omitempty"`
Priority int `json:"priority,omitempty"`
}
IngestionTask represents a task for processing text input
type RetrievalRequest ¶
type RetrievalRequest struct {
Query string `json:"query" validate:"required,min=1"`
TenantID types.TenantID `json:"tenant_id" validate:"required"`
SessionID types.SessionID `json:"session_id,omitempty"`
MaxResults int `json:"max_results,omitempty"`
Format retriever.ContextFormat `json:"format,omitempty"`
IncludeMetadata bool `json:"include_metadata,omitempty"`
TimeRange *types.TimeRange `json:"time_range,omitempty"`
EntityTypes []string `json:"entity_types,omitempty"`
RerankingStrategy retriever.RerankingStrategy `json:"reranking_strategy,omitempty"`
UserPreferences *retriever.UserPreferences `json:"user_preferences,omitempty"`
}
RetrievalRequest represents a request for context retrieval
type RetrievalResponse ¶
type RetrievalResponse struct {
Context string `json:"context"`
Format retriever.ContextFormat `json:"format"`
TokenCount int `json:"token_count"`
EpisodeCount int `json:"episode_count"`
EntityCount int `json:"entity_count"`
SearchResults []*retriever.SearchResult `json:"search_results,omitempty"`
RerankingScores []retriever.RerankingScore `json:"reranking_scores,omitempty"`
TimeRange *retriever.TimeRange `json:"time_range,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
ProcessingTime time.Duration `json:"processing_time"`
StepTimings *StepTimings `json:"step_timings,omitempty"`
}
RetrievalResponse represents the response from context retrieval
type RetrievalService ¶
type RetrievalService struct {
// contains filtered or unexported fields
}
RetrievalService orchestrates the three-step retrieval process
func NewRetrievalService ¶
func NewRetrievalService( storageClient *storage.Client, llmAdapter llm.LLMAdapter, fullConfig *config.Config, ) *RetrievalService
NewRetrievalService creates a new retrieval service
func (*RetrievalService) Close ¶
func (rs *RetrievalService) Close() error
Close gracefully shuts down the retrieval service
func (*RetrievalService) GetSearchStats ¶
func (rs *RetrievalService) GetSearchStats(ctx context.Context, tenantID types.TenantID) (*retriever.SearchStats, error)
GetSearchStats returns search statistics for a tenant
func (*RetrievalService) HealthCheck ¶
func (rs *RetrievalService) HealthCheck(ctx context.Context) error
HealthCheck performs a health check on the retrieval service
func (*RetrievalService) Retrieve ¶
func (rs *RetrievalService) Retrieve(ctx context.Context, req *RetrievalRequest) (*RetrievalResponse, error)
Retrieve performs the complete three-step retrieval process
func (*RetrievalService) SearchOnly ¶
func (rs *RetrievalService) SearchOnly(ctx context.Context, req *RetrievalRequest) ([]*retriever.SearchResult, error)
SearchOnly performs only the search step without reranking or context building