Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojieli/ai-agent-book
/ functions
Functions
2,925 in github.com/bojieli/ai-agent-book
⨍
Functions
2,925
◇
Types & classes
570
↳
Endpoints
80
↓ 1 callers
Method
run_evaluation
Run full evaluation
chapter3/agentic-rag/evaluation/evaluate.py:128
↓ 1 callers
Function
run_evaluation_mode
Run evaluation mode using the evaluation framework
chapter3/user-memory/main.py:366
↓ 1 callers
Method
run_full_demo
Run complete email demo with learning and replay phases.
chapter8/browser-use-rpa/demo_email.py:33
↓ 1 callers
Method
run_full_experiment
Run full comparison experiment. Args: rl_episodes: Number of episodes for RL training llm_episodes:
chapter1/learning-from-experience/experiment.py:348
↓ 1 callers
Function
run_inference_examples
运行多个推理示例 Args: model: 训练好的模型 tokenizer: 分词器
chapter7/MultilingualReasoning/gpt_oss_20b_sft.py:409
↓ 1 callers
Function
run_integration_test
Run a simple integration test
chapter1/context/test_agent.py:133
↓ 1 callers
Function
run_interactive_demo
Run an interactive demonstration.
chapter3/retrieval-pipeline/test_client.py:395
↓ 1 callers
Function
run_interactive_mode
交互式模式 - 持续与 Agent 对话 Args: agent: WebSearchAgent 实例
chapter1/web-search-agent/main.py:19
↓ 1 callers
Function
run_interactive_mode
Run interactive query mode
chapter3/contextual-retrieval/main.py:59
↓ 1 callers
Function
run_interactive_mode
Run interactive query mode
chapter3/agentic-rag/main.py:59
↓ 1 callers
Method
run_interactive_mode
Run interactive mode for testing.
chapter8/gaia-experience/demo.py:305
↓ 1 callers
Method
run_interactive_session
Run an interactive evaluation session.
chapter3/user-memory-evaluation/main.py:24
↓ 1 callers
Function
run_llm_demo
Run a simplified LLM demo with just a few episodes.
chapter1/learning-from-experience/quick_demo.py:42
↓ 1 callers
Method
run_llm_experiment
Run experiment with LLM-based in-context learning agent. Args: num_training_episodes: Number of episodes to trai
chapter1/learning-from-experience/experiment.py:113
↓ 1 callers
Function
run_performance_test
Run a performance test.
chapter3/dense-embedding/test_client.py:193
↓ 1 callers
Function
run_quick_demo
Run a quick demonstration
chapter3/agentic-rag-for-user-memory/quickstart.py:52
↓ 1 callers
Function
run_quick_demo
Run a quick demonstration
chapter3/contextual-retrieval-for-user-memory/quickstart.py:52
↓ 1 callers
Function
run_single_mode
Run agent in a single mode Args: api_key: API key for Kimi mode: KV cache mode to use task: Custom task (optiona
chapter2/kv-cache/main.py:39
↓ 1 callers
Function
run_single_question
单个问题模式 - 回答一个问题后退出 Args: agent: WebSearchAgent 实例 question: 要回答的问题
chapter1/web-search-agent/main.py:76
↓ 1 callers
Method
run_single_strategy
Run experiment with a single compression strategy Args: strategy: Compression strategy to test verbo
chapter2/context-compression/experiment.py:44
↓ 1 callers
Function
run_single_task
Run a single task with optional streaming
chapter2/local_llm_serving/main.py:250
↓ 1 callers
Function
run_single_task
Run a single task with the agent Args: api_key: API key for the LLM provider task: Task description context_mode
chapter1/context/main.py:416
↓ 1 callers
Method
run_single_test
Run a single ablation test Args: task: Task to execute context_mode: Context mode to test
chapter1/context/main.py:94
↓ 1 callers
Method
run_single_test
Run a single test case.
chapter3/user-memory-evaluation/main.py:71
↓ 1 callers
Method
run_single_test
Run a single test case Args: agent: User memory agent test_case: Test case definition
chapter3/user-memory/locomo_benchmark.py:232
↓ 1 callers
Method
run_strategy
Run a single compression strategy Args: strategy: The compression strategy to test Returns:
chapter2/context-compression/run_all_strategies.py:82
↓ 1 callers
Method
run_test_case
Run a complete test case.
chapter3/retrieval-pipeline/test_client.py:90
↓ 1 callers
Method
run_test_case
Run a single test case
chapter3/contextual-retrieval/evaluation/evaluate.py:91
↓ 1 callers
Method
run_test_case
Run a single test case
chapter3/agentic-rag/evaluation/evaluate.py:91
↓ 1 callers
Function
run_test_scenarios
Run various test scenarios
chapter4/agent-with-event-trigger/client.py:138
↓ 1 callers
Function
run_tests
Run all tests
chapter3/multimodal-agent/test_multimodal.py:223
↓ 1 callers
Function
run_with_ablation
Run tau-bench with ablation modifications
chapter2/prompt-engineering/run_ablation.py:154
↓ 1 callers
Function
run_with_experience
Main execution function with experience learning.
chapter8/gaia-experience/run_with_experience.py:169
↓ 1 callers
Method
sanitize_text
Replace PII values with [REDACTED] in the text Returns: - Sanitized text - Number of replacements ma
chapter2/log-sanitization/agent.py:169
↓ 1 callers
Method
saveRecording
()
chapter9/live-audio/backend/server.js:637
↓ 1 callers
Function
save_and_push_model
保存模型并可选择推送到 Hugging Face Hub Args: trainer: 训练好的 trainer 对象 output_dir: 输出目录 push_to_hub: 是否推送到 Hub hub_
chapter7/MultilingualReasoning/gpt_oss_20b_sft.py:278
↓ 1 callers
Method
save_chunk_to_document_store
Save individual chunk to document store immediately (compatible with tools.py)
chapter3/contextual-retrieval/index_local_laws_contextual.py:279
↓ 1 callers
Method
save_document_info
Save document summary information to local store
chapter3/contextual-retrieval/index_local_laws_contextual.py:312
↓ 1 callers
Method
save_document_info
Save document information to local store
chapter3/agentic-rag/index_local_laws.py:295
↓ 1 callers
Method
save_document_store
Save document store to disk
chapter3/contextual-retrieval/tools.py:49
↓ 1 callers
Method
save_document_store
Save document store to disk
chapter3/agentic-rag/tools.py:49
↓ 1 callers
Method
save_index
Save the chunks and metadata to disk Args: path: Path to save index (uses config default if not specified)
chapter3/agentic-rag-for-user-memory/indexer.py:377
↓ 1 callers
Method
save_index
Save the chunks and metadata to disk Args: path: Path to save index (uses config default if not specified)
chapter3/contextual-retrieval-for-user-memory/indexer.py:377
↓ 1 callers
Method
save_json_results
Save results to JSON file
chapter2/context-compression/run_all_strategies.py:334
↓ 1 callers
Method
save_react_trajectory
Save the ReAct trajectory with all steps Args: query: The initial query steps: List of ReAct steps
chapter2/attention_visualization/main.py:483
↓ 1 callers
Method
save_results
Save evaluation results to JSON Args: output_file: Output file path (defaults to timestamped file)
chapter3/agentic-rag-for-user-memory/evaluator.py:618
↓ 1 callers
Method
save_results
Save evaluation results to JSON Args: output_file: Output file path (defaults to timestamped file)
chapter3/contextual-retrieval-for-user-memory/evaluator.py:618
↓ 1 callers
Method
save_results
Save evaluation results to file
chapter3/contextual-retrieval-for-user-memory/contextual_evaluator.py:726
↓ 1 callers
Method
save_trajectory
Save a trajectory to frontend/public/ with unique filename
chapter2/attention_visualization/agent.py:260
↓ 1 callers
Method
score_dp
(self, dp: Datapoint)
chapter2/prompt-engineering/tau_bench/model_utils/api/router.py:25
↓ 1 callers
Function
scrollChatToBottom
()
chapter9/live-audio/frontend/pages/index.tsx:527
↓ 1 callers
Function
scrollLogsToBottom
()
chapter9/live-audio/frontend/pages/index.tsx:533
↓ 1 callers
Method
search
Simple text similarity search Args: query: Search query documents: List of documents to search
chapter3/user-memory/conversation_history.py:311
↓ 1 callers
Method
search
Search for top-k similar items in the HNSW index.
chapter3/dense-embedding/indexing.py:343
↓ 1 callers
Function
search_arxiv
Search ArXiv for academic papers. Args: query: Search query max_results: Maximum number of results sort_by: Sort
chapter4/perception-tools/src/public_data_tools.py:368
↓ 1 callers
Method
search_conversations
Search conversations using Dify vector search Args: query: Search query user_id: User identifier
chapter3/user-memory/conversation_history.py:224
↓ 1 callers
Method
search_dense
Search using dense embeddings.
chapter3/retrieval-pipeline/retrieval_client.py:85
↓ 1 callers
Function
search_impl
When using the search tool provided by Moonshot AI, you just need to return the arguments as they are, without any additional processing logi
chapter1/web-search-agent/agent.py:18
↓ 1 callers
Function
search_knowledge_base
Search a local knowledge base using simple text matching. Args: query: Search query knowledge_base_path: Path to knowled
chapter4/perception-tools/src/search_tools.py:239
↓ 1 callers
Function
search_location
Search for locations using Nominatim (OpenStreetMap) API (free, no API key required). Args: query: Location query (e.g., "Eiffel
chapter4/perception-tools/src/public_data_tools.py:648
↓ 1 callers
Function
search_notion
Search Notion workspace or specific database. Args: query: Search query database_id: Optional specific database ID
chapter4/perception-tools/src/private_data_tools.py:147
↓ 1 callers
Function
search_poi
Search for Points of Interest (POI) near a location using Overpass API (OpenStreetMap). Free, no API key required. Args: que
chapter4/perception-tools/src/public_data_tools.py:749
↓ 1 callers
Method
search_sparse
Search using sparse embeddings (BM25).
chapter3/retrieval-pipeline/retrieval_client.py:120
↓ 1 callers
Function
search_wayback
Search Wayback Machine for archived versions of a URL. Args: url: URL to search for year: Optional year to filter result
chapter4/perception-tools/src/public_data_tools.py:449
↓ 1 callers
Method
search_web
Search the web using Serper API Args: query: Search query num_results: Number of results to return
chapter2/context-compression/web_tools.py:36
↓ 1 callers
Method
search_with_context
带上下文的搜索 Args: question: 用户问题 context: 额外的上下文信息 Returns: 答案
chapter1/web-search-agent/examples.py:51
↓ 1 callers
Method
search_with_context
Search both contextual chunks and memory cards. Args: query: Search query top_k: Number of results
chapter3/contextual-retrieval-for-user-memory/contextual_indexer.py:413
↓ 1 callers
Function
select_mode_interactive
Interactively prompt the user to select an execution mode Returns: Selected mode string ('evaluation', 'interactive', or 'demo')
chapter3/user-memory/main.py:717
↓ 1 callers
Function
select_strategy
Let user select a compression strategy
chapter2/context-compression/main.py:28
↓ 1 callers
Function
send_discord_message
Send a Discord message via webhook. Args: message: Message text to send webhook_url: Optional Discord webhook URL (uses defau
chapter4/collaboration-tools/src/notification_tools.py:319
↓ 1 callers
Function
set_recurring_timer
Set a recurring timer that repeats at intervals. Args: interval_seconds: Time between occurrences max_occurrences: Maximum nu
chapter4/collaboration-tools/src/timer_tools.py:276
↓ 1 callers
Function
setupWebSocket
()
chapter9/live-audio/frontend/pages/index.tsx:104
↓ 1 callers
Method
setupWebSocketHandlers
()
chapter9/live-audio/backend/server.js:108
↓ 1 callers
Function
setup_demo_documents
Create demo documents if they don't exist
chapter3/agentic-rag/quickstart.py:48
↓ 1 callers
Function
setup_environment
Setup environment and check requirements
chapter3/contextual-retrieval/main.py:17
↓ 1 callers
Function
setup_environment
Setup environment and check requirements
chapter3/agentic-rag/main.py:17
↓ 1 callers
Method
setup_environment
Setup environment and directories.
chapter8/gaia-experience/demo.py:53
↓ 1 callers
Function
setup_logger
Set up a colorful and informative logger for educational purposes. Args: name: Logger name level: Logging level (DEBUG,
chapter3/dense-embedding/logger.py:11
↓ 1 callers
Function
setup_logging
Setup logging configuration.
chapter8/gaia-experience/run_with_experience.py:133
↓ 1 callers
Method
setup_logging
Configure logging to file and console
chapter2/context-compression/run_all_strategies.py:46
↓ 1 callers
Method
show_category_results
Show results for a specific category
chapter3/agentic-rag-for-user-memory/main.py:480
↓ 1 callers
Function
show_game_solution
Show the optimal solution to the game.
chapter1/learning-from-experience/quick_demo.py:18
↓ 1 callers
Method
show_help
Display help information
chapter1/search-codegen/main.py:54
↓ 1 callers
Function
show_hidden_rules
Reveal the hidden game mechanics.
chapter1/learning-from-experience/demo.py:158
↓ 1 callers
Function
show_index_structure
Display the internal structure of the index
chapter3/sparse-embedding/demo.py:183
↓ 1 callers
Function
show_knowledge_stats
Show knowledge base statistics.
chapter8/browser-use-rpa/quickstart.py:97
↓ 1 callers
Method
show_menu
Display the main menu
chapter3/agentic-rag-for-user-memory/main.py:86
↓ 1 callers
Method
show_menu
Show main menu
chapter3/contextual-retrieval/demo.py:79
↓ 1 callers
Method
show_menu
Display the main menu
chapter3/contextual-retrieval-for-user-memory/main.py:89
↓ 1 callers
Method
show_results
Show test results summary.
chapter8/browser-use-rpa/test_validation.py:284
↓ 1 callers
Function
show_statistics
Display index statistics
chapter3/sparse-embedding/demo.py:114
↓ 1 callers
Method
show_statistics
Show knowledge base statistics.
chapter8/browser-use-rpa/demo_email.py:185
↓ 1 callers
Method
show_statistics
Show performance statistics
chapter3/contextual-retrieval/demo.py:373
↓ 1 callers
Method
show_statistics
Show system statistics
chapter3/contextual-retrieval-for-user-memory/main.py:663
↓ 1 callers
Function
simulate_message_flow
Simulate how messages are handled in different modes
chapter2/kv-cache/test_message_flow.py:6
↓ 1 callers
Method
startRecording
()
chapter9/live-audio/backend/server.js:630
↓ 1 callers
Method
start_background_processing
Start the background memory processing thread
chapter3/user-memory/background_memory_processor.py:574
↓ 1 callers
Function
stopRecording
()
chapter9/live-audio/frontend/pages/index.tsx:447
↓ 1 callers
Method
stop_background_processing
Stop the background memory processing thread
chapter3/user-memory/background_memory_processor.py:590
↓ 1 callers
Method
stop_monitoring
Stop system monitoring
chapter4/agent-with-event-trigger/client.py:104
← previous
next →
1,501–1,600 of 2,925, ranked by callers