Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Harshitk-cp/engram
/ functions
Functions
2,051 in github.com/Harshitk-cp/engram
⨍
Functions
2,051
◇
Types & classes
484
↓ 4 callers
Function
post
HTTP
examples/03_benchmark_mistake_reduction/main.go:205
↓ 4 callers
Function
pretty
(raw json.RawMessage)
mcp/tools.go:447
↓ 4 callers
Method
recencyBoost
recencyBoost calculates a boost factor based on how recently the procedure was used.
internal/service/procedural.go:281
↓ 4 callers
Method
setSessionCookie
(w http.ResponseWriter, token string)
internal/api/handlers/auth.go:25
↓ 4 callers
Function
storeMemory
(content, memType string, confidence float64)
examples/02_memory_evolution_demo/main.go:207
↓ 4 callers
Function
toSchemaResponse
Helper to convert domain.Schema to API response.
internal/api/handlers/schema.go:317
↓ 4 callers
Method
withTx
withTx returns a clone of the store that runs against the given transaction.
internal/store/memory.go:27
↓ 3 callers
Function
AnnotateTiers
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 callers
Function
AppBaseURL
AppBaseURL is the externally-reachable base URL, used to build OAuth redirect URIs. Defaults to http://localhost:<port>.
internal/config/config.go:248
↓ 3 callers
Function
CORSAllowedOrigins
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 callers
Function
ComputeMemoryBinding
(anchorID, sessionID *uuid.UUID)
internal/domain/memory.go:132
↓ 3 callers
Method
CreateAnchor
(ctx context.Context, a *domain.Entity, agentID *uuid.UUID)
internal/store/entity.go:34
↓ 3 callers
Function
DefaultIncludeTiers
()
internal/domain/tier.go:122
↓ 3 callers
Method
DetectUncertainty
DetectUncertainty identifies areas where the agent should be uncertain.
internal/service/metacognitive.go:270
↓ 3 callers
Function
EmbeddingModel
()
internal/config/config.go:133
↓ 3 callers
Function
EmbeddingProvider
EmbeddingProvider returns the configured embedding provider. Defaults to "openai" if not set. Valid values: openai, mock
internal/config/config.go:94
↓ 3 callers
Method
FindAnchorByExternalID
(ctx context.Context, tenantID uuid.UUID, externalID string)
internal/store/entity.go:79
↓ 3 callers
Method
GetByBeliefID
(ctx context.Context, beliefID uuid.UUID)
internal/domain/stores.go:191
↓ 3 callers
Method
GetByEmail
(ctx context.Context, email string)
internal/domain/auth.go:58
↓ 3 callers
Method
GetByID
(ctx context.Context, id uuid.UUID, tenantID uuid.UUID)
internal/service/agent.go:63
↓ 3 callers
Method
GetPolicies
(ctx context.Context, agentID uuid.UUID, tenantID uuid.UUID)
internal/service/policy.go:40
↓ 3 callers
Method
GetUnconsolidated
Consolidation
internal/domain/stores.go:273
↓ 3 callers
Method
Handle
1 MiB Handle dispatches a single MCP JSON-RPC request.
internal/api/handlers/mcp.go:42
↓ 3 callers
Function
HashContent
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 callers
Method
ListByAnchor
(ctx context.Context, anchorID, tenantID uuid.UUID, limit int)
internal/store/memory.go:191
↓ 3 callers
Method
ListQuarantine
ListQuarantine returns the quarantine review queue for an agent.
internal/service/memory.go:600
↓ 3 callers
Method
MatchSchemas
MatchSchemas finds schemas that apply to the current situation.
internal/service/schema.go:187
↓ 3 callers
Function
NewMCPHandler
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 callers
Method
Penalize
(ctx context.Context, memoryID uuid.UUID, tenantID uuid.UUID)
internal/service/confidence.go:124
↓ 3 callers
Method
RecordContradiction
RecordContradiction records a contradiction for a schema.
internal/service/schema.go:270
↓ 3 callers
Function
RegisterResources
RegisterResources registers all Engram MCP resources on the server.
mcp/resources.go:12
↓ 3 callers
Method
Reinforce
(ctx context.Context, memoryID uuid.UUID, tenantID uuid.UUID)
internal/service/confidence.go:99
↓ 3 callers
Method
Reinforce
(ctx context.Context, id uuid.UUID, episodeID uuid.UUID, confidenceBoost float32)
internal/domain/stores.go:310
↓ 3 callers
Method
Sanitize
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 callers
Method
ScoreAndRank
(memories []domain.MemoryWithScore, now time.Time)
internal/service/recall.go:95
↓ 3 callers
Method
Summarize
(ctx context.Context, memories []Memory)
internal/domain/stores.go:227
↓ 3 callers
Method
UpdateContent
Admin correction methods
internal/domain/stores.go:120
↓ 3 callers
Function
ValidTier
(t string)
internal/domain/tier.go:114
↓ 3 callers
Method
ValidateSchema
ValidateSchema validates a schema and updates its validation timestamp.
internal/service/schema.go:294
↓ 3 callers
Function
WorkOSAuth
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 callers
Method
applyDecayEff
applyDecayEff is the core decay computation, parameterized by the effective (possibly per-tenant) decay settings.
internal/service/decay.go:308
↓ 3 callers
Method
applyTensionWrites
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 callers
Function
averageVectors
averageVectors computes the element-wise average of two vectors.
internal/service/schema.go:547
↓ 3 callers
Function
buildContradictionMutation
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 callers
Method
calculateInitialConfidence
calculateInitialConfidence calculates initial confidence based on evidence count.
internal/service/schema.go:517
↓ 3 callers
Function
clampConf
clampConf mirrors the store's ApplyConfidenceDelta clamp ([0, 0.99]) for mocks.
internal/service/memory_test.go:165
↓ 3 callers
Function
cloneVector
cloneVector returns a copy of v so callers can mutate it without aliasing the source slice.
internal/service/schema.go:561
↓ 3 callers
Function
containsAny
(s string, substrings ...string)
internal/service/contradiction/classify.go:43
↓ 3 callers
Function
copy
()
console/src/pages/Connect.tsx:69
↓ 3 callers
Method
createWithOptions
(ctx context.Context, m *domain.Memory, enableBeliefLogic bool)
internal/service/memory.go:293
↓ 3 callers
Method
defaultEff
()
internal/service/decay.go:125
↓ 3 callers
Method
do
(ctx context.Context, method, path string, form url.Values, out any)
internal/billing/razorpay.go:171
↓ 3 callers
Method
doRaw
(ctx context.Context, method, path string, body interface{})
mcp/client.go:237
↓ 3 callers
Method
enforceCreatePolicy
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 callers
Function
extractAgentID
extractAgentID parses the agent ID from a URI like "engram://agents/{agent_id}/...".
mcp/resources.go:122
↓ 3 callers
Function
floatEq
(a, b float64)
internal/service/recall_test.go:12
↓ 3 callers
Function
incrementalMean
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 callers
Method
logQuarantineMutation
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 callers
Function
mcpPost
post builds an MCP JSON-RPC POST with the given Authorization header.
internal/api/handlers/mcp_test.go:14
↓ 3 callers
Method
metricsHandler
()
internal/api/router.go:568
↓ 3 callers
Function
newMockEpisodeStore
()
internal/service/episode_test.go:19
↓ 3 callers
Function
nullIfEmpty
nullIfEmpty maps "" to a SQL NULL so optional text columns stay null rather than storing empty strings.
internal/store/learning.go:45
↓ 3 callers
Function
parseEventDate
(s string)
internal/service/memory.go:53
↓ 3 callers
Method
provisionTenant
provisionTenant joins the default org (if configured) or creates a personal org.
internal/service/auth.go:265
↓ 3 callers
Function
resolve
(keepId: string, demoteId: string)
console/src/pages/ReviewQueue.tsx:14
↓ 3 callers
Function
scanAnchor
(row pgx.Row)
internal/store/entity.go:55
↓ 3 callers
Function
shortHash
(h?: string)
console/src/pages/Audit.tsx:8
↓ 3 callers
Function
shred
(id: string, name: string)
console/src/pages/Subjects.tsx:13
↓ 3 callers
Method
startSession
(ctx context.Context, userID uuid.UUID, tenantID *uuid.UUID)
internal/service/auth.go:300
↓ 3 callers
Function
stdioRoundtrip
─── Stdio transport tests ──────────────────────────────────────────────────────
mcp/mcp_test.go:799
↓ 3 callers
Function
tierOf
(confidence: number)
console/src/format.ts:1
↓ 3 callers
Function
truncate
(s string, n int)
examples/02_memory_evolution_demo/main.go:298
↓ 2 callers
Method
Activate
Activate performs intelligent memory activation using spreading activation.
internal/service/working_memory.go:93
↓ 2 callers
Method
AddEvidence
Evidence tracking
internal/domain/stores.go:334
↓ 2 callers
Method
CancelSubscription
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 callers
Method
ChainHead
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 callers
Method
CountAgents
CountAgents returns the org's live (non-archived) agent count.
internal/domain/billing.go:98
↓ 2 callers
Method
CountByAgent
(ctx context.Context, agentID, tenantID uuid.UUID)
internal/domain/stores.go:193
↓ 2 callers
Method
CreateSubscription
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 callers
Method
CurrentUsage
CurrentUsage returns usage for the current UTC month (zeroed if none yet).
internal/domain/billing.go:92
↓ 2 callers
Method
DerivedMemoryClosure
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 callers
Method
DetectSchemaPattern
(ctx context.Context, memories []Memory)
internal/domain/stores.go:232
↓ 2 callers
Method
DetectSchemas
DetectSchemas identifies patterns across semantic memories and creates schemas.
internal/service/schema.go:79
↓ 2 callers
Function
EmbeddingBaseURL
()
internal/config/config.go:137
↓ 2 callers
Method
ExtractEpisodeStructure
(ctx context.Context, content string)
internal/domain/stores.go:230
↓ 2 callers
Method
ExtractProcedure
(ctx context.Context, content string)
internal/domain/stores.go:231
↓ 2 callers
Method
FindByNameOrAlias
(ctx context.Context, agentID uuid.UUID, name string)
internal/domain/graph.go:187
↓ 2 callers
Method
GetApplicableProcedures
GetApplicableProcedures returns procedures relevant to the current situation.
internal/service/procedural.go:166
↓ 2 callers
Method
GetAssociations
(ctx context.Context, episodeID uuid.UUID)
internal/domain/stores.go:292
↓ 2 callers
Method
GetAuthByHash
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 callers
Method
GetByName
(ctx context.Context, agentID uuid.UUID, tenantID uuid.UUID, schemaType SchemaType, name string)
internal/domain/stores.go:327
↓ 2 callers
Method
GetConfidenceExplanationForMemory
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 callers
Method
GetHotMemories
GetHotMemories returns the hot-tier memories for an agent.
mcp/client.go:192
↓ 2 callers
Method
GetLatest
(ctx context.Context, agentID uuid.UUID)
internal/domain/stores.go:399
↓ 2 callers
Method
GetMentionsByEntity
(ctx context.Context, entityID uuid.UUID)
internal/domain/graph.go:194
↓ 2 callers
Method
GetNeighbors
(ctx context.Context, memoryID uuid.UUID, direction string, relationTypes []domain.RelationType)
internal/store/graph.go:80
↓ 2 callers
Method
GetSession
GetSession retrieves the current working memory session for an agent.
internal/service/working_memory.go:737
↓ 2 callers
Method
GetTierCounts
(ctx context.Context, agentID uuid.UUID, tenantID uuid.UUID)
internal/domain/stores.go:137
↓ 2 callers
Function
GitHubOAuth
GitHubOAuth returns (clientID, clientSecret); empty when not configured.
internal/config/config.go:261
↓ 2 callers
Function
GoogleOAuth
GoogleOAuth returns (clientID, clientSecret); empty when not configured.
internal/config/config.go:256
← previous
next →
201–300 of 2,051, ranked by callers