Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/24kchengYe/MemoMind
/ functions
Functions
1,372 in github.com/24kchengYe/MemoMind
⨍
Functions
1,372
◇
Types & classes
350
↳
Endpoints
62
↓ 818 callers
Method
get
Get a specific directive.
engine/hindsight/api_namespaces.py:142
↓ 130 callers
Function
fq_table
Get fully-qualified table name with current schema. Example: fq_table("memory_units") -> "public.memory_units" fq_table("mem
engine/hindsight_api/engine/memory_engine.py:59
↓ 76 callers
Function
acquire_with_retry
Async context manager to acquire a connection with retry logic. Usage: async with acquire_with_retry(pool) as conn: awai
engine/hindsight_api/engine/db_utils.py:78
↓ 62 callers
Method
_get_pool
Get the connection pool (must call initialize() first).
engine/hindsight_api/engine/memory_engine.py:1758
↓ 61 callers
Function
fq_table
Get fully-qualified table name with optional schema prefix.
engine/hindsight_api/engine/storage/postgresql.py:15
↓ 56 callers
Function
_get_request_context
Create RequestContext with auth details from resolvers. This enables tenant auth and usage metering to work with MCP tools by propagating the
engine/hindsight_api/mcp_tools.py:58
↓ 53 callers
Method
_authenticate_tenant
Authenticate tenant and set schema in context variable. The schema is stored in a contextvar for async-safe, per-task isolation.
engine/hindsight_api/engine/memory_engine.py:514
↓ 46 callers
Method
_validate_operation
Run validation if an operation validator is configured. Args: validation_coro: Coroutine that returns a ValidationResult
engine/hindsight_api/engine/memory_engine.py:495
↓ 46 callers
Method
set_attribute
No-op.
engine/hindsight_api/tracing.py:70
↓ 44 callers
Function
fq_table
Get fully-qualified table name with optional schema prefix.
engine/hindsight_api/worker/poller.py:30
↓ 43 callers
Function
get_config
Get global configuration with ONLY static (non-configurable) fields accessible. This returns a proxy that prevents access to bank-configurab
engine/hindsight_api/config.py:1362
↓ 36 callers
Method
encode
Generate embeddings for a list of texts. Args: texts: List of text strings to encode Returns: List
engine/hindsight_api/engine/embeddings.py:76
↓ 27 callers
Function
fq_table
Get fully-qualified table name with optional schema prefix.
engine/hindsight_api/engine/task_backend.py:21
↓ 24 callers
Method
record_llm_call
Record stats for a single LLM call.
engine/hindsight_api/engine/consolidation/consolidator.py:144
↓ 23 callers
Method
read
(self)
engine/hindsight_api/api/http.py:4653
↓ 22 callers
Function
addSlideNumber
(slide, num, total = 22)
build-ppt-zh.js:45
↓ 22 callers
Function
addSlideNumber
(slide, num, total = 22)
build-ppt.js:95
↓ 21 callers
Method
_ensure_started
Ensure daemon is running (thread-safe).
engine/hindsight/embedded.py:132
↓ 21 callers
Function
addTitle
(slide, title, subtitle)
build-ppt-zh.js:52
↓ 21 callers
Function
addTitle
(slide, title, subtitle)
build-ppt.js:104
↓ 21 callers
Method
validate_bank_write
Validate a bank write operation before execution. Override to implement custom validation logic for bank writes (delete_bank
engine/hindsight_api/extensions/operation_validator.py:646
↓ 20 callers
Method
acquire
Acquire a connection within the budget. Note: Caller must release the connection when done. Prefer using as context manager
engine/hindsight_api/engine/db_budget.py:256
↓ 19 callers
Method
validate_bank_read
Validate a bank read operation before execution. Override to implement custom validation logic for bank reads (get_bank_prof
engine/hindsight_api/extensions/operation_validator.py:628
↓ 18 callers
Function
_log
Helper to log to buffer if available, otherwise use logger. Args: log_buffer: Buffer to append messages to (for main output) mess
engine/hindsight_api/engine/retain/link_utils.py:121
↓ 18 callers
Function
get_metrics_collector
Get the global metrics collector instance. Returns a no-op collector if metrics are not initialized.
engine/hindsight_api/metrics.py:609
↓ 18 callers
Function
get_value
(field_name)
patches/fact_extraction.py:999
↓ 18 callers
Function
get_value
(field_name)
engine/hindsight_api/engine/retain/fact_extraction.py:999
↓ 18 callers
Method
update
Update a directive.
engine/hindsight/api_namespaces.py:147
↓ 17 callers
Method
run
Main polling loop with fire-and-forget task execution. Continuously polls for pending tasks, spawns them as background tasks,
engine/hindsight_api/worker/poller.py:513
↓ 16 callers
Function
addGlowCard
(slide, pres, x, y, w, h, fillColor = C.bgCard)
build-ppt-zh.js:35
↓ 16 callers
Function
addGlowCard
(slide, pres, x, y, w, h, fillColor = C.bgCard)
build-ppt.js:84
↓ 16 callers
Method
get_bank_profile
Get bank profile (name, disposition + mission). Auto-creates agent with default values if not exists. Args: bank
engine/hindsight_api/engine/memory_engine.py:4876
↓ 15 callers
Method
exists
Check if file exists. Args: key: Storage key Returns: True if file exists, False otherwise
engine/hindsight_api/engine/storage/base.py:56
↓ 13 callers
Function
FieldWithDefault
Field wrapper that ensures default_factory values appear in OpenAPI schema. Pydantic doesn't include default_factory in OpenAPI schemas, cau
engine/hindsight_api/api/http.py:42
↓ 13 callers
Method
from_db_row
Create from a database row (asyncpg Record converted to dict).
engine/hindsight_api/engine/search/types.py:59
↓ 12 callers
Method
format
(self, record: logging.LogRecord)
engine/hindsight_api/config.py:549
↓ 11 callers
Method
close
Close the connection pool and shutdown background workers.
engine/hindsight_api/engine/memory_engine.py:1803
↓ 11 callers
Method
create
Create a new bank.
engine/hindsight/api_namespaces.py:22
↓ 11 callers
Function
get_span_recorder
Get the global span recorder (NoOp if tracing disabled).
engine/hindsight_api/tracing.py:466
↓ 11 callers
Function
parse_entity_labels
Parse raw entity labels config into EntityLabelsConfig. Accepts: - None → returns None - list → list of attribute dicts (each may us
engine/hindsight_api/engine/retain/entity_labels.py:38
↓ 10 callers
Method
close
Explicitly close the client. Args: stop_daemon: If True, stops the daemon. Otherwise, daemon continues running
engine/hindsight/embedded.py:183
↓ 10 callers
Function
color
Color text using gradient position (0.0 = start, 1.0 = end).
engine/hindsight_api/banner.py:53
↓ 9 callers
Function
build_tag_groups_where_clause
Build a SQL WHERE clause for compound tag group filtering. Top-level groups are AND-ed together. Each group is a recursive boolean expre
engine/hindsight_api/engine/search/tags.py:282
↓ 9 callers
Function
build_tags_where_clause_simple
Build a simple SQL WHERE clause for tags filtering. This is a convenience version that returns just the clause string, assuming the call
engine/hindsight_api/engine/search/tags.py:93
↓ 9 callers
Method
call
Make a mock LLM API call. Records the call for test verification and returns the configured mock response. Args:
engine/hindsight_api/engine/providers/mock_llm.py:81
↓ 9 callers
Method
end
No-op.
engine/hindsight_api/tracing.py:86
↓ 9 callers
Function
load_extension
Load an extension from environment variable configuration. The extension class is specified via {env_prefix}_{prefix}_EXTENSION environment
engine/hindsight_api/extensions/loader.py:24
↓ 9 callers
Method
log
Add a log line.
patches/consolidator.py:133
↓ 9 callers
Function
to_uuid
(val)
engine/hindsight_api/engine/retain/link_utils.py:333
↓ 8 callers
Method
__setattr__
(self, name: str, value)
engine/hindsight_api/config.py:56
↓ 8 callers
Method
delete_bank
Delete all data for a specific agent (multi-tenant cleanup). This is much more efficient than dropping all tables and allows
engine/hindsight_api/engine/memory_engine.py:3696
↓ 8 callers
Function
dim
Dim/gray text.
engine/hindsight_api/banner.py:74
↓ 8 callers
Method
get_mental_model
Get a single pinned mental model by ID. Args: bank_id: Bank identifier mental_model_id: Pinned mental model UUID
engine/hindsight_api/engine/memory_engine.py:6140
↓ 8 callers
Method
recall_async
Recall memories using N*4-way parallel retrieval (N fact types × 4 retrieval methods). This implements the core RECALL operation:
engine/hindsight_api/engine/memory_engine.py:2283
↓ 8 callers
Method
record_timing
Record a timing measurement.
patches/consolidator.py:137
↓ 8 callers
Method
record_timing
Record a timing measurement.
engine/hindsight_api/engine/consolidation/consolidator.py:137
↓ 8 callers
Method
resolve_full_config
Resolve full HindsightConfig for a bank with hierarchical overrides applied. This is for INTERNAL USE ONLY. Returns the complete con
engine/hindsight_api/config_resolver.py:43
↓ 8 callers
Method
submit_async_refresh_mental_model
Submit an async mental model refresh operation. This schedules a background task to re-run the source query and update the content.
engine/hindsight_api/engine/memory_engine.py:7670
↓ 7 callers
Function
_get_llm_trace
()
engine/hindsight_api/engine/reflect/agent.py:385
↓ 7 callers
Function
_get_raw_config
Get raw config (internal use only). INTERNAL USE ONLY. Do not use this directly in application code. Use get_config() for static fields
engine/hindsight_api/config.py:1384
↓ 7 callers
Function
_get_tiktoken_encoding
Get cached tiktoken encoding (cl100k_base for GPT-4/3.5).
engine/hindsight_api/engine/memory_engine.py:213
↓ 7 callers
Function
_get_usage
()
engine/hindsight_api/engine/reflect/agent.py:396
↓ 7 callers
Function
get_tracer
Get the global tracer instance. Returns a no-op tracer if tracing is disabled, so callers don't need to check for None. This improves co
engine/hindsight_api/tracing.py:195
↓ 7 callers
Function
sanitize_llm_output
Sanitize text by removing characters that break downstream systems. Removes: - ASCII control characters (0x00-0x08, 0x0B-0x0C, 0x0E-0x1F
engine/hindsight_api/engine/llm_wrapper.py:51
↓ 7 callers
Method
submit_async_consolidation
Submit a consolidation operation to run asynchronously. Deduplicates by bank_id - if there's already a pending consolidation for this bank,
engine/hindsight_api/engine/memory_engine.py:7626
↓ 7 callers
Method
update_mental_model
Update a pinned mental model. Args: bank_id: Bank identifier mental_model_id: Pinned mental model UUID na
engine/hindsight_api/engine/memory_engine.py:6421
↓ 6 callers
Function
_generate_structured_output
Generate structured output from an answer using the provided JSON schema. Args: answer: The text answer to extract structured data from
engine/hindsight_api/engine/reflect/agent.py:134
↓ 6 callers
Function
_log_completion
(answer: str, iterations: int, forced: bool = False)
engine/hindsight_api/engine/reflect/agent.py:403
↓ 6 callers
Function
_normalize_datetime
Normalize datetime to be timezone-aware (UTC) for consistent comparison.
engine/hindsight_api/engine/retain/link_utils.py:16
↓ 6 callers
Method
accept
Create an accepted validation result.
engine/hindsight_api/extensions/operation_validator.py:35
↓ 6 callers
Method
add_phase_metric
Record metrics for a search phase. Args: phase_name: Name of the phase duration_seconds: Time taken
engine/hindsight_api/engine/search/tracer.py:287
↓ 6 callers
Function
api_get
(path)
backup-memomind.py:30
↓ 6 callers
Function
count_tokens
Count tokens in text using tiktoken (cl100k_base encoding for GPT-4/3.5).
engine/hindsight_api/engine/memory_engine.py:54
↓ 6 callers
Method
from_env
Create configuration from environment variables.
engine/hindsight_api/config.py:951
↓ 6 callers
Method
initialize
Initialize the connection pool, models, and background workers. Loads models (embeddings, cross-encoder) in parallel with pg0 startup
engine/hindsight_api/engine/memory_engine.py:1500
↓ 6 callers
Method
list_directives
List directives for a bank. Args: bank_id: Bank identifier tags: Optional tags to filter by tags_match: H
engine/hindsight_api/engine/memory_engine.py:6611
↓ 6 callers
Method
load
Load the query analyzer model. This should be called during initialization to load the model and avoid cold start latency on
engine/hindsight_api/engine/query_analyzer.py:53
↓ 6 callers
Method
log
Add a log line.
engine/hindsight_api/engine/consolidation/consolidator.py:133
↓ 6 callers
Function
parse_pg0_url
Parse a database URL and check if it's a pg0:// embedded database URL. Supports: - "pg0" -> default instance "hindsight" - "pg0://in
engine/hindsight_api/pg0.py:148
↓ 6 callers
Function
patch_file
Copy a patched file from patches/ to the installed package.
patch_hindsight.py:15
↓ 6 callers
Method
start_span
Return a no-op span.
engine/hindsight_api/tracing.py:62
↓ 5 callers
Method
__getattribute__
(self, name: str)
engine/hindsight_api/config.py:41
↓ 5 callers
Function
_clean_answer_text
Clean up answer text by removing any done() tool call syntax. Some LLMs output the done() call as text instead of a proper tool call. This st
engine/hindsight_api/engine/reflect/agent.py:96
↓ 5 callers
Function
_parse_tags_match
Parse TagsMatch into operator and include_untagged flag. Returns: Tuple of (operator, include_untagged) - operator: "&&" for
engine/hindsight_api/engine/search/tags.py:24
↓ 5 callers
Function
_sanitize_text
(text: str | None)
patches/fact_extraction.py:68
↓ 5 callers
Function
_sanitize_text
(text: str | None)
engine/hindsight_api/engine/retain/fact_extraction.py:68
↓ 5 callers
Method
create_directive
Create a new directive. Args: bank_id: Bank identifier name: Human-readable name for the directive conten
engine/hindsight_api/engine/memory_engine.py:6730
↓ 5 callers
Method
create_mental_model
Create a new pinned mental model. Args: bank_id: Bank identifier name: Human-readable name for the mental model
engine/hindsight_api/engine/memory_engine.py:6241
↓ 5 callers
Method
delete_directive
Delete a directive. Args: bank_id: Bank identifier directive_id: Directive UUID request_context: Request
engine/hindsight_api/engine/memory_engine.py:6862
↓ 5 callers
Method
delete_mental_model
Delete a pinned mental model. Args: bank_id: Bank identifier mental_model_id: Pinned mental model UUID re
engine/hindsight_api/engine/memory_engine.py:6544
↓ 5 callers
Function
filter_results_by_tag_groups
Filter retrieval results by compound tag groups in Python (for post-processing). Used when SQL filtering isn't possible (e.g., graph travers
engine/hindsight_api/engine/search/tags.py:370
↓ 5 callers
Function
filter_results_by_tags
Filter retrieval results by tags in Python (for post-processing). Used when SQL filtering isn't possible (e.g., graph traversal results).
engine/hindsight_api/engine/search/tags.py:128
↓ 5 callers
Method
get_bank_config
Get fully resolved config for a bank (filtered by permissions). Resolution order: 1. Global config (from environment variabl
engine/hindsight_api/config_resolver.py:91
↓ 5 callers
Method
list_mental_models
List pinned mental models for a bank. Args: bank_id: Bank identifier tags: Optional tags to filter by tag
engine/hindsight_api/engine/memory_engine.py:6081
↓ 5 callers
Function
parse_datetime_flexible
Parse a datetime value that could be either a datetime object or an ISO string. This handles datetime values from both direct Python calls a
patches/orchestrator.py:23
↓ 5 callers
Function
parse_datetime_flexible
Parse a datetime value that could be either a datetime object or an ISO string. This handles datetime values from both direct Python calls a
engine/hindsight_api/engine/retain/orchestrator.py:23
↓ 5 callers
Method
reflect_async
Reflect and formulate an answer using an agentic loop with tools. The reflect agent iteratively uses tools to: 1. lookup: Ge
engine/hindsight_api/engine/memory_engine.py:5035
↓ 5 callers
Method
set_status
No-op.
engine/hindsight_api/tracing.py:74
↓ 5 callers
Method
start
Start the server in a background thread. Args: timeout: Maximum time to wait for server to start (seconds) Retu
engine/hindsight/server.py:151
↓ 5 callers
Method
start_as_current_span
Return a no-op context manager that yields a NoOpSpan.
engine/hindsight_api/tracing.py:52
next →
1–100 of 1,372, ranked by callers