Documentation
¶
Index ¶
- func Register(s *mcp.Server, sc DocumentScanner, graph GraphStore, search ContentSearcher, ...)
- type AddObservationsArgs
- type AddObservationsResult
- type ContentSearcher
- type CreateEntitiesArgs
- type CreateEntitiesResult
- type CreateRelationsArgs
- type CreateRelationsResult
- type DeleteEntitiesArgs
- type DeleteObservationsArgs
- type DeleteRelationsArgs
- type DocAccess
- type DocMetrics
- type DocumentScanner
- type FindPathArgs
- type FindPathResult
- type GetFileContentArgs
- type GraphAuditLogger
- func (a *GraphAuditLogger) AddObservations(observations []memory.Observation) ([]memory.Observation, error)
- func (a *GraphAuditLogger) CreateEntities(entities []memory.Entity) ([]memory.Entity, error)
- func (a *GraphAuditLogger) CreateRelations(relations []memory.Relation) ([]memory.Relation, error)
- func (a *GraphAuditLogger) DeleteEntities(entityNames []string) error
- func (a *GraphAuditLogger) DeleteObservations(deletions []memory.Observation) error
- func (a *GraphAuditLogger) DeleteRelations(relations []memory.Relation) error
- func (a *GraphAuditLogger) EntityCount() (int64, error)
- func (a *GraphAuditLogger) EntityTypeCounts() (map[string]int64, error)
- func (a *GraphAuditLogger) FindPath(from, to string, maxDepth int) ([]memory.PathEdge, error)
- func (a *GraphAuditLogger) GetIntegrationMap(ctx context.Context, service string, depth int) (memory.IntegrationMap, error)
- func (a *GraphAuditLogger) ListEntities(entityType string) (memory.KnowledgeGraph, error)
- func (a *GraphAuditLogger) ListRelations(relationType, fromEntity string) ([]memory.Relation, error)
- func (a *GraphAuditLogger) OpenNodes(names []string) (memory.KnowledgeGraph, error)
- func (a *GraphAuditLogger) OpenNodesFiltered(names []string, includeArchived bool) (memory.KnowledgeGraph, error)
- func (a *GraphAuditLogger) ReadGraph() (memory.KnowledgeGraph, error)
- func (a *GraphAuditLogger) SearchNodes(query string) (memory.KnowledgeGraph, error)
- func (a *GraphAuditLogger) SearchNodesFiltered(query string, includeArchived bool) (memory.KnowledgeGraph, error)
- func (a *GraphAuditLogger) TraverseGraph(entity, relationType, direction string, maxDepth int) ([]memory.TraverseNode, error)
- func (a *GraphAuditLogger) UpdateEntity(oldName, newName, newType string) error
- type GraphStore
- type IntegrationEdgeJSON
- type IntegrationMapArgs
- type IntegrationMapResult
- type ListEntitiesArgs
- type ListRelationsArgs
- type ListRelationsResult
- type ListReposArgs
- type ListReposResult
- type OpenNodesArgs
- type RawContentResult
- type ScanStatusArgs
- type ScanStatusResult
- type SearchContentArgs
- type SearchContentResult
- type SearchDocsArgs
- type SearchDocsResult
- type SearchNodesArgs
- type SemanticSearch
- type SemanticSearchArgs
- type SemanticSearchResult
- type SkippedObservation
- type ToolMetrics
- type TraverseGraphArgs
- type TraverseGraphResult
- type TriggerScanArgs
- type TriggerScanResult
- type UpdateEntityArgs
- type UpdateEntityResult
- type UsageStatsArgs
- type UsageStatsResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(s *mcp.Server, sc DocumentScanner, graph GraphStore, search ContentSearcher, semantic SemanticSearch, metrics *ToolMetrics, docMetrics *DocMetrics, readOnly bool)
Types ¶
type AddObservationsArgs ¶
type AddObservationsArgs struct {
Observations []memory.Observation `json:"observations" jsonschema:"observations to add"`
}
type AddObservationsResult ¶
type AddObservationsResult struct {
Observations []memory.Observation `json:"observations"`
Skipped []SkippedObservation `json:"skipped,omitempty"`
}
type ContentSearcher ¶
type CreateEntitiesArgs ¶
type CreateEntitiesResult ¶
type CreateEntitiesResult struct {
Entities []memory.Entity `json:"entities"`
Skipped []SkippedObservation `json:"skipped,omitempty"`
}
type CreateRelationsArgs ¶
type CreateRelationsResult ¶
type DeleteEntitiesArgs ¶
type DeleteObservationsArgs ¶
type DeleteObservationsArgs struct {
Deletions []memory.Observation `json:"deletions" jsonschema:"observations to delete"`
}
type DeleteRelationsArgs ¶
type DocAccess ¶
type DocAccess struct {
Repo string `json:"repo"`
Path string `json:"path"`
Count int64 `json:"count"`
}
DocAccess holds access statistics for a single indexed document.
type DocMetrics ¶
type DocMetrics struct {
// contains filtered or unexported fields
}
DocMetrics tracks how many times each indexed document has been fetched or returned in search results, keyed by "repo\tpath".
func NewDocMetrics ¶
func NewDocMetrics() *DocMetrics
NewDocMetrics returns a new, empty DocMetrics instance.
func (*DocMetrics) Record ¶
func (d *DocMetrics) Record(repo, path string)
Record increments the access counter for a specific repo+path pair.
func (*DocMetrics) TopN ¶
func (d *DocMetrics) TopN(n int) []DocAccess
TopN returns up to n documents sorted by access count descending. Pass n <= 0 to return all tracked documents.
type DocumentScanner ¶
type FindPathArgs ¶
type FindPathResult ¶
type GetFileContentArgs ¶
type GraphAuditLogger ¶
type GraphAuditLogger struct {
// contains filtered or unexported fields
}
func NewGraphAuditLogger ¶
func NewGraphAuditLogger(inner GraphStore) *GraphAuditLogger
func (*GraphAuditLogger) AddObservations ¶
func (a *GraphAuditLogger) AddObservations(observations []memory.Observation) ([]memory.Observation, error)
func (*GraphAuditLogger) CreateEntities ¶
func (*GraphAuditLogger) CreateRelations ¶
func (*GraphAuditLogger) DeleteEntities ¶
func (a *GraphAuditLogger) DeleteEntities(entityNames []string) error
func (*GraphAuditLogger) DeleteObservations ¶
func (a *GraphAuditLogger) DeleteObservations(deletions []memory.Observation) error
func (*GraphAuditLogger) DeleteRelations ¶
func (a *GraphAuditLogger) DeleteRelations(relations []memory.Relation) error
func (*GraphAuditLogger) EntityCount ¶
func (a *GraphAuditLogger) EntityCount() (int64, error)
func (*GraphAuditLogger) EntityTypeCounts ¶
func (a *GraphAuditLogger) EntityTypeCounts() (map[string]int64, error)
func (*GraphAuditLogger) GetIntegrationMap ¶
func (a *GraphAuditLogger) GetIntegrationMap(ctx context.Context, service string, depth int) (memory.IntegrationMap, error)
func (*GraphAuditLogger) ListEntities ¶
func (a *GraphAuditLogger) ListEntities(entityType string) (memory.KnowledgeGraph, error)
func (*GraphAuditLogger) ListRelations ¶
func (a *GraphAuditLogger) ListRelations(relationType, fromEntity string) ([]memory.Relation, error)
func (*GraphAuditLogger) OpenNodes ¶
func (a *GraphAuditLogger) OpenNodes(names []string) (memory.KnowledgeGraph, error)
func (*GraphAuditLogger) OpenNodesFiltered ¶
func (a *GraphAuditLogger) OpenNodesFiltered(names []string, includeArchived bool) (memory.KnowledgeGraph, error)
func (*GraphAuditLogger) ReadGraph ¶
func (a *GraphAuditLogger) ReadGraph() (memory.KnowledgeGraph, error)
func (*GraphAuditLogger) SearchNodes ¶
func (a *GraphAuditLogger) SearchNodes(query string) (memory.KnowledgeGraph, error)
func (*GraphAuditLogger) SearchNodesFiltered ¶
func (a *GraphAuditLogger) SearchNodesFiltered(query string, includeArchived bool) (memory.KnowledgeGraph, error)
func (*GraphAuditLogger) TraverseGraph ¶
func (a *GraphAuditLogger) TraverseGraph(entity, relationType, direction string, maxDepth int) ([]memory.TraverseNode, error)
func (*GraphAuditLogger) UpdateEntity ¶
func (a *GraphAuditLogger) UpdateEntity(oldName, newName, newType string) error
type GraphStore ¶
type GraphStore interface {
CreateEntities(entities []memory.Entity) ([]memory.Entity, error)
CreateRelations(relations []memory.Relation) ([]memory.Relation, error)
AddObservations(observations []memory.Observation) ([]memory.Observation, error)
DeleteEntities(entityNames []string) error
DeleteObservations(deletions []memory.Observation) error
DeleteRelations(relations []memory.Relation) error
ReadGraph() (memory.KnowledgeGraph, error)
SearchNodes(query string) (memory.KnowledgeGraph, error)
SearchNodesFiltered(query string, includeArchived bool) (memory.KnowledgeGraph, error)
OpenNodes(names []string) (memory.KnowledgeGraph, error)
OpenNodesFiltered(names []string, includeArchived bool) (memory.KnowledgeGraph, error)
EntityCount() (int64, error)
EntityTypeCounts() (map[string]int64, error)
TraverseGraph(entity, relationType, direction string, maxDepth int) ([]memory.TraverseNode, error)
GetIntegrationMap(ctx context.Context, service string, depth int) (memory.IntegrationMap, error)
ListEntities(entityType string) (memory.KnowledgeGraph, error)
ListRelations(relationType, fromEntity string) ([]memory.Relation, error)
FindPath(from, to string, maxDepth int) ([]memory.PathEdge, error)
UpdateEntity(oldName, newName, newType string) error
}
type IntegrationEdgeJSON ¶
type IntegrationMapArgs ¶
type IntegrationMapResult ¶
type IntegrationMapResult struct {
Service string `json:"service"`
Publishes []IntegrationEdgeJSON `json:"publishes"`
Subscribes []IntegrationEdgeJSON `json:"subscribes"`
ExposesAPI []IntegrationEdgeJSON `json:"exposes_api"`
ProvidesGRPC []IntegrationEdgeJSON `json:"provides_grpc"`
GRPCDeps []IntegrationEdgeJSON `json:"grpc_deps"`
Calls []IntegrationEdgeJSON `json:"calls"`
Coverage string `` /* 138-byte string literal not displayed */
}
type ListEntitiesArgs ¶
type ListEntitiesArgs struct {
EntityType string `` /* 202-byte string literal not displayed */
}
type ListRelationsArgs ¶
type ListRelationsResult ¶
type ListReposArgs ¶
type ListReposArgs struct {
FileType string `` /* 221-byte string literal not displayed */
}
type ListReposResult ¶
type ListReposResult struct {
Repos []repoSummary `json:"repos" jsonschema:"List of repositories with documentation"`
}
type OpenNodesArgs ¶
type RawContentResult ¶
type RawContentResult struct {
Content string `json:"content" jsonschema:"The raw text content of the file."`
}
type ScanStatusArgs ¶
type ScanStatusArgs struct{}
type ScanStatusResult ¶
type ScanStatusResult struct {
Scanning bool `json:"scanning"`
LastScanAt time.Time `json:"last_scan_at"`
RepoCount int `json:"repo_count"`
ContentIndexed int64 `json:"content_indexed"`
GraphEntities int64 `json:"graph_entities"`
ContentEnabled bool `json:"content_enabled"`
EntityBreakdown map[string]int64 `json:"entity_breakdown,omitempty"`
SearchMode string `json:"search_mode,omitempty"`
ReadOnly bool `json:"read_only"`
}
type SearchContentArgs ¶
type SearchContentResult ¶
type SearchContentResult struct {
Matches []memory.ContentMatch `json:"matches" jsonschema:"List of files containing the query term, with a snippet showing the matched context."`
}
type SearchDocsArgs ¶
type SearchDocsResult ¶
type SearchNodesArgs ¶
type SemanticSearch ¶
type SemanticSearch interface {
Enabled() bool
SearchDocs(ctx context.Context, query, repo string, topK int) ([]embeddings.DocResult, int, error)
SearchEntities(ctx context.Context, query string, topK int) ([]embeddings.EntityResult, int, error)
ScheduleIndexEntities(names []string)
IndexDocs(ctx context.Context, repo string)
}
type SemanticSearchArgs ¶
type SemanticSearchArgs struct {
Query string `json:"query" jsonschema:"Natural-language search query. Required."`
Target string `` /* 139-byte string literal not displayed */
TopK int `json:"top_k,omitempty" jsonschema:"Maximum number of results per target (default 5, max 20)."`
Repo string `` /* 130-byte string literal not displayed */
}
type SemanticSearchResult ¶
type SemanticSearchResult struct {
ContentResults []embeddings.DocResult `json:"content_results,omitempty"`
EntityResults []embeddings.EntityResult `json:"entity_results,omitempty"`
StaleDocs int `json:"stale_docs"`
StaleEntities int `json:"stale_entities"`
}
type SkippedObservation ¶
type SkippedObservation struct {
EntityName string `json:"entity_name"`
Observation string `json:"observation"`
Reason string `json:"reason"`
}
SkippedObservation records a rejected observation along with the reason it was filtered.
type ToolMetrics ¶
type ToolMetrics struct {
// contains filtered or unexported fields
}
ToolMetrics tracks call counts per MCP tool name in a thread-safe manner.
func NewToolMetrics ¶
func NewToolMetrics() *ToolMetrics
NewToolMetrics returns a new, empty ToolMetrics instance.
func (*ToolMetrics) Record ¶
func (m *ToolMetrics) Record(toolName string)
Record increments the call counter for the given tool name.
func (*ToolMetrics) Snapshot ¶
func (m *ToolMetrics) Snapshot() map[string]int64
Snapshot returns a point-in-time copy of all tool call counts.
type TraverseGraphArgs ¶
type TraverseGraphResult ¶
type TraverseGraphResult struct {
StartEntity string `json:"start_entity"`
Nodes []memory.TraverseNode `json:"nodes"`
TotalFound int `json:"total_found"`
}
type TriggerScanArgs ¶
type TriggerScanArgs struct{}
type TriggerScanResult ¶
type UpdateEntityArgs ¶
type UpdateEntityArgs struct {
Name string `json:"name" jsonschema:"Current name of the entity to update. Must match exactly."`
NewName string `` /* 157-byte string literal not displayed */
NewType string `json:"new_type,omitempty" jsonschema:"New entity type (e.g. 'service', 'team', 'api'). Omit to keep the current type."`
}
type UpdateEntityResult ¶
type UsageStatsArgs ¶
type UsageStatsArgs struct{}
UsageStatsArgs has no parameters — the tool returns all stats unconditionally.
type UsageStatsResult ¶
type UsageStatsResult struct {
ToolCalls map[string]int64 `` /* 126-byte string literal not displayed */
TopDocuments []DocAccess `` /* 198-byte string literal not displayed */
}
UsageStatsResult contains per-tool call counts and top-accessed documents since server start.
Source Files
¶
- add_observations.go
- audit.go
- create_entities.go
- create_relations.go
- delete_entities.go
- delete_observations.go
- delete_relations.go
- find_path.go
- get_file_content.go
- get_integration_map.go
- get_scan_status.go
- get_usage_stats.go
- graph_guard.go
- list_entities.go
- list_relations.go
- list_repos.go
- metrics.go
- open_nodes.go
- ports.go
- read_graph.go
- search_content.go
- search_docs.go
- search_nodes.go
- semantic_search.go
- tools.go
- traverse_graph.go
- trigger_scan.go
- update_entity.go