MCPcopy Create free account

hub / github.com/Harshitk-cp/engram / functions

Functions2,051 in github.com/Harshitk-cp/engram

↓ 4 callersFunctionpost
HTTP
examples/03_benchmark_mistake_reduction/main.go:205
↓ 4 callersFunctionpretty
(raw json.RawMessage)
mcp/tools.go:447
↓ 4 callersMethodrecencyBoost
recencyBoost calculates a boost factor based on how recently the procedure was used.
internal/service/procedural.go:281
↓ 4 callersMethodsetSessionCookie
(w http.ResponseWriter, token string)
internal/api/handlers/auth.go:25
↓ 4 callersFunctionstoreMemory
(content, memType string, confidence float64)
examples/02_memory_evolution_demo/main.go:207
↓ 4 callersFunctiontoSchemaResponse
Helper to convert domain.Schema to API response.
internal/api/handlers/schema.go:317
↓ 4 callersMethodwithTx
withTx returns a clone of the store that runs against the given transaction.
internal/store/memory.go:27
↓ 3 callersFunctionAnnotateTiers
AnnotateTiers fills each memory's derived Tier from its Confidence, making the API the single source of truth for tiering. Clients should display this
internal/domain/tier.go:37
↓ 3 callersFunctionAppBaseURL
AppBaseURL is the externally-reachable base URL, used to build OAuth redirect URIs. Defaults to http://localhost:<port>.
internal/config/config.go:248
↓ 3 callersFunctionCORSAllowedOrigins
CORSAllowedOrigins returns the browser origins permitted to call the API, parsed from the comma-separated CORS_ALLOWED_ORIGINS env var. An empty resul
internal/config/config.go:190
↓ 3 callersFunctionComputeMemoryBinding
(anchorID, sessionID *uuid.UUID)
internal/domain/memory.go:132
↓ 3 callersMethodCreateAnchor
(ctx context.Context, a *domain.Entity, agentID *uuid.UUID)
internal/store/entity.go:34
↓ 3 callersFunctionDefaultIncludeTiers
()
internal/domain/tier.go:122
↓ 3 callersMethodDetectUncertainty
DetectUncertainty identifies areas where the agent should be uncertain.
internal/service/metacognitive.go:270
↓ 3 callersFunctionEmbeddingModel
()
internal/config/config.go:133
↓ 3 callersFunctionEmbeddingProvider
EmbeddingProvider returns the configured embedding provider. Defaults to "openai" if not set. Valid values: openai, mock
internal/config/config.go:94
↓ 3 callersMethodFindAnchorByExternalID
(ctx context.Context, tenantID uuid.UUID, externalID string)
internal/store/entity.go:79
↓ 3 callersMethodGetByBeliefID
(ctx context.Context, beliefID uuid.UUID)
internal/domain/stores.go:191
↓ 3 callersMethodGetByEmail
(ctx context.Context, email string)
internal/domain/auth.go:58
↓ 3 callersMethodGetByID
(ctx context.Context, id uuid.UUID, tenantID uuid.UUID)
internal/service/agent.go:63
↓ 3 callersMethodGetPolicies
(ctx context.Context, agentID uuid.UUID, tenantID uuid.UUID)
internal/service/policy.go:40
↓ 3 callersMethodGetUnconsolidated
Consolidation
internal/domain/stores.go:273
↓ 3 callersMethodHandle
1 MiB Handle dispatches a single MCP JSON-RPC request.
internal/api/handlers/mcp.go:42
↓ 3 callersFunctionHashContent
HashContent returns a hex sha256 of memory content, used to record what was deleted/redacted without retaining the original text.
internal/domain/learning.go:70
↓ 3 callersMethodListByAnchor
(ctx context.Context, anchorID, tenantID uuid.UUID, limit int)
internal/store/memory.go:191
↓ 3 callersMethodListQuarantine
ListQuarantine returns the quarantine review queue for an agent.
internal/service/memory.go:600
↓ 3 callersMethodMatchSchemas
MatchSchemas finds schemas that apply to the current situation.
internal/service/schema.go:187
↓ 3 callersFunctionNewMCPHandler
NewMCPHandler builds the embedded MCP endpoint. httpClient must be backed by the in-process transport that dispatches to this server's router.
internal/api/handlers/mcp.go:35
↓ 3 callersMethodPenalize
(ctx context.Context, memoryID uuid.UUID, tenantID uuid.UUID)
internal/service/confidence.go:124
↓ 3 callersMethodRecordContradiction
RecordContradiction records a contradiction for a schema.
internal/service/schema.go:270
↓ 3 callersFunctionRegisterResources
RegisterResources registers all Engram MCP resources on the server.
mcp/resources.go:12
↓ 3 callersMethodReinforce
(ctx context.Context, memoryID uuid.UUID, tenantID uuid.UUID)
internal/service/confidence.go:99
↓ 3 callersMethodReinforce
(ctx context.Context, id uuid.UUID, episodeID uuid.UUID, confidenceBoost float32)
internal/domain/stores.go:310
↓ 3 callersMethodSanitize
Sanitize clamps each field to a safe range, falling back to the default when a value is nonsensical (e.g. negative). This guards the engine against a
internal/domain/settings.go:88
↓ 3 callersMethodScoreAndRank
(memories []domain.MemoryWithScore, now time.Time)
internal/service/recall.go:95
↓ 3 callersMethodSummarize
(ctx context.Context, memories []Memory)
internal/domain/stores.go:227
↓ 3 callersMethodUpdateContent
Admin correction methods
internal/domain/stores.go:120
↓ 3 callersFunctionValidTier
(t string)
internal/domain/tier.go:114
↓ 3 callersMethodValidateSchema
ValidateSchema validates a schema and updates its validation timestamp.
internal/service/schema.go:294
↓ 3 callersFunctionWorkOSAuth
WorkOSAuth returns (clientID, apiKey) for WorkOS enterprise SSO (AuthKit); empty when not configured. The API key is the client secret for token excha
internal/config/config.go:267
↓ 3 callersMethodapplyDecayEff
applyDecayEff is the core decay computation, parameterized by the effective (possibly per-tenant) decay settings.
internal/service/decay.go:308
↓ 3 callersMethodapplyTensionWrites
applyTensionWrites runs fn atomically inside the unit of work when available, falling back to the pool-backed stores (e.g. in unit tests) otherwise.
internal/service/memory.go:238
↓ 3 callersFunctionaverageVectors
averageVectors computes the element-wise average of two vectors.
internal/service/schema.go:547
↓ 3 callersFunctionbuildContradictionMutation
buildContradictionMutation builds an audit row for a belief change caused by a contradicting belief; source_id points at the contradicting belief.
internal/service/memory.go:212
↓ 3 callersMethodcalculateInitialConfidence
calculateInitialConfidence calculates initial confidence based on evidence count.
internal/service/schema.go:517
↓ 3 callersFunctionclampConf
clampConf mirrors the store's ApplyConfidenceDelta clamp ([0, 0.99]) for mocks.
internal/service/memory_test.go:165
↓ 3 callersFunctioncloneVector
cloneVector returns a copy of v so callers can mutate it without aliasing the source slice.
internal/service/schema.go:561
↓ 3 callersFunctioncontainsAny
(s string, substrings ...string)
internal/service/contradiction/classify.go:43
↓ 3 callersFunctioncopy
()
console/src/pages/Connect.tsx:69
↓ 3 callersMethodcreateWithOptions
(ctx context.Context, m *domain.Memory, enableBeliefLogic bool)
internal/service/memory.go:293
↓ 3 callersMethoddefaultEff
()
internal/service/decay.go:125
↓ 3 callersMethoddo
(ctx context.Context, method, path string, form url.Values, out any)
internal/billing/razorpay.go:171
↓ 3 callersMethoddoRaw
(ctx context.Context, method, path string, body interface{})
mcp/client.go:237
↓ 3 callersMethodenforceCreatePolicy
enforceCreatePolicy runs policy enforcement for a newly created belief. It is best-effort and intentionally runs outside any transaction.
internal/service/memory.go:249
↓ 3 callersFunctionextractAgentID
extractAgentID parses the agent ID from a URI like "engram://agents/{agent_id}/...".
mcp/resources.go:122
↓ 3 callersFunctionfloatEq
(a, b float64)
internal/service/recall_test.go:12
↓ 3 callersFunctionincrementalMean
incrementalMean folds sample x into a running mean as the n-th observation: mean += (x - mean) / n. This keeps every cluster member equally weighted,
internal/service/schema.go:570
↓ 3 callersMethodlogQuarantineMutation
logQuarantineMutation writes a firewall decision to the tamper-evident audit chain. Best-effort: a logging failure never blocks the operation.
internal/service/memory.go:606
↓ 3 callersFunctionmcpPost
post builds an MCP JSON-RPC POST with the given Authorization header.
internal/api/handlers/mcp_test.go:14
↓ 3 callersMethodmetricsHandler
()
internal/api/router.go:568
↓ 3 callersFunctionnewMockEpisodeStore
()
internal/service/episode_test.go:19
↓ 3 callersFunctionnullIfEmpty
nullIfEmpty maps "" to a SQL NULL so optional text columns stay null rather than storing empty strings.
internal/store/learning.go:45
↓ 3 callersFunctionparseEventDate
(s string)
internal/service/memory.go:53
↓ 3 callersMethodprovisionTenant
provisionTenant joins the default org (if configured) or creates a personal org.
internal/service/auth.go:265
↓ 3 callersFunctionresolve
(keepId: string, demoteId: string)
console/src/pages/ReviewQueue.tsx:14
↓ 3 callersFunctionscanAnchor
(row pgx.Row)
internal/store/entity.go:55
↓ 3 callersFunctionshortHash
(h?: string)
console/src/pages/Audit.tsx:8
↓ 3 callersFunctionshred
(id: string, name: string)
console/src/pages/Subjects.tsx:13
↓ 3 callersMethodstartSession
(ctx context.Context, userID uuid.UUID, tenantID *uuid.UUID)
internal/service/auth.go:300
↓ 3 callersFunctionstdioRoundtrip
─── Stdio transport tests ──────────────────────────────────────────────────────
mcp/mcp_test.go:799
↓ 3 callersFunctiontierOf
(confidence: number)
console/src/format.ts:1
↓ 3 callersFunctiontruncate
(s string, n int)
examples/02_memory_evolution_demo/main.go:298
↓ 2 callersMethodActivate
Activate performs intelligent memory activation using spreading activation.
internal/service/working_memory.go:93
↓ 2 callersMethodAddEvidence
Evidence tracking
internal/domain/stores.go:334
↓ 2 callersMethodCancelSubscription
CancelSubscription cancels a Razorpay subscription. When atCycleEnd is true the subscription stays active until the end of the current billing cycle (
internal/billing/razorpay.go:155
↓ 2 callersMethodChainHead
ChainHead returns the tenant's current chain length and head hash (the value an auditor anchors against). Returns (0, "") for an empty chain.
internal/store/learning.go:200
↓ 2 callersMethodCountAgents
CountAgents returns the org's live (non-archived) agent count.
internal/domain/billing.go:98
↓ 2 callersMethodCountByAgent
(ctx context.Context, agentID, tenantID uuid.UUID)
internal/domain/stores.go:193
↓ 2 callersMethodCreateSubscription
CreateSubscription creates a Razorpay subscription in the "created" state and returns its id. The browser then opens the Checkout modal with this id +
internal/billing/razorpay.go:90
↓ 2 callersMethodCurrentUsage
CurrentUsage returns usage for the current UTC month (zeroed if none yet).
internal/domain/billing.go:92
↓ 2 callersMethodDerivedMemoryClosure
DerivedMemoryClosure returns every memory transitively derived from the given root memories (following memory_graph 'derived_from' edges, where source
internal/store/memory.go:289
↓ 2 callersMethodDetectSchemaPattern
(ctx context.Context, memories []Memory)
internal/domain/stores.go:232
↓ 2 callersMethodDetectSchemas
DetectSchemas identifies patterns across semantic memories and creates schemas.
internal/service/schema.go:79
↓ 2 callersFunctionEmbeddingBaseURL
()
internal/config/config.go:137
↓ 2 callersMethodExtractEpisodeStructure
(ctx context.Context, content string)
internal/domain/stores.go:230
↓ 2 callersMethodExtractProcedure
(ctx context.Context, content string)
internal/domain/stores.go:231
↓ 2 callersMethodFindByNameOrAlias
(ctx context.Context, agentID uuid.UUID, name string)
internal/domain/graph.go:187
↓ 2 callersMethodGetApplicableProcedures
GetApplicableProcedures returns procedures relevant to the current situation.
internal/service/procedural.go:166
↓ 2 callersMethodGetAssociations
(ctx context.Context, episodeID uuid.UUID)
internal/domain/stores.go:292
↓ 2 callersMethodGetAuthByHash
GetAuthByHash performs a single JOIN query and returns auth context for the given hash. Returns ErrNotFound if the key doesn't exist, is revoked, or i
internal/domain/stores.go:20
↓ 2 callersMethodGetByName
(ctx context.Context, agentID uuid.UUID, tenantID uuid.UUID, schemaType SchemaType, name string)
internal/domain/stores.go:327
↓ 2 callersMethodGetConfidenceExplanationForMemory
GetConfidenceExplanationForMemory returns a confidence explanation for a specific memory. This can be used to enhance recall responses with confidence
internal/service/metacognitive.go:699
↓ 2 callersMethodGetHotMemories
GetHotMemories returns the hot-tier memories for an agent.
mcp/client.go:192
↓ 2 callersMethodGetLatest
(ctx context.Context, agentID uuid.UUID)
internal/domain/stores.go:399
↓ 2 callersMethodGetMentionsByEntity
(ctx context.Context, entityID uuid.UUID)
internal/domain/graph.go:194
↓ 2 callersMethodGetNeighbors
(ctx context.Context, memoryID uuid.UUID, direction string, relationTypes []domain.RelationType)
internal/store/graph.go:80
↓ 2 callersMethodGetSession
GetSession retrieves the current working memory session for an agent.
internal/service/working_memory.go:737
↓ 2 callersMethodGetTierCounts
(ctx context.Context, agentID uuid.UUID, tenantID uuid.UUID)
internal/domain/stores.go:137
↓ 2 callersFunctionGitHubOAuth
GitHubOAuth returns (clientID, clientSecret); empty when not configured.
internal/config/config.go:261
↓ 2 callersFunctionGoogleOAuth
GoogleOAuth returns (clientID, clientSecret); empty when not configured.
internal/config/config.go:256
← previousnext →201–300 of 2,051, ranked by callers