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
↓ 2 callers
Method
HasScope
HasScope reports whether the auth context includes the requested scope. Keys with admin scope implicitly satisfy any scope check.
internal/domain/tenant.go:73
↓ 2 callers
Function
LLMProvider
LLMProvider returns the configured LLM provider. Defaults to "openai" if not set. Valid values: openai, anthropic, gemini, cerebras, mock
internal/config/config.go:83
↓ 2 callers
Method
ListByTenantID
(ctx context.Context, tenantID uuid.UUID, limit, offset int)
internal/domain/stores.go:33
↓ 2 callers
Method
ListByUser
(ctx context.Context, userID uuid.UUID)
internal/domain/auth.go:70
↓ 2 callers
Function
Logit
(p float64)
internal/service/confidence.go:21
↓ 2 callers
Function
NewApp
(db *pgxpool.Pool, logger *zap.Logger)
internal/api/router.go:43
↓ 2 callers
Function
NewCompatibleClient
NewCompatibleClient builds a client for an OpenAI-compatible embeddings API. baseURL is the server root (e.g. http://localhost:11434/v1); "/embeddings
internal/embedding/compatible.go:34
↓ 2 callers
Function
NewEpisodeService
( es domain.EpisodeStore, as domain.AgentStore, ec domain.EmbeddingClient, lc domain.LLMClient, logger *z
internal/service/episode.go:41
↓ 2 callers
Function
NewFeedbackService
(fs domain.FeedbackStore, ms domain.MemoryStore, as domain.AgentStore)
internal/service/feedback.go:28
↓ 2 callers
Function
NewMetacognitiveService
NewMetacognitiveService creates a new metacognitive service.
internal/service/metacognitive.go:108
↓ 2 callers
Function
NewPolicyService
(ps domain.PolicyStore, ms domain.MemoryStore, as domain.AgentStore, lc domain.LLMClient, ec domain.EmbeddingC
internal/service/policy.go:29
↓ 2 callers
Function
NewProceduralService
NewProceduralService creates a new procedural service.
internal/service/procedural.go:43
↓ 2 callers
Function
NewSchemaService
NewSchemaService creates a new schema service.
internal/service/schema.go:49
↓ 2 callers
Method
OAuthLogin
OAuthLogin links/creates a user from a social identity and starts a session. SECURITY INVARIANT: `email` MUST be provider-verified (the caller passes
internal/service/auth.go:130
↓ 2 callers
Function
OpenAIAPIKey
()
internal/config/config.go:64
↓ 2 callers
Method
PlanForPlanID
PlanForPlanID reverse-maps a Razorpay plan id to a plan tier. Returns ("", false) when the plan id is unknown.
internal/billing/razorpay.go:196
↓ 2 callers
Function
RazorpayKeyID
---- Billing / managed cloud (Razorpay) ---- RazorpayKeyID is the public Razorpay API key id (also handed to the browser to open the Checkout modal).
internal/config/config.go:279
↓ 2 callers
Function
RazorpayKeySecret
RazorpayKeySecret is the Razorpay API key secret used for server-side API calls and payment-signature verification.
internal/config/config.go:283
↓ 2 callers
Function
RazorpayWebhookSecret
RazorpayWebhookSecret verifies the signature on incoming Razorpay webhook events.
internal/config/config.go:286
↓ 2 callers
Method
RecordOutcome
RecordOutcome records the outcome of an episode.
internal/service/episode.go:360
↓ 2 callers
Method
RecordUse
Effectiveness tracking
internal/domain/stores.go:309
↓ 2 callers
Method
RedactContent
(ctx context.Context, id uuid.UUID, tombstone string)
internal/domain/stores.go:121
↓ 2 callers
Method
Reflect
Reflect performs a full metacognitive reflection for an agent.
internal/service/metacognitive.go:553
↓ 2 callers
Method
ReflectOnStrategy
ReflectOnStrategy evaluates how well the agent's strategies are working.
internal/service/metacognitive.go:404
↓ 2 callers
Method
ReleaseQuarantine
ReleaseQuarantine promotes a quarantined trace into active memory by recomputing its real binding from the ids it carries, and records the release in
internal/service/memory.go:548
↓ 2 callers
Method
ReleaseQuarantine
(ctx context.Context, id, tenantID uuid.UUID, newBinding MemoryBinding)
internal/domain/stores.go:132
↓ 2 callers
Method
Restore
(ctx context.Context, id uuid.UUID, tenantID uuid.UUID)
internal/domain/stores.go:129
↓ 2 callers
Method
RoundTrip
(req *http.Request)
internal/api/inprocess.go:27
↓ 2 callers
Method
RunAll
RunAll runs the tuner for all agents that have feedback.
internal/service/tuner.go:99
↓ 2 callers
Method
SelfServe
SelfServe reports whether a plan can be purchased via Razorpay Checkout. Free is the default (no purchase) and Enterprise is sales-assisted (set manua
internal/domain/billing.go:60
↓ 2 callers
Function
ServerPort
()
internal/config/config.go:52
↓ 2 callers
Method
SetDecayService
(cd *DecayService)
internal/service/consolidation.go:121
↓ 2 callers
Method
SetSettingsStore
SetSettingsStore wires per-tenant settings so the Provenance Firewall can consult the tenant's quarantine policy. When nil, only an explicit per-write
internal/service/memory.go:202
↓ 2 callers
Function
SetupToken
SetupToken returns ENGRAM_SETUP_TOKEN. If empty, POST /v1/setup is disabled.
internal/config/config.go:151
↓ 2 callers
Function
Sigmoid
(x float64)
internal/service/confidence.go:26
↓ 2 callers
Method
Stop
Stop halts the background consolidation worker, cancelling any in-flight pass so shutdown is not held for the remainder of a long tick.
internal/service/consolidation.go:158
↓ 2 callers
Method
UpdateActiveTenant
(ctx context.Context, sessionID, tenantID uuid.UUID)
internal/domain/auth.go:76
↓ 2 callers
Method
UpdateLastUsed
UpdateLastUsed is called asynchronously on every authenticated request.
internal/domain/stores.go:26
↓ 2 callers
Method
UpdateOutcome
Outcome
internal/domain/stores.go:288
↓ 2 callers
Method
UpdateSession
(ctx context.Context, s *WorkingMemorySession)
internal/domain/stores.go:352
↓ 2 callers
Method
activeTenantFor
activeTenantFor returns the user's first org (or provisions one if none).
internal/service/auth.go:288
↓ 2 callers
Method
applyDecayWrite
applyDecayWrite persists a memory's decay (archive or confidence update) and its audit row atomically when a unit of work is wired, falling back to no
internal/service/decay.go:182
↓ 2 callers
Method
applySubscription
applySubscription reconciles an org's plan from a subscription event. On cancellation/completion (canceled == true) the org drops to the free tier.
internal/api/handlers/billing.go:321
↓ 2 callers
Function
approxEqual
(a, b, tolerance float32)
internal/service/learning_test.go:395
↓ 2 callers
Method
assembleContext
assembleContext creates a formatted context string for LLM injection.
internal/service/working_memory.go:687
↓ 2 callers
Function
buildMasterKey
--- Helpers ---
internal/api/handlers/setup.go:212
↓ 2 callers
Method
buildScorer
buildScorer creates a RecallScorer with per-agent policy weights if available.
internal/service/memory.go:833
↓ 2 callers
Method
calculateCompetition
calculateCompetition measures how much competing beliefs suppress this one
internal/service/decay.go:407
↓ 2 callers
Function
calculateDecayStatus
(confidence float32)
internal/api/handlers/memory.go:405
↓ 2 callers
Function
clampConfidence
(p float64)
internal/service/confidence.go:37
↓ 2 callers
Function
clampCurrency
(v float32)
internal/service/memory_test.go:175
↓ 2 callers
Method
clusterMemories
clusterMemories groups memories by embedding similarity.
internal/service/consolidation.go:748
↓ 2 callers
Method
compete
compete selects the top memories for limited working memory slots.
internal/service/working_memory.go:623
↓ 2 callers
Method
computeProcedureScore
computeProcedureScore calculates the combined ranking score for a procedure.
internal/service/procedural.go:275
↓ 2 callers
Function
contradictionZoneEmb
contradictionZoneEmb returns two normalised unit vectors with cosine similarity ~0.71. They share a strong component on dim-0 but diverge on dims 1 an
internal/service/contradiction/embedding_detector_test.go:26
↓ 2 callers
Function
dateTime
(iso?: string)
console/src/format.ts:28
↓ 2 callers
Function
delta
(m: Mutation)
console/src/pages/Timeline.tsx:26
↓ 2 callers
Method
effFor
effFor resolves the effective decay parameters for a tenant, falling back to service defaults when no settings store is wired or on error.
internal/service/decay.go:136
↓ 2 callers
Function
envDurationSecs
envDurationSecs reads an env var holding a number of seconds, falling back to defSecs. A value of 0 is honored (e.g. "no max lifetime").
internal/config/config.go:25
↓ 2 callers
Function
envInt32
envInt32 reads a positive int32 env var, falling back to def.
internal/config/config.go:14
↓ 2 callers
Function
extractTimeOfDay
extractTimeOfDay returns the time of day category for a given time.
internal/service/episode.go:388
↓ 2 callers
Method
filterByTier
(memories []domain.MemoryWithScore, includeTiers []domain.MemoryTier)
internal/service/memory.go:745
↓ 2 callers
Method
findCompetitors
findCompetitors finds memories that compete for the same "slot"
internal/service/decay.go:371
↓ 2 callers
Function
floatArg
(args map[string]interface{}, key string, defaultVal float64)
mcp/tools.go:418
↓ 2 callers
Function
formatMemories
─── Helpers ───────────────────────────────────────────────────────────────────
mcp/tools.go:391
↓ 2 callers
Function
generateRawKey
generateRawKey returns a key with the given prefix: e.g. "mk_<64 hex chars>".
internal/api/handlers/setup.go:228
↓ 2 callers
Method
increment
increment performs an atomic upsert into the current month's row. The column name is fixed by the caller (never user input), so interpolation is safe.
internal/store/billing.go:109
↓ 2 callers
Function
initials
(name: string)
console/src/format.ts:8
↓ 2 callers
Function
insertMutationLog
insertMutationLog writes one audit row against any DBTX (pool or tx), so deletion/archive paths can log atomically inside their own transaction.
internal/store/learning.go:34
↓ 2 callers
Function
isLoopbackHost
(hostport string)
mcp/transports/guard.go:53
↓ 2 callers
Function
livenessHandler
metricsHandler serves runtime metrics. It defaults to the Prometheus text exposition format (so Prometheus/Grafana/k8s can scrape `/metrics` natively)
internal/api/router.go:560
↓ 2 callers
Function
min
(a, b int)
internal/service/conversation.go:273
↓ 2 callers
Function
newMockProcedureStore
()
internal/service/procedural_test.go:18
↓ 2 callers
Function
newMockSchemaStore
()
internal/service/schema_test.go:19
↓ 2 callers
Function
newResponseWriter
(w http.ResponseWriter)
internal/api/middleware/logging.go:17
↓ 2 callers
Method
ok
()
internal/api/middleware/quota.go:23
↓ 2 callers
Function
onUpgrade
(plan: string)
console/src/pages/Billing.tsx:136
↓ 2 callers
Function
policyKey
(agentID uuid.UUID, memType domain.MemoryType)
internal/service/policy_test.go:21
↓ 2 callers
Function
post
HTTP
examples/01_learning_agent/main.go:136
↓ 2 callers
Function
printHeader
UI
examples/02_memory_evolution_demo/main.go:287
↓ 2 callers
Function
printHeader
UI
examples/03_benchmark_mistake_reduction/main.go:225
↓ 2 callers
Function
providerConf
(provider string)
internal/api/handlers/oauth.go:23
↓ 2 callers
Function
recallMemories
(query string, topK int)
examples/01_learning_agent/main.go:126
↓ 2 callers
Function
recallMemories
(query string, topK int, minConf float64)
examples/02_memory_evolution_demo/main.go:216
↓ 2 callers
Function
recordOutcome
(episodeID, outcome, description string)
examples/03_benchmark_mistake_reduction/main.go:193
↓ 2 callers
Method
redirectURI
(provider string)
internal/api/handlers/oauth.go:49
↓ 2 callers
Function
reject
(id: string)
console/src/pages/Quarantine.tsx:29
↓ 2 callers
Function
resolve
(keepId: string, demoteId: string)
console/src/pages/Contradictions.tsx:15
↓ 2 callers
Method
resolveAnchor
(ctx context.Context, tenantID uuid.UUID, anchorID, externalID string)
internal/api/handlers/memory.go:169
↓ 2 callers
Method
runExtraction
(ctx context.Context, req *domain.ConversationIngestRequest, userMemID uuid.UUID)
internal/service/conversation.go:104
↓ 2 callers
Method
runStatsTick
(baseCtx context.Context)
internal/service/learning.go:115
↓ 2 callers
Method
scanAssociations
(rows pgx.Rows)
internal/store/working_memory.go:398
↓ 2 callers
Method
scanProcedures
(rows pgx.Rows)
internal/store/procedure.go:302
↓ 2 callers
Function
scanSession
(row pgx.Row)
internal/store/session.go:25
↓ 2 callers
Method
scanUser
(row pgx.Row)
internal/store/auth.go:40
↓ 2 callers
Function
scoreMarkers
scoreMarkers returns a score in [0, 1] based on how many markers are present.
internal/service/contradiction/embedding_detector.go:117
↓ 2 callers
Function
serveNetwork
serveNetwork starts an HTTP listener for the sse/http transports.
cmd/engram-mcp/main.go:94
↓ 2 callers
Function
tenantFromEvent
tenantFromEvent resolves the org owning a webhook's subscription via the notes[tenant_id] we set at checkout. Returns uuid.Nil when absent/malformed.
internal/api/handlers/billing.go:308
↓ 2 callers
Function
toLocalInput
(d: Date)
console/src/pages/TimeMachine.tsx:10
↓ 2 callers
Function
toPolicyResponse
(p domain.Policy)
internal/api/handlers/policy.go:47
← previous
next →
301–400 of 2,051, ranked by callers