Documentation
¶
Index ¶
- Variables
- type ActivityHotspot
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) GetGraphStats(ctx context.Context) (*GraphStats, error)
- func (c *Client) Graph() *falkordb.Graph
- func (c *Client) Health(ctx context.Context) (*HealthStatus, error)
- func (c *Client) IsConnected() bool
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) Query(ctx context.Context, query string, params map[string]any) (*QueryResult, error)
- type ClientConfig
- type Cluster
- type ClusterDetection
- func (c *ClusterDetection) DetectCategoryClusters(ctx context.Context) ([]Cluster, error)
- func (c *ClusterDetection) DetectEntityClusters(ctx context.Context, minSize int) ([]Cluster, error)
- func (c *ClusterDetection) DetectOverlappingClusters(ctx context.Context, limit int) ([]OverlapFile, error)
- func (c *ClusterDetection) DetectTagClusters(ctx context.Context, minSize int) ([]Cluster, error)
- func (c *ClusterDetection) DetectTopicClusters(ctx context.Context, minSize int) ([]Cluster, error)
- func (c *ClusterDetection) FindFileClusterMembership(ctx context.Context, filePath string) (*FileMembership, error)
- func (c *ClusterDetection) GetClusterSummary(ctx context.Context) (*ClusterSummary, error)
- type ClusterFile
- type ClusterMember
- type ClusterSummary
- type CoEditedFile
- type CoModifiedPair
- type ConnectedFile
- type CoverageStats
- type DayActivity
- type Disambiguation
- func (d *Disambiguation) AddAlias(alias, canonical string)
- func (d *Disambiguation) FindDuplicateEntities(ctx context.Context) ([]DuplicateEntity, error)
- func (d *Disambiguation) FindSimilarEntities(ctx context.Context, name string, limit int) ([]SimilarEntity, error)
- func (d *Disambiguation) GetCanonicalName(name string) string
- func (d *Disambiguation) GetEntityVariants(ctx context.Context, entityName string) ([]EntityVariant, error)
- func (d *Disambiguation) MergeEntities(ctx context.Context, sourceEntity, targetEntity string) (int64, error)
- func (d *Disambiguation) NormalizeAllEntities(ctx context.Context) (int64, error)
- func (d *Disambiguation) NormalizeEntityName(name string) string
- type DuplicateEntity
- type Edges
- func (e *Edges) CleanupOrphanedNodes(ctx context.Context) (int64, error)
- func (e *Edges) GetFileEntities(ctx context.Context, filePath string) ([]EntityNode, error)
- func (e *Edges) GetFileReferences(ctx context.Context, filePath string) ([]Reference, error)
- func (e *Edges) GetFileTags(ctx context.Context, filePath string) ([]string, error)
- func (e *Edges) GetFileTopics(ctx context.Context, filePath string) ([]string, error)
- func (e *Edges) GetFilesMentioningEntity(ctx context.Context, entityName string) ([]FileNode, error)
- func (e *Edges) GetFilesWithTag(ctx context.Context, tagName string) ([]FileNode, error)
- func (e *Edges) GetFilesWithTopic(ctx context.Context, topicName string) ([]FileNode, error)
- func (e *Edges) GetSimilarFiles(ctx context.Context, filePath string, limit int) ([]SimilarFile, error)
- func (e *Edges) LinkDirectoryParent(ctx context.Context, parentDir, childDir string) error
- func (e *Edges) LinkFileToCategory(ctx context.Context, filePath, categoryName string) error
- func (e *Edges) LinkFileToDirectory(ctx context.Context, filePath, dirPath string) error
- func (e *Edges) LinkFileToEntity(ctx context.Context, filePath, entityName, entityType string) error
- func (e *Edges) LinkFileToReference(ctx context.Context, filePath, topicName, refType string, confidence float64) error
- func (e *Edges) LinkFileToTag(ctx context.Context, filePath, tagName string) error
- func (e *Edges) LinkFileToTopic(ctx context.Context, filePath, topicName string) error
- func (e *Edges) LinkSimilarFiles(ctx context.Context, filePath1, filePath2 string, score float64) error
- func (e *Edges) LinkTopicParent(ctx context.Context, parentTopic, childTopic string) error
- func (e *Edges) RemoveFileEdges(ctx context.Context, filePath string) error
- type Entity
- type EntityCount
- type EntityInfo
- type EntityNode
- type EntityStats
- type EntityVariant
- type ExportSummary
- type Exporter
- func (e *Exporter) GetFileEntry(ctx context.Context, path string, relatedLimit int) (*types.FileEntry, error)
- func (e *Exporter) ToGraphIndex(ctx context.Context, memoryRoot string, verbose ...bool) (*types.GraphIndex, error)
- func (e *Exporter) ToSummary(ctx context.Context, memoryRoot string, recentDays int, topN int) (*ExportSummary, error)
- type FileConnections
- type FileHistory
- type FileMembership
- type FileNode
- type FileSummary
- type Gap
- type GapAnalysis
- func (g *GapAnalysis) AnalyzeGaps(ctx context.Context) (*GapReport, error)
- func (g *GapAnalysis) FindEmptyCategories(ctx context.Context) ([]Gap, error)
- func (g *GapAnalysis) FindIsolatedFiles(ctx context.Context) ([]Gap, error)
- func (g *GapAnalysis) FindMissingConnections(ctx context.Context, limit int) ([]MissingConnection, error)
- func (g *GapAnalysis) FindOrphanedEntities(ctx context.Context) ([]Gap, error)
- func (g *GapAnalysis) FindOrphanedTags(ctx context.Context) ([]Gap, error)
- func (g *GapAnalysis) FindOrphanedTopics(ctx context.Context) ([]Gap, error)
- func (g *GapAnalysis) FindUnderDocumentedEntities(ctx context.Context, minFiles int) ([]Gap, error)
- func (g *GapAnalysis) FindUnderDocumentedTopics(ctx context.Context, minFiles int) ([]Gap, error)
- func (g *GapAnalysis) GetCoverageStats(ctx context.Context) (*CoverageStats, error)
- type GapReport
- type GraphOverview
- type GraphStats
- type HealthStatus
- type IndexInfo
- type Manager
- func (m *Manager) AnalyzeGaps(ctx context.Context) (*GapReport, error)
- func (m *Manager) Cleanup(ctx context.Context) (int64, error)
- func (m *Manager) ClearGraph(ctx context.Context) error
- func (m *Manager) Client() *Client
- func (m *Manager) Close() error
- func (m *Manager) Clusters() *ClusterDetection
- func (m *Manager) DetectEntityClusters(ctx context.Context, minSize int) ([]Cluster, error)
- func (m *Manager) DetectTagClusters(ctx context.Context, minSize int) ([]Cluster, error)
- func (m *Manager) DetectTopicClusters(ctx context.Context, minSize int) ([]Cluster, error)
- func (m *Manager) Disambiguation() *Disambiguation
- func (m *Manager) Edges() *Edges
- func (m *Manager) FindCoModifiedFiles(ctx context.Context, windowMinutes int, limit int) ([]CoModifiedPair, error)
- func (m *Manager) FindDuplicateEntities(ctx context.Context) ([]DuplicateEntity, error)
- func (m *Manager) FindFileClusterMembership(ctx context.Context, filePath string) (*FileMembership, error)
- func (m *Manager) FindIsolatedFiles(ctx context.Context) ([]Gap, error)
- func (m *Manager) FindMissingConnections(ctx context.Context, limit int) ([]MissingConnection, error)
- func (m *Manager) FindSimilarEntities(ctx context.Context, name string, limit int) ([]SimilarEntity, error)
- func (m *Manager) GapAnalysis() *GapAnalysis
- func (m *Manager) GetActivityHotspots(ctx context.Context, days int, limit int) ([]ActivityHotspot, error)
- func (m *Manager) GetAll(ctx context.Context) ([]types.IndexEntry, error)
- func (m *Manager) GetClusterSummary(ctx context.Context) (*ClusterSummary, error)
- func (m *Manager) GetCoverageStats(ctx context.Context) (*CoverageStats, error)
- func (m *Manager) GetEntityVariants(ctx context.Context, entityName string) ([]EntityVariant, error)
- func (m *Manager) GetFile(ctx context.Context, path string) (*types.IndexEntry, error)
- func (m *Manager) GetFileConnections(ctx context.Context, filePath string) (*FileConnections, error)
- func (m *Manager) GetFileModificationHistory(ctx context.Context, filePath string) (*FileHistory, error)
- func (m *Manager) GetModificationTimeline(ctx context.Context, days int) ([]DayActivity, error)
- func (m *Manager) GetRecentFiles(ctx context.Context, days int, limit int) ([]SearchResult, error)
- func (m *Manager) GetRecentModifications(ctx context.Context, since time.Time, limit int) ([]ModificationEvent, error)
- func (m *Manager) GetRelatedFiles(ctx context.Context, filePath string, limit int) ([]RelatedFile, error)
- func (m *Manager) GetStaleFiles(ctx context.Context, staleDays int, limit int) ([]StaleFile, error)
- func (m *Manager) GetStats(ctx context.Context) (*Stats, error)
- func (m *Manager) GetTemporalStats(ctx context.Context) (*TemporalStats, error)
- func (m *Manager) Health(ctx context.Context) (*HealthStatus, error)
- func (m *Manager) Initialize(ctx context.Context) error
- func (m *Manager) IsConnected() bool
- func (m *Manager) MergeEntities(ctx context.Context, source, target string) (int64, error)
- func (m *Manager) Nodes() *Nodes
- func (m *Manager) NormalizeEntities(ctx context.Context) (int64, error)
- func (m *Manager) Queries() *Queries
- func (m *Manager) RecommendByContext(ctx context.Context, contextFiles []string, limit int) ([]Recommendation, error)
- func (m *Manager) RecommendRelated(ctx context.Context, filePath string, limit int) ([]Recommendation, error)
- func (m *Manager) Recommendations() *Recommendations
- func (m *Manager) RemoveFile(ctx context.Context, path string) error
- func (m *Manager) Search(ctx context.Context, query string, limit int, categoryFilter string) ([]SearchResult, error)
- func (m *Manager) Temporal() *TemporalTracking
- func (m *Manager) TopConnectedFiles(ctx context.Context, limit int) ([]ConnectedFile, error)
- func (m *Manager) UpdateSingle(ctx context.Context, entry types.IndexEntry, info UpdateInfo) (UpdateResult, error)
- func (m *Manager) UpdateSingleWithEmbedding(ctx context.Context, entry types.IndexEntry, info UpdateInfo, ...) (UpdateResult, error)
- func (m *Manager) UpdateSingleWithEntities(ctx context.Context, entry types.IndexEntry, entities []Entity, ...) (UpdateResult, error)
- func (m *Manager) VectorSearch(ctx context.Context, embedding []float32, limit int) ([]SearchResult, error)
- type ManagerConfig
- type MissingConnection
- type ModificationEvent
- type Nodes
- func (n *Nodes) CountFiles(ctx context.Context) (int64, error)
- func (n *Nodes) DeleteFile(ctx context.Context, path string) error
- func (n *Nodes) FileExists(ctx context.Context, path string) (bool, error)
- func (n *Nodes) GetCategory(ctx context.Context, name string) (bool, error)
- func (n *Nodes) GetFile(ctx context.Context, path string) (*FileNode, error)
- func (n *Nodes) GetFileByFilename(ctx context.Context, filename string) (*FileNode, error)
- func (n *Nodes) GetFileByHash(ctx context.Context, hash string) (*FileNode, error)
- func (n *Nodes) GetOrCreateDirectory(ctx context.Context, path string) error
- func (n *Nodes) GetOrCreateEntity(ctx context.Context, name, entityType string) error
- func (n *Nodes) GetOrCreateTag(ctx context.Context, name string) error
- func (n *Nodes) GetOrCreateTopic(ctx context.Context, name string) error
- func (n *Nodes) ListEntities(ctx context.Context) ([]EntityNode, error)
- func (n *Nodes) ListFiles(ctx context.Context) ([]FileNode, error)
- func (n *Nodes) ListTags(ctx context.Context) ([]string, error)
- func (n *Nodes) ListTopics(ctx context.Context) ([]string, error)
- func (n *Nodes) UpsertFile(ctx context.Context, file FileNode) error
- func (n *Nodes) UpsertFileWithEmbedding(ctx context.Context, file FileNode, embedding []float32) error
- type OverlapFile
- type Queries
- func (q *Queries) FindFilesWithSharedEntities(ctx context.Context, filePath string, limit int) ([]SharedEntityFile, error)
- func (q *Queries) FullTextSearch(ctx context.Context, searchText string, limit int) ([]SearchResult, error)
- func (q *Queries) GetFileConnections(ctx context.Context, filePath string) (*FileConnections, error)
- func (q *Queries) GetGraphOverview(ctx context.Context) (*GraphOverview, error)
- func (q *Queries) GetRecentFiles(ctx context.Context, days int, limit int) ([]SearchResult, error)
- func (q *Queries) GetRelatedFiles(ctx context.Context, filePath string, limit int) ([]RelatedFile, error)
- func (q *Queries) SearchByCategory(ctx context.Context, category string, limit int) ([]SearchResult, error)
- func (q *Queries) SearchByEntity(ctx context.Context, entityName string, limit int) ([]SearchResult, error)
- func (q *Queries) SearchByFilename(ctx context.Context, pattern string, limit int) ([]SearchResult, error)
- func (q *Queries) SearchByTag(ctx context.Context, tagName string, limit int) ([]SearchResult, error)
- func (q *Queries) SearchByTopic(ctx context.Context, topicName string, limit int) ([]SearchResult, error)
- func (q *Queries) VectorSearch(ctx context.Context, embedding []float32, limit int) ([]SearchResult, error)
- type QueryResult
- type Recommendation
- type RecommendationWeights
- type Recommendations
- func (r *Recommendations) RecommendByContext(ctx context.Context, contextFiles []string, limit int) ([]Recommendation, error)
- func (r *Recommendations) RecommendRelated(ctx context.Context, filePath string, limit int) ([]Recommendation, error)
- func (r *Recommendations) SetWeights(weights RecommendationWeights)
- func (r *Recommendations) TopConnectedFiles(ctx context.Context, limit int) ([]ConnectedFile, error)
- type Record
- type Reference
- type ReferenceInfo
- type RelatedFile
- type Schema
- type SchemaConfig
- type SearchResult
- type SharedEntityFile
- type SimilarEntity
- type SimilarFile
- type StaleFile
- type Stats
- type TagCount
- type TagStats
- type TemporalStats
- type TemporalTracking
- func (t *TemporalTracking) FindCoModifiedFiles(ctx context.Context, windowMinutes int, limit int) ([]CoModifiedPair, error)
- func (t *TemporalTracking) GetActivityHotspots(ctx context.Context, days int, limit int) ([]ActivityHotspot, error)
- func (t *TemporalTracking) GetFileModificationHistory(ctx context.Context, filePath string) (*FileHistory, error)
- func (t *TemporalTracking) GetModificationTimeline(ctx context.Context, days int) ([]DayActivity, error)
- func (t *TemporalTracking) GetRecentModifications(ctx context.Context, since time.Time, limit int) ([]ModificationEvent, error)
- func (t *TemporalTracking) GetStaleFiles(ctx context.Context, staleDays int, limit int) ([]StaleFile, error)
- func (t *TemporalTracking) GetTemporalStats(ctx context.Context) (*TemporalStats, error)
- type TopicCount
- type TopicStats
- type UpdateInfo
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
var NodeLabels = []string{
"File",
"Tag",
"Topic",
"Category",
"Entity",
"Directory",
}
NodeLabels defines the node types in our schema
var RelationshipTypes = []string{
"HAS_TAG",
"COVERS_TOPIC",
"IN_CATEGORY",
"MENTIONS",
"REFERENCES",
"SIMILAR_TO",
"IN_DIRECTORY",
"PARENT_OF",
}
RelationshipTypes defines the relationship types in our schema
Functions ¶
This section is empty.
Types ¶
type ActivityHotspot ¶
type ActivityHotspot struct {
Path string `json:"path"`
ModificationCount int64 `json:"modification_count"`
LastModified time.Time `json:"last_modified"`
}
ActivityHotspot represents an area with high modification activity
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps FalkorDB connection and provides graph operations
func NewClient ¶
func NewClient(config ClientConfig, logger *slog.Logger) *Client
NewClient creates a new FalkorDB client
func (*Client) GetGraphStats ¶
func (c *Client) GetGraphStats(ctx context.Context) (*GraphStats, error)
GetGraphStats retrieves statistics about the graph
func (*Client) Health ¶
func (c *Client) Health(ctx context.Context) (*HealthStatus, error)
Health returns health status information
func (*Client) IsConnected ¶
IsConnected checks if client is connected
type ClientConfig ¶
ClientConfig contains FalkorDB connection settings
func DefaultClientConfig ¶
func DefaultClientConfig() ClientConfig
DefaultClientConfig returns default configuration
type Cluster ¶
type Cluster struct {
ID string `json:"id"`
Name string `json:"name"`
FileCount int `json:"file_count"`
Files []ClusterFile `json:"files"`
DominantTags []string `json:"dominant_tags"`
DominantTopics []string `json:"dominant_topics"`
DominantEntities []string `json:"dominant_entities,omitempty"`
Categories []string `json:"categories"`
}
Cluster represents a group of related files
type ClusterDetection ¶
type ClusterDetection struct {
// contains filtered or unexported fields
}
ClusterDetection provides file clustering capabilities
func NewClusterDetection ¶
func NewClusterDetection(client *Client, logger *slog.Logger) *ClusterDetection
NewClusterDetection creates a new ClusterDetection handler
func (*ClusterDetection) DetectCategoryClusters ¶
func (c *ClusterDetection) DetectCategoryClusters(ctx context.Context) ([]Cluster, error)
DetectCategoryClusters finds clusters based on file categories
func (*ClusterDetection) DetectEntityClusters ¶
func (c *ClusterDetection) DetectEntityClusters(ctx context.Context, minSize int) ([]Cluster, error)
DetectEntityClusters finds clusters of files based on shared entities
func (*ClusterDetection) DetectOverlappingClusters ¶
func (c *ClusterDetection) DetectOverlappingClusters(ctx context.Context, limit int) ([]OverlapFile, error)
DetectOverlappingClusters finds files that belong to multiple clusters These are potential integration points or hub files
func (*ClusterDetection) DetectTagClusters ¶
DetectTagClusters finds clusters of files based on shared tags
func (*ClusterDetection) DetectTopicClusters ¶
DetectTopicClusters finds clusters of files based on shared topics
func (*ClusterDetection) FindFileClusterMembership ¶
func (c *ClusterDetection) FindFileClusterMembership(ctx context.Context, filePath string) (*FileMembership, error)
FindFileClusterMembership returns all clusters a file belongs to
func (*ClusterDetection) GetClusterSummary ¶
func (c *ClusterDetection) GetClusterSummary(ctx context.Context) (*ClusterSummary, error)
GetClusterSummary returns a high-level summary of knowledge clusters
type ClusterFile ¶
type ClusterFile struct {
Path string `json:"path"`
Name string `json:"name"`
Summary string `json:"summary"`
Category string `json:"category"`
Centrality float64 `json:"centrality"` // How central this file is to the cluster
}
ClusterFile represents a file within a cluster
type ClusterMember ¶
type ClusterMember struct {
Name string `json:"name"`
}
ClusterMember represents membership in a cluster
type ClusterSummary ¶
type ClusterSummary struct {
TopTopics []TopicStats `json:"top_topics"`
TopTags []TagStats `json:"top_tags"`
TopEntities []EntityStats `json:"top_entities"`
CategoryDistribution map[string]int64 `json:"category_distribution"`
}
ClusterSummary provides high-level statistics about knowledge clusters
type CoEditedFile ¶
type CoEditedFile struct {
Path string `json:"path"`
Name string `json:"name"`
Modified time.Time `json:"modified"`
ConnectionStrength int64 `json:"connection_strength"`
}
CoEditedFile represents a file that was edited around the same time
type CoModifiedPair ¶
type CoModifiedPair struct {
File1Path string `json:"file1_path"`
File1Name string `json:"file1_name"`
File2Path string `json:"file2_path"`
File2Name string `json:"file2_name"`
CoModCount int64 `json:"co_modification_count"`
LastCoMod string `json:"last_co_modification"`
Relationship string `json:"relationship"` // same_topic, same_entity, same_category, etc.
}
CoModifiedPair represents two files frequently modified together
type ConnectedFile ¶
type ConnectedFile struct {
Path string `json:"path"`
Name string `json:"name"`
Summary string `json:"summary"`
Category string `json:"category"`
TagCount int64 `json:"tag_count"`
TopicCount int64 `json:"topic_count"`
EntityCount int64 `json:"entity_count"`
TotalConns int64 `json:"total_connections"`
}
ConnectedFile represents a file with its connection counts
type CoverageStats ¶
type CoverageStats struct {
TotalFiles int64 `json:"total_files"`
FilesWithTags int64 `json:"files_with_tags"`
FilesWithTopics int64 `json:"files_with_topics"`
FilesWithEntities int64 `json:"files_with_entities"`
FilesWithEmbeddings int64 `json:"files_with_embeddings"`
FullyCoveredFiles int64 `json:"fully_covered_files"`
TagCoverage float64 `json:"tag_coverage_percent"`
TopicCoverage float64 `json:"topic_coverage_percent"`
EntityCoverage float64 `json:"entity_coverage_percent"`
EmbeddingCoverage float64 `json:"embedding_coverage_percent"`
FullCoverage float64 `json:"full_coverage_percent"`
}
CoverageStats represents knowledge coverage statistics
type DayActivity ¶
type DayActivity struct {
Date string `json:"date"`
FileCount int64 `json:"file_count"`
CategoryBreakdown map[string]int `json:"category_breakdown"`
}
DayActivity represents modification activity for a single day
type Disambiguation ¶
type Disambiguation struct {
// contains filtered or unexported fields
}
Disambiguation handles entity normalization and merging
func NewDisambiguation ¶
func NewDisambiguation(client *Client, logger *slog.Logger) *Disambiguation
NewDisambiguation creates a new Disambiguation handler
func (*Disambiguation) AddAlias ¶
func (d *Disambiguation) AddAlias(alias, canonical string)
AddAlias adds a custom alias mapping
func (*Disambiguation) FindDuplicateEntities ¶
func (d *Disambiguation) FindDuplicateEntities(ctx context.Context) ([]DuplicateEntity, error)
FindDuplicateEntities finds entities that normalize to the same canonical form
func (*Disambiguation) FindSimilarEntities ¶
func (d *Disambiguation) FindSimilarEntities(ctx context.Context, name string, limit int) ([]SimilarEntity, error)
FindSimilarEntities finds entities similar to the given name Uses prefix matching, substring matching, and alias resolution
func (*Disambiguation) GetCanonicalName ¶
func (d *Disambiguation) GetCanonicalName(name string) string
GetCanonicalName returns the canonical name for an entity, resolving aliases
func (*Disambiguation) GetEntityVariants ¶
func (d *Disambiguation) GetEntityVariants(ctx context.Context, entityName string) ([]EntityVariant, error)
GetEntityVariants returns all variant names for an entity
func (*Disambiguation) MergeEntities ¶
func (d *Disambiguation) MergeEntities(ctx context.Context, sourceEntity, targetEntity string) (int64, error)
MergeEntities merges one entity into another, redirecting all relationships The source entity is deleted after merging
func (*Disambiguation) NormalizeAllEntities ¶
func (d *Disambiguation) NormalizeAllEntities(ctx context.Context) (int64, error)
NormalizeAllEntities applies normalization to all entities in the graph This updates the normalized field and merges entities that become duplicates
func (*Disambiguation) NormalizeEntityName ¶
func (d *Disambiguation) NormalizeEntityName(name string) string
NormalizeEntityName returns the canonical normalized form of an entity name
type DuplicateEntity ¶
type DuplicateEntity struct {
Entity1 string `json:"entity1"`
Entity2 string `json:"entity2"`
Normalized string `json:"normalized"`
FileCount1 int64 `json:"file_count1"`
FileCount2 int64 `json:"file_count2"`
}
DuplicateEntity represents a potential duplicate entity pair
type Edges ¶
type Edges struct {
// contains filtered or unexported fields
}
Edges handles edge (relationship) CRUD operations
func (*Edges) CleanupOrphanedNodes ¶
CleanupOrphanedNodes removes nodes that are no longer connected to any File
func (*Edges) GetFileEntities ¶
GetFileEntities returns all entities mentioned in a file
func (*Edges) GetFileReferences ¶
GetFileReferences returns all topics referenced by a file
func (*Edges) GetFileTags ¶
GetFileTags returns all tags for a file
func (*Edges) GetFileTopics ¶
GetFileTopics returns all topics for a file
func (*Edges) GetFilesMentioningEntity ¶
func (e *Edges) GetFilesMentioningEntity(ctx context.Context, entityName string) ([]FileNode, error)
GetFilesMentioningEntity returns all files mentioning a specific entity
func (*Edges) GetFilesWithTag ¶
GetFilesWithTag returns all files with a specific tag
func (*Edges) GetFilesWithTopic ¶
GetFilesWithTopic returns all files covering a specific topic
func (*Edges) GetSimilarFiles ¶
func (e *Edges) GetSimilarFiles(ctx context.Context, filePath string, limit int) ([]SimilarFile, error)
GetSimilarFiles returns files similar to the given file
func (*Edges) LinkDirectoryParent ¶
LinkDirectoryParent creates a PARENT_OF relationship between directories
func (*Edges) LinkFileToCategory ¶
LinkFileToCategory creates an IN_CATEGORY relationship between File and Category
func (*Edges) LinkFileToDirectory ¶
LinkFileToDirectory creates an IN_DIRECTORY relationship between File and Directory
func (*Edges) LinkFileToEntity ¶
func (e *Edges) LinkFileToEntity(ctx context.Context, filePath, entityName, entityType string) error
LinkFileToEntity creates a MENTIONS relationship between File and Entity
func (*Edges) LinkFileToReference ¶
func (e *Edges) LinkFileToReference(ctx context.Context, filePath, topicName, refType string, confidence float64) error
LinkFileToReference creates a REFERENCES relationship between File and Topic
func (*Edges) LinkFileToTag ¶
LinkFileToTag creates a HAS_TAG relationship between File and Tag
func (*Edges) LinkFileToTopic ¶
LinkFileToTopic creates a COVERS_TOPIC relationship between File and Topic
func (*Edges) LinkSimilarFiles ¶
func (e *Edges) LinkSimilarFiles(ctx context.Context, filePath1, filePath2 string, score float64) error
LinkSimilarFiles creates a SIMILAR_TO relationship between two files
func (*Edges) LinkTopicParent ¶
LinkTopicParent creates a PARENT_OF relationship between topics
type Entity ¶
type Entity struct {
Name string `json:"name"`
Type string `json:"type"` // technology, person, concept, organization
}
Entity represents an extracted entity
type EntityCount ¶
type EntityCount struct {
Name string `json:"name"`
Type string `json:"type"`
Count int64 `json:"count"`
}
EntityCount represents an entity with its mention count
type EntityInfo ¶
EntityInfo represents basic entity information
type EntityNode ¶
type EntityNode struct {
Name string `json:"name"`
Type string `json:"type"`
Normalized string `json:"normalized"`
}
EntityNode represents an Entity in the graph
type EntityStats ¶
type EntityStats struct {
Name string `json:"name"`
Type string `json:"type"`
FileCount int64 `json:"file_count"`
}
EntityStats represents entity statistics
type EntityVariant ¶
type EntityVariant struct {
Name string `json:"name"`
Type string `json:"type"`
Normalized string `json:"normalized"`
FileCount int64 `json:"file_count"`
}
EntityVariant represents a variant of an entity name
type ExportSummary ¶
type ExportSummary struct {
Generated time.Time `json:"generated"`
Root string `json:"root"`
TotalFiles int64 `json:"total_files"`
Categories map[string]int64 `json:"categories"`
TopTags []TagCount `json:"top_tags"`
TopTopics []TopicCount `json:"top_topics"`
TopEntities []EntityCount `json:"top_entities"`
RecentFiles []FileSummary `json:"recent_files,omitempty"`
}
ExportSummary exports a condensed summary suitable for context windows
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter handles exporting graph data to various formats
func NewExporter ¶
NewExporter creates a new Exporter
func (*Exporter) GetFileEntry ¶
func (e *Exporter) GetFileEntry(ctx context.Context, path string, relatedLimit int) (*types.FileEntry, error)
GetFileEntry retrieves a single file and returns it as a FileEntry with related files
func (*Exporter) ToGraphIndex ¶
func (e *Exporter) ToGraphIndex(ctx context.Context, memoryRoot string, verbose ...bool) (*types.GraphIndex, error)
ToGraphIndex exports the graph to a types.GraphIndex (new flattened format) This is the new graph-native format with FileEntry instead of nested IndexEntry When verbose is true, includes related files per entry and graph insights
type FileConnections ¶
type FileConnections struct {
FilePath string `json:"file_path"`
Tags []string `json:"tags"`
Topics []string `json:"topics"`
Entities []EntityInfo `json:"entities"`
Category string `json:"category"`
}
FileConnections represents all graph connections for a file
type FileHistory ¶
type FileHistory struct {
Path string `json:"path"`
LastModified time.Time `json:"last_modified"`
Category string `json:"category"`
CoEditedFiles []CoEditedFile `json:"co_edited_files,omitempty"`
}
FileHistory represents the modification history of a file
type FileMembership ¶
type FileMembership struct {
FilePath string `json:"file_path"`
TagClusters []ClusterMember `json:"tag_clusters"`
TopicClusters []ClusterMember `json:"topic_clusters"`
EntityClusters []ClusterMember `json:"entity_clusters"`
}
FileMembership represents which clusters a file belongs to
type FileNode ¶
type FileNode struct {
Path string `json:"path"`
Hash string `json:"hash"`
Name string `json:"name"`
Type string `json:"type"`
Category string `json:"category"`
Size int64 `json:"size"`
Modified time.Time `json:"modified"`
Summary string `json:"summary,omitempty"`
DocumentType string `json:"document_type,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
Embedding []float32 `json:"embedding,omitempty"`
}
FileNode represents a File node in the graph
func FileNodeFromEntry ¶
func FileNodeFromEntry(entry types.IndexEntry) FileNode
FileNodeFromEntry creates a FileNode from an IndexEntry
type FileSummary ¶
type FileSummary struct {
Path string `json:"path"`
Name string `json:"name"`
Category string `json:"category"`
Modified time.Time `json:"modified"`
Summary string `json:"summary,omitempty"`
}
FileSummary is a condensed file representation
type Gap ¶
type Gap struct {
Type string `json:"type"` // topic, entity, tag, category
Name string `json:"name"`
FileCount int64 `json:"file_count"`
Description string `json:"description"`
Severity string `json:"severity"` // low, medium, high
Suggestion string `json:"suggestion"`
}
Gap represents a knowledge gap in the graph
type GapAnalysis ¶
type GapAnalysis struct {
// contains filtered or unexported fields
}
GapAnalysis identifies gaps and areas needing more documentation
func NewGapAnalysis ¶
func NewGapAnalysis(client *Client, logger *slog.Logger) *GapAnalysis
NewGapAnalysis creates a new GapAnalysis handler
func (*GapAnalysis) AnalyzeGaps ¶
func (g *GapAnalysis) AnalyzeGaps(ctx context.Context) (*GapReport, error)
AnalyzeGaps performs a complete gap analysis
func (*GapAnalysis) FindEmptyCategories ¶
func (g *GapAnalysis) FindEmptyCategories(ctx context.Context) ([]Gap, error)
FindEmptyCategories finds categories with no files
func (*GapAnalysis) FindIsolatedFiles ¶
func (g *GapAnalysis) FindIsolatedFiles(ctx context.Context) ([]Gap, error)
FindIsolatedFiles finds files with no semantic connections
func (*GapAnalysis) FindMissingConnections ¶
func (g *GapAnalysis) FindMissingConnections(ctx context.Context, limit int) ([]MissingConnection, error)
FindMissingConnections finds files that should probably be connected based on content similarity
func (*GapAnalysis) FindOrphanedEntities ¶
func (g *GapAnalysis) FindOrphanedEntities(ctx context.Context) ([]Gap, error)
FindOrphanedEntities finds entities with no file mentions
func (*GapAnalysis) FindOrphanedTags ¶
func (g *GapAnalysis) FindOrphanedTags(ctx context.Context) ([]Gap, error)
FindOrphanedTags finds tags that are only associated with one file
func (*GapAnalysis) FindOrphanedTopics ¶
func (g *GapAnalysis) FindOrphanedTopics(ctx context.Context) ([]Gap, error)
FindOrphanedTopics finds topics with no file coverage
func (*GapAnalysis) FindUnderDocumentedEntities ¶
FindUnderDocumentedEntities finds entities mentioned in very few files
func (*GapAnalysis) FindUnderDocumentedTopics ¶
FindUnderDocumentedTopics finds topics that have fewer than minFiles files
func (*GapAnalysis) GetCoverageStats ¶
func (g *GapAnalysis) GetCoverageStats(ctx context.Context) (*CoverageStats, error)
GetCoverageStats returns statistics about knowledge coverage
type GapReport ¶
type GapReport struct {
UnderDocumentedTopics []Gap `json:"under_documented_topics"`
UnderDocumentedEntities []Gap `json:"under_documented_entities"`
OrphanedTags []Gap `json:"orphaned_tags"`
OrphanedTopics []Gap `json:"orphaned_topics"`
OrphanedEntities []Gap `json:"orphaned_entities"`
IsolatedFiles []Gap `json:"isolated_files"`
EmptyCategories []Gap `json:"empty_categories"`
TotalGaps int `json:"total_gaps"`
}
GapReport contains the full gap analysis results
type GraphOverview ¶
type GraphOverview struct {
FileCount int64 `json:"file_count"`
TagCount int64 `json:"tag_count"`
TopicCount int64 `json:"topic_count"`
EntityCount int64 `json:"entity_count"`
RelationshipCount int64 `json:"relationship_count"`
CategoryDistribution map[string]int64 `json:"category_distribution"`
}
GraphOverview contains high-level graph statistics
type GraphStats ¶
type GraphStats struct {
NodeCount int64 `json:"node_count"`
RelationshipCount int64 `json:"relationship_count"`
LabelCount int `json:"label_count"`
}
GraphStats represents graph statistics
type HealthStatus ¶
type HealthStatus struct {
Connected bool `json:"connected"`
Database string `json:"database"`
Error string `json:"error,omitempty"`
Stats *GraphStats `json:"stats,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
HealthStatus represents the health of the FalkorDB connection
type IndexInfo ¶
type IndexInfo struct {
Name string `json:"name"`
Label string `json:"label,omitempty"`
Property string `json:"property,omitempty"`
Type string `json:"type,omitempty"`
}
IndexInfo represents information about an index
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager orchestrates all graph operations
func NewManager ¶
func NewManager(config ManagerConfig, logger *slog.Logger) *Manager
NewManager creates a new GraphManager
func (*Manager) AnalyzeGaps ¶
AnalyzeGaps performs a complete gap analysis
func (*Manager) ClearGraph ¶
ClearGraph removes all data from the graph
func (*Manager) Clusters ¶
func (m *Manager) Clusters() *ClusterDetection
Clusters returns the ClusterDetection handler for cluster operations
func (*Manager) DetectEntityClusters ¶
DetectEntityClusters finds clusters based on shared entities
func (*Manager) DetectTagClusters ¶
DetectTagClusters finds clusters based on shared tags
func (*Manager) DetectTopicClusters ¶
DetectTopicClusters finds clusters based on shared topics
func (*Manager) Disambiguation ¶
func (m *Manager) Disambiguation() *Disambiguation
Disambiguation returns the Disambiguation handler for entity operations
func (*Manager) FindCoModifiedFiles ¶
func (m *Manager) FindCoModifiedFiles(ctx context.Context, windowMinutes int, limit int) ([]CoModifiedPair, error)
FindCoModifiedFiles finds files that were modified within the same time window
func (*Manager) FindDuplicateEntities ¶
func (m *Manager) FindDuplicateEntities(ctx context.Context) ([]DuplicateEntity, error)
FindDuplicateEntities finds entities that might be duplicates
func (*Manager) FindFileClusterMembership ¶
func (m *Manager) FindFileClusterMembership(ctx context.Context, filePath string) (*FileMembership, error)
FindFileClusterMembership returns which clusters a file belongs to
func (*Manager) FindIsolatedFiles ¶
FindIsolatedFiles finds files with no semantic connections
func (*Manager) FindMissingConnections ¶
func (m *Manager) FindMissingConnections(ctx context.Context, limit int) ([]MissingConnection, error)
FindMissingConnections finds files that might need to be connected
func (*Manager) FindSimilarEntities ¶
func (m *Manager) FindSimilarEntities(ctx context.Context, name string, limit int) ([]SimilarEntity, error)
FindSimilarEntities finds entities similar to the given name
func (*Manager) GapAnalysis ¶
func (m *Manager) GapAnalysis() *GapAnalysis
GapAnalysis returns the GapAnalysis handler for gap detection
func (*Manager) GetActivityHotspots ¶
func (m *Manager) GetActivityHotspots(ctx context.Context, days int, limit int) ([]ActivityHotspot, error)
GetActivityHotspots finds files or areas with high modification activity
func (*Manager) GetClusterSummary ¶
func (m *Manager) GetClusterSummary(ctx context.Context) (*ClusterSummary, error)
GetClusterSummary returns high-level statistics about knowledge clusters
func (*Manager) GetCoverageStats ¶
func (m *Manager) GetCoverageStats(ctx context.Context) (*CoverageStats, error)
GetCoverageStats returns knowledge coverage statistics
func (*Manager) GetEntityVariants ¶
func (m *Manager) GetEntityVariants(ctx context.Context, entityName string) ([]EntityVariant, error)
GetEntityVariants returns all variant names for an entity
func (*Manager) GetFileConnections ¶
func (m *Manager) GetFileConnections(ctx context.Context, filePath string) (*FileConnections, error)
GetFileConnections returns all connections for a file
func (*Manager) GetFileModificationHistory ¶
func (m *Manager) GetFileModificationHistory(ctx context.Context, filePath string) (*FileHistory, error)
GetFileModificationHistory returns the modification pattern for a specific file
func (*Manager) GetModificationTimeline ¶
GetModificationTimeline returns a timeline of modifications grouped by day
func (*Manager) GetRecentFiles ¶
GetRecentFiles returns recently modified files
func (*Manager) GetRecentModifications ¶
func (m *Manager) GetRecentModifications(ctx context.Context, since time.Time, limit int) ([]ModificationEvent, error)
GetRecentModifications returns files modified within a time window
func (*Manager) GetRelatedFiles ¶
func (m *Manager) GetRelatedFiles(ctx context.Context, filePath string, limit int) ([]RelatedFile, error)
GetRelatedFiles returns files related to the given file
func (*Manager) GetStaleFiles ¶
GetStaleFiles finds files that haven't been modified in a long time
func (*Manager) GetTemporalStats ¶
func (m *Manager) GetTemporalStats(ctx context.Context) (*TemporalStats, error)
GetTemporalStats returns overall temporal statistics
func (*Manager) Health ¶
func (m *Manager) Health(ctx context.Context) (*HealthStatus, error)
Health returns health status
func (*Manager) Initialize ¶
Initialize connects to FalkorDB and sets up the schema
func (*Manager) IsConnected ¶
IsConnected returns whether the manager is connected
func (*Manager) MergeEntities ¶
MergeEntities merges one entity into another
func (*Manager) NormalizeEntities ¶
NormalizeEntities runs entity normalization and deduplication across the graph
func (*Manager) RecommendByContext ¶
func (m *Manager) RecommendByContext(ctx context.Context, contextFiles []string, limit int) ([]Recommendation, error)
RecommendByContext recommends files based on multiple context files
func (*Manager) RecommendRelated ¶
func (m *Manager) RecommendRelated(ctx context.Context, filePath string, limit int) ([]Recommendation, error)
RecommendRelated recommends files related to the given file
func (*Manager) Recommendations ¶
func (m *Manager) Recommendations() *Recommendations
Recommendations returns the Recommendations handler for file recommendations
func (*Manager) RemoveFile ¶
RemoveFile removes a file from the graph
func (*Manager) Search ¶
func (m *Manager) Search(ctx context.Context, query string, limit int, categoryFilter string) ([]SearchResult, error)
Search performs a combined search across multiple dimensions
func (*Manager) Temporal ¶
func (m *Manager) Temporal() *TemporalTracking
Temporal returns the TemporalTracking handler for temporal analysis
func (*Manager) TopConnectedFiles ¶
TopConnectedFiles returns the most connected files in the graph
func (*Manager) UpdateSingle ¶
func (m *Manager) UpdateSingle(ctx context.Context, entry types.IndexEntry, info UpdateInfo) (UpdateResult, error)
UpdateSingle updates a single file entry in the graph
func (*Manager) UpdateSingleWithEmbedding ¶
func (m *Manager) UpdateSingleWithEmbedding(ctx context.Context, entry types.IndexEntry, info UpdateInfo, embedding []float32) (UpdateResult, error)
UpdateSingleWithEmbedding updates a single file entry in the graph with an embedding vector
func (*Manager) UpdateSingleWithEntities ¶
func (m *Manager) UpdateSingleWithEntities(ctx context.Context, entry types.IndexEntry, entities []Entity, references []ReferenceInfo) (UpdateResult, error)
UpdateSingleWithEntities updates a file with enhanced semantic analysis including entities
func (*Manager) VectorSearch ¶
func (m *Manager) VectorSearch(ctx context.Context, embedding []float32, limit int) ([]SearchResult, error)
VectorSearch performs vector similarity search
type ManagerConfig ¶
type ManagerConfig struct {
Client ClientConfig
Schema SchemaConfig
MemoryRoot string
}
ManagerConfig contains configuration for the GraphManager
func DefaultManagerConfig ¶
func DefaultManagerConfig() ManagerConfig
DefaultManagerConfig returns default manager configuration
type MissingConnection ¶
type MissingConnection struct {
File1Path string `json:"file1_path"`
File1Name string `json:"file1_name"`
File2Path string `json:"file2_path"`
File2Name string `json:"file2_name"`
Reason string `json:"reason"`
}
MissingConnection represents two files that might need to be connected
type ModificationEvent ¶
type ModificationEvent struct {
Path string `json:"path"`
Name string `json:"name"`
Modified time.Time `json:"modified"`
Category string `json:"category"`
}
ModificationEvent represents a file modification event
type Nodes ¶
type Nodes struct {
// contains filtered or unexported fields
}
Nodes handles node CRUD operations
func (*Nodes) CountFiles ¶
CountFiles returns the total number of File nodes
func (*Nodes) DeleteFile ¶
DeleteFile removes a File node and all its relationships
func (*Nodes) FileExists ¶
FileExists checks if a file exists by path
func (*Nodes) GetCategory ¶
GetCategory retrieves a Category node by name
func (*Nodes) GetFile ¶
GetFile retrieves a File node by path or filename If path is absolute, searches by exact path match If path is relative (no leading /), searches by filename
func (*Nodes) GetFileByFilename ¶
GetFileByFilename retrieves a File node by filename (searches by name field)
func (*Nodes) GetFileByHash ¶
GetFileByHash retrieves a File node by content hash
func (*Nodes) GetOrCreateDirectory ¶
GetOrCreateDirectory gets or creates a Directory node
func (*Nodes) GetOrCreateEntity ¶
GetOrCreateEntity gets or creates an Entity node
func (*Nodes) GetOrCreateTag ¶
GetOrCreateTag gets or creates a Tag node
func (*Nodes) GetOrCreateTopic ¶
GetOrCreateTopic gets or creates a Topic node
func (*Nodes) ListEntities ¶
func (n *Nodes) ListEntities(ctx context.Context) ([]EntityNode, error)
ListEntities returns all Entity nodes
func (*Nodes) ListTopics ¶
ListTopics returns all Topic names
func (*Nodes) UpsertFile ¶
UpsertFile creates or updates a File node
type OverlapFile ¶
type OverlapFile struct {
Path string `json:"path"`
Name string `json:"name"`
Summary string `json:"summary"`
Category string `json:"category"`
TagCount int64 `json:"tag_count"`
TopicCount int64 `json:"topic_count"`
EntityCount int64 `json:"entity_count"`
Tags []string `json:"tags"`
Topics []string `json:"topics"`
Entities []string `json:"entities"`
}
OverlapFile represents a file that spans multiple clusters
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
Queries provides common query patterns for the knowledge graph
func NewQueries ¶
NewQueries creates a new Queries handler
func (*Queries) FindFilesWithSharedEntities ¶
func (q *Queries) FindFilesWithSharedEntities(ctx context.Context, filePath string, limit int) ([]SharedEntityFile, error)
FindFilesWithSharedEntities finds files that share entities with the given file
func (*Queries) FullTextSearch ¶
func (q *Queries) FullTextSearch(ctx context.Context, searchText string, limit int) ([]SearchResult, error)
FullTextSearch performs full-text search on file summaries
func (*Queries) GetFileConnections ¶
func (q *Queries) GetFileConnections(ctx context.Context, filePath string) (*FileConnections, error)
GetFileConnections returns all connections for a file
func (*Queries) GetGraphOverview ¶
func (q *Queries) GetGraphOverview(ctx context.Context) (*GraphOverview, error)
GetGraphOverview returns high-level statistics about the graph
func (*Queries) GetRecentFiles ¶
GetRecentFiles returns recently modified files
func (*Queries) GetRelatedFiles ¶
func (q *Queries) GetRelatedFiles(ctx context.Context, filePath string, limit int) ([]RelatedFile, error)
GetRelatedFiles finds files related to a given file through shared tags/topics/entities
func (*Queries) SearchByCategory ¶
func (q *Queries) SearchByCategory(ctx context.Context, category string, limit int) ([]SearchResult, error)
SearchByCategory returns files in a category
func (*Queries) SearchByEntity ¶
func (q *Queries) SearchByEntity(ctx context.Context, entityName string, limit int) ([]SearchResult, error)
SearchByEntity searches files mentioning an entity
func (*Queries) SearchByFilename ¶
func (q *Queries) SearchByFilename(ctx context.Context, pattern string, limit int) ([]SearchResult, error)
SearchByFilename searches files by filename substring
func (*Queries) SearchByTag ¶
func (q *Queries) SearchByTag(ctx context.Context, tagName string, limit int) ([]SearchResult, error)
SearchByTag searches files by tag
func (*Queries) SearchByTopic ¶
func (q *Queries) SearchByTopic(ctx context.Context, topicName string, limit int) ([]SearchResult, error)
SearchByTopic searches files by topic
func (*Queries) VectorSearch ¶
func (q *Queries) VectorSearch(ctx context.Context, embedding []float32, limit int) ([]SearchResult, error)
VectorSearch performs similarity search using embeddings
type QueryResult ¶
type QueryResult struct {
// contains filtered or unexported fields
}
QueryResult wraps FalkorDB query result for easier access
func (*QueryResult) Empty ¶
func (qr *QueryResult) Empty() bool
Empty returns true if result has no records
type Recommendation ¶
type Recommendation struct {
Path string `json:"path"`
Name string `json:"name"`
Summary string `json:"summary"`
Category string `json:"category"`
Score float64 `json:"score"`
Reasons []string `json:"reasons"`
}
Recommendation represents a recommended file with explanation
type RecommendationWeights ¶
type RecommendationWeights struct {
SameCategory float64 // Weight for same category
SameDirectory float64 // Weight for same directory
Similarity float64 // Weight for embedding similarity
}
RecommendationWeights configures the importance of different graph signals
func DefaultRecommendationWeights ¶
func DefaultRecommendationWeights() RecommendationWeights
DefaultRecommendationWeights returns sensible default weights
type Recommendations ¶
type Recommendations struct {
// contains filtered or unexported fields
}
Recommendations provides file recommendation capabilities
func NewRecommendations ¶
func NewRecommendations(client *Client, logger *slog.Logger) *Recommendations
NewRecommendations creates a new Recommendations handler
func (*Recommendations) RecommendByContext ¶
func (r *Recommendations) RecommendByContext(ctx context.Context, contextFiles []string, limit int) ([]Recommendation, error)
RecommendByContext recommends files based on multiple context files Useful for "what should I read next" given current working context
func (*Recommendations) RecommendRelated ¶
func (r *Recommendations) RecommendRelated(ctx context.Context, filePath string, limit int) ([]Recommendation, error)
RecommendRelated recommends files related to the given file Uses graph proximity with weighted scoring
func (*Recommendations) SetWeights ¶
func (r *Recommendations) SetWeights(weights RecommendationWeights)
SetWeights updates the recommendation weights
func (*Recommendations) TopConnectedFiles ¶
func (r *Recommendations) TopConnectedFiles(ctx context.Context, limit int) ([]ConnectedFile, error)
TopConnectedFiles returns the most connected files in the graph These are files that have the most relationships to other entities
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record wraps FalkorDB record for easier access
func (*Record) GetByIndex ¶
GetByIndex returns value at index
func (*Record) GetFloat64 ¶
GetFloat64 returns float64 value at index, with default fallback
type Reference ¶
type Reference struct {
Topic string `json:"topic"`
RefType string `json:"ref_type"`
Confidence float64 `json:"confidence"`
}
Reference represents a reference relationship
type ReferenceInfo ¶
type ReferenceInfo struct {
Topic string `json:"topic"`
RefType string `json:"ref_type"` // requires, extends, related-to
Confidence float64 `json:"confidence"`
}
ReferenceInfo represents a reference to a topic
type RelatedFile ¶
type RelatedFile struct {
Path string `json:"path"`
Name string `json:"name"`
Summary string `json:"summary"`
Strength int64 `json:"strength"`
ConnectionType string `json:"connection_type"`
}
RelatedFile represents a file related to another
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema handles graph schema initialization and management
func NewSchema ¶
func NewSchema(client *Client, config SchemaConfig, logger *slog.Logger) *Schema
NewSchema creates a new Schema manager
func (*Schema) ClearGraph ¶
ClearGraph removes all nodes and relationships
func (*Schema) DropAllIndexes ¶
DropAllIndexes removes all indexes (useful for schema migration)
func (*Schema) GetIndexes ¶
GetIndexes returns information about existing indexes
func (*Schema) Initialize ¶
Initialize creates all necessary schema components
type SchemaConfig ¶
type SchemaConfig struct {
// Vector index settings
EmbeddingDimensions int // Default: 1536 for OpenAI text-embedding-3-small
SimilarityFunction string // "cosine" or "euclidean", default: "cosine"
VectorIndexM int // HNSW M parameter, default: 16
VectorIndexEfConstruct int // HNSW efConstruction, default: 200
}
SchemaConfig contains schema configuration settings
func DefaultSchemaConfig ¶
func DefaultSchemaConfig() SchemaConfig
DefaultSchemaConfig returns default schema configuration
type SearchResult ¶
type SearchResult struct {
Path string `json:"path"`
Name string `json:"name"`
Type string `json:"type"`
Category string `json:"category"`
Summary string `json:"summary"`
DocumentType string `json:"document_type"`
Score float64 `json:"score,omitempty"`
MatchType string `json:"match_type,omitempty"`
Tags []string `json:"tags,omitempty"`
Topics []string `json:"topics,omitempty"`
}
SearchResult represents a file search result
type SharedEntityFile ¶
type SharedEntityFile struct {
}
SharedEntityFile represents a file that shares entities with another
type SimilarEntity ¶
type SimilarEntity struct {
Name string `json:"name"`
Type string `json:"type"`
Normalized string `json:"normalized"`
FileCount int64 `json:"file_count"`
Similarity float64 `json:"similarity"`
MatchReason string `json:"match_reason"`
}
SimilarEntity represents an entity that might be similar to a query
type SimilarFile ¶
type SimilarFile struct {
Path string `json:"path"`
Name string `json:"name"`
Summary string `json:"summary"`
Score float64 `json:"score"`
}
SimilarFile represents a file with similarity score
type StaleFile ¶
type StaleFile struct {
Path string `json:"path"`
Name string `json:"name"`
Modified time.Time `json:"modified"`
Category string `json:"category"`
DaysSinceModification int `json:"days_since_modification"`
}
StaleFile represents a file that hasn't been modified recently
type Stats ¶
type Stats struct {
TotalFiles int64 `json:"total_files"`
TotalTags int64 `json:"total_tags"`
TotalTopics int64 `json:"total_topics"`
TotalEntities int64 `json:"total_entities"`
TotalEdges int64 `json:"total_edges"`
Categories map[string]int64 `json:"categories"`
}
Stats represents graph statistics
type TemporalStats ¶
type TemporalStats struct {
TotalFiles int64 `json:"total_files"`
OldestFile time.Time `json:"oldest_file"`
NewestFile time.Time `json:"newest_file"`
ActivityWindows map[string]int64 `json:"activity_windows"`
}
TemporalStats contains overall temporal statistics
type TemporalTracking ¶
type TemporalTracking struct {
// contains filtered or unexported fields
}
TemporalTracking provides file modification pattern analysis
func NewTemporalTracking ¶
func NewTemporalTracking(client *Client, logger *slog.Logger) *TemporalTracking
NewTemporalTracking creates a new TemporalTracking handler
func (*TemporalTracking) FindCoModifiedFiles ¶
func (t *TemporalTracking) FindCoModifiedFiles(ctx context.Context, windowMinutes int, limit int) ([]CoModifiedPair, error)
FindCoModifiedFiles finds files that were modified within the same time window windowMinutes defines how close modifications must be to be considered "co-modified"
func (*TemporalTracking) GetActivityHotspots ¶
func (t *TemporalTracking) GetActivityHotspots(ctx context.Context, days int, limit int) ([]ActivityHotspot, error)
GetActivityHotspots finds files or areas with high modification activity
func (*TemporalTracking) GetFileModificationHistory ¶
func (t *TemporalTracking) GetFileModificationHistory(ctx context.Context, filePath string) (*FileHistory, error)
GetFileModificationHistory returns the modification pattern for a specific file
func (*TemporalTracking) GetModificationTimeline ¶
func (t *TemporalTracking) GetModificationTimeline(ctx context.Context, days int) ([]DayActivity, error)
GetModificationTimeline returns a timeline of modifications grouped by day
func (*TemporalTracking) GetRecentModifications ¶
func (t *TemporalTracking) GetRecentModifications(ctx context.Context, since time.Time, limit int) ([]ModificationEvent, error)
GetRecentModifications returns files modified within a time window
func (*TemporalTracking) GetStaleFiles ¶
func (t *TemporalTracking) GetStaleFiles(ctx context.Context, staleDays int, limit int) ([]StaleFile, error)
GetStaleFiles finds files that haven't been modified in a long time
func (*TemporalTracking) GetTemporalStats ¶
func (t *TemporalTracking) GetTemporalStats(ctx context.Context) (*TemporalStats, error)
GetTemporalStats returns overall temporal statistics
type TopicCount ¶
TopicCount represents a topic with its usage count
type TopicStats ¶
TopicStats represents topic statistics
type UpdateInfo ¶
type UpdateInfo struct {
WasAnalyzed bool // true if semantic analysis was performed (API call)
WasCached bool // true if cached analysis was used
HadError bool // true if there was an error processing this file
}
UpdateInfo provides context about the entry being updated
type UpdateResult ¶
type UpdateResult struct {
Added bool // true if new entry was added (vs updated)
Updated bool // true if existing entry was modified
}
UpdateResult contains information about what the update operation did