Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Gauntlet-AIDP/rag-cookbook
/ functions
Functions
175 in github.com/Gauntlet-AIDP/rag-cookbook
⨍
Functions
175
◇
Types & classes
4
↓ 27 callers
Method
log
Log message if verbose mode is on.
05-agentic-rag/agent.py:126
↓ 26 callers
Method
close
(self)
04-graph-rag/retrieval.py:67
↓ 9 callers
Method
run
Run the agentic RAG pipeline. Returns: Dictionary with answer and metadata about the agent's decisions
05-agentic-rag/agent.py:282
↓ 8 callers
Method
execute_write
(self, query: str, parameters: dict = None)
04-graph-rag/graph_builder.py:86
↓ 6 callers
Function
retrieve_with_filter
Retrieve documents with metadata pre-filtering. Args: query: The search query string top_k: Number of documents to retri
02-metadata-filtered/retrieval.py:158
↓ 5 callers
Method
execute_retrieval
Execute a retrieval tool.
05-agentic-rag/agent.py:171
↓ 4 callers
Method
evaluate_results
Evaluate if retrieved results are sufficient.
05-agentic-rag/agent.py:203
↓ 4 callers
Method
execute_query
(self, query: str, parameters: dict = None)
04-graph-rag/graph_builder.py:81
↓ 3 callers
Function
entities_match
Check if two entities match (allowing for variations).
04-graph-rag/evals/entity_extraction.py:187
↓ 3 callers
Method
execute_query
(self, query: str, parameters: dict = None)
04-graph-rag/evals/multi_hop_reasoning.py:186
↓ 3 callers
Function
generate_answer
Generate an answer using graph-enhanced RAG. Args: question: User's question top_k: Number of documents to retrieve
04-graph-rag/generation.py:86
↓ 3 callers
Function
generate_answer
Generate an answer using hybrid RAG.
03-hybrid-search/generation.py:205
↓ 3 callers
Function
generate_answer
Generate an answer using the metadata-filtered RAG pipeline. Args: question: The user's question top_k: Number of docume
02-metadata-filtered/generation.py:124
↓ 3 callers
Function
generate_answer
Generate an answer using the naive RAG pipeline. Args: question: The user's question top_k: Number of documents to retri
01-naive-rag/generation.py:55
↓ 3 callers
Function
get_mongo_client
Get MongoDB client.
03-hybrid-search/retrieval.py:49
↓ 2 callers
Function
analyze_query
Run the agent's query analyzer on a question.
05-agentic-rag/evals/query_decomposition.py:226
↓ 2 callers
Function
analyze_query
Run the agent's query analyzer on a question.
05-agentic-rag/evals/tool_selection.py:167
↓ 2 callers
Method
analyze_query
Analyze the query to determine retrieval strategy.
05-agentic-rag/agent.py:132
↓ 2 callers
Function
build_filter_context
Build a human-readable description of the applied filters.
02-metadata-filtered/generation.py:72
↓ 2 callers
Function
build_pre_filter
Build a MongoDB pre-filter for vector search. Args: year: Single year or list of years to include year_range: Tuple of (
02-metadata-filtered/retrieval.py:76
↓ 2 callers
Function
calculate_precision
Calculate precision for a set of retrieved documents. Returns: Tuple of (precision_score, list_of_relevance_judgments)
02-metadata-filtered/evals/precision_delta.py:236
↓ 2 callers
Function
calculate_precision
Calculate precision for a single query. Precision = relevant_documents / k Returns dict with precision score and details.
01-naive-rag/evals/precision.py:154
↓ 2 callers
Method
close
(self)
04-graph-rag/graph_builder.py:78
↓ 2 callers
Method
close
(self)
04-graph-rag/evals/multi_hop_reasoning.py:183
↓ 2 callers
Function
evaluate_end_to_end
Run full end-to-end evaluation for a single test case.
05-agentic-rag/evals/end_to_end.py:284
↓ 2 callers
Function
evaluate_groundedness
Evaluate groundedness for a single question. Returns dict with groundedness assessment and details.
01-naive-rag/evals/groundedness.py:235
↓ 2 callers
Method
execute_query
(self, query: str, parameters: dict = None)
04-graph-rag/retrieval.py:70
↓ 2 callers
Function
extract_query_entities
Extract entities from a question using the LLM.
04-graph-rag/evals/entity_extraction.py:161
↓ 2 callers
Function
find_related_entities
Find entities related via graph traversal.
04-graph-rag/evals/multi_hop_reasoning.py:209
↓ 2 callers
Function
format_documents_as_context
Format documents into context string for LLM.
05-agentic-rag/tools.py:244
↓ 2 callers
Function
format_retrieved_context
Format retrieved documents into a context string for the LLM. Args: documents: List of retrieved document objects Retur
01-naive-rag/retrieval.py:97
↓ 2 callers
Function
get_company_counts
Get counts of company mentions in the collection.
02-metadata-filtered/retrieval.py:321
↓ 2 callers
Function
get_mongo_client
Get MongoDB client.
04-graph-rag/retrieval.py:76
↓ 2 callers
Function
get_mongo_client
Get MongoDB client.
03-hybrid-search/generation.py:63
↓ 2 callers
Function
get_topic_counts
Get counts of each topic bucket in the collection.
02-metadata-filtered/retrieval.py:304
↓ 2 callers
Function
get_vector_store
Connect to the MongoDB vector store.
03-hybrid-search/retrieval.py:54
↓ 2 callers
Function
get_vector_store
Connect to the MongoDB vector store.
02-metadata-filtered/retrieval.py:57
↓ 2 callers
Function
get_vector_store
Connect to the MongoDB vector store.
01-naive-rag/retrieval.py:30
↓ 2 callers
Function
get_vector_store
Connect to MongoDB vector store.
05-agentic-rag/tools.py:36
↓ 2 callers
Function
graph_enhanced_retrieval
Perform graph-enhanced retrieval. Steps: 1. Extract entities from query 2. Traverse graph to find related entities 3. Get ch
04-graph-rag/retrieval.py:236
↓ 2 callers
Function
judge_path_relevance
Use LLM to judge if the traversal path is relevant.
04-graph-rag/evals/multi_hop_reasoning.py:254
↓ 2 callers
Function
load_documents_for_bm25
Load documents from MongoDB for BM25 indexing. Note: BM25 requires all documents in memory. For very large collections, consider usi
03-hybrid-search/retrieval.py:73
↓ 2 callers
Function
load_documents_for_bm25
Load documents from MongoDB for BM25 indexing.
03-hybrid-search/generation.py:68
↓ 2 callers
Function
no_retrieval
Skip retrieval - agent decides to answer from model knowledge. Returns: Empty result indicating no retrieval was done
05-agentic-rag/tools.py:59
↓ 2 callers
Function
normalize_entity
Normalize entity name for comparison.
04-graph-rag/evals/entity_extraction.py:178
↓ 2 callers
Function
retrieve_documents
Retrieve documents with optional filters.
02-metadata-filtered/evals/precision_delta.py:188
↓ 2 callers
Function
vector_search
Perform vector similarity search.
04-graph-rag/retrieval.py:194
↓ 1 callers
Function
add_topic_nodes
Add high-level topic nodes based on entity patterns.
04-graph-rag/graph_builder.py:281
↓ 1 callers
Function
build_entity_context
Build a description of the entities found.
04-graph-rag/generation.py:61
↓ 1 callers
Function
build_graph
Build the knowledge graph from extracted entities and relationships.
04-graph-rag/graph_builder.py:204
↓ 1 callers
Function
build_pre_filter
Build a MongoDB pre-filter for vector search.
02-metadata-filtered/evals/latency.py:133
↓ 1 callers
Function
build_pre_filter
Build a MongoDB pre-filter for vector search.
02-metadata-filtered/evals/precision_delta.py:145
↓ 1 callers
Function
build_pre_filter
Build MongoDB pre-filter.
05-agentic-rag/tools.py:108
↓ 1 callers
Function
calculate_metrics
Calculate precision, recall, and F1 for entity extraction.
04-graph-rag/evals/entity_extraction.py:219
↓ 1 callers
Function
clear_graph
Clear all nodes and relationships from the graph.
04-graph-rag/graph_builder.py:197
↓ 1 callers
Function
create_extraction_chain
Create LLM chain for entity/relationship extraction.
04-graph-rag/graph_builder.py:125
↓ 1 callers
Function
create_groundedness_judge
Create the LLM judge for assessing groundedness.
01-naive-rag/evals/groundedness.py:194
↓ 1 callers
Function
create_rag_chain
Create the RAG chain.
04-graph-rag/generation.py:48
↓ 1 callers
Function
create_rag_chain
Create the RAG chain.
03-hybrid-search/generation.py:192
↓ 1 callers
Function
create_rag_chain
Create the RAG chain with prompt template and LLM.
02-metadata-filtered/generation.py:56
↓ 1 callers
Function
create_rag_chain
Create the RAG chain with prompt template and LLM.
01-naive-rag/generation.py:39
↓ 1 callers
Function
create_relevance_judge
Create the LLM judge for assessing relevance.
02-metadata-filtered/evals/precision_delta.py:212
↓ 1 callers
Function
create_relevance_judge
Create the LLM judge for assessing relevance.
01-naive-rag/evals/precision.py:130
↓ 1 callers
Function
create_vector_store
Create embeddings and store in MongoDB Atlas Vector Search.
02-metadata-filtered/ingestion.py:417
↓ 1 callers
Function
create_vector_store
Create embeddings and store in MongoDB Atlas Vector Search.
01-naive-rag/ingestion.py:93
↓ 1 callers
Function
debug_collection
Check collection status.
03-hybrid-search/retrieval.py:289
↓ 1 callers
Function
debug_collection
Debug function to check MongoDB collection status.
02-metadata-filtered/retrieval.py:338
↓ 1 callers
Function
debug_collection
Debug function to check MongoDB collection status.
01-naive-rag/retrieval.py:123
↓ 1 callers
Function
detect_portfolio_companies
Detect mentions of Berkshire portfolio companies.
02-metadata-filtered/ingestion.py:244
↓ 1 callers
Function
detect_subsidiaries
Detect mentions of Berkshire wholly-owned subsidiaries.
02-metadata-filtered/ingestion.py:279
↓ 1 callers
Function
detect_topic_buckets
Detect which topic buckets apply to this text using keyword matching.
02-metadata-filtered/ingestion.py:230
↓ 1 callers
Function
evaluate_decomposition
Evaluate query decomposition for a single test case.
05-agentic-rag/evals/query_decomposition.py:301
↓ 1 callers
Function
evaluate_entity_extraction
Evaluate entity extraction for a single test case.
04-graph-rag/evals/entity_extraction.py:256
↓ 1 callers
Function
evaluate_multi_hop
Evaluate multi-hop reasoning for a single test case.
04-graph-rag/evals/multi_hop_reasoning.py:297
↓ 1 callers
Function
evaluate_precision_delta
Compare precision with and without filters for a single question. Returns: Dictionary with precision comparison results
02-metadata-filtered/evals/precision_delta.py:255
↓ 1 callers
Function
evaluate_tool_selection
Evaluate tool selection for a single test case.
05-agentic-rag/evals/tool_selection.py:199
↓ 1 callers
Function
extract_entities_and_relationships
Extract entities and relationships from a chunk.
04-graph-rag/graph_builder.py:138
↓ 1 callers
Function
extract_metadata
Extract all metadata for a chunk using fast string matching.
02-metadata-filtered/ingestion.py:305
↓ 1 callers
Function
extract_query_entities
Extract entities from the user's question using LLM.
04-graph-rag/retrieval.py:100
↓ 1 callers
Function
extract_query_entities
Extract entities from a question using the LLM.
04-graph-rag/evals/multi_hop_reasoning.py:192
↓ 1 callers
Function
filtered_search
Vector search with metadata pre-filtering. Args: query: Search query k: Number of documents year: Filter by spec
05-agentic-rag/tools.py:151
↓ 1 callers
Function
find_documents_for_entities
Find document names that mention any of the given entities.
04-graph-rag/retrieval.py:148
↓ 1 callers
Function
find_related_entities
Find entities related to the query entities via graph traversal. Returns: Dictionary mapping entity names to their hop distance
04-graph-rag/retrieval.py:115
↓ 1 callers
Function
format_context
Format documents into context string.
03-hybrid-search/generation.py:176
↓ 1 callers
Function
format_context
Format documents into context string.
02-metadata-filtered/evals/latency.py:242
↓ 1 callers
Function
format_context
Format retrieved documents into context string.
01-naive-rag/evals/groundedness.py:156
↓ 1 callers
Function
format_retrieved_context
Format retrieved documents into context string.
04-graph-rag/retrieval.py:342
↓ 1 callers
Function
format_retrieved_context
Format retrieved documents into a context string for the LLM.
02-metadata-filtered/retrieval.py:270
↓ 1 callers
Function
generate_answer
Generate an answer using the RAG pipeline.
01-naive-rag/evals/groundedness.py:174
↓ 1 callers
Function
get_available_years
Get list of years available in the collection.
02-metadata-filtered/retrieval.py:292
↓ 1 callers
Function
get_chunks_by_source
Get chunks from MongoDB by source file names.
04-graph-rag/retrieval.py:164
↓ 1 callers
Function
get_mongo_client
Get MongoDB client.
04-graph-rag/graph_builder.py:91
↓ 1 callers
Function
get_mongo_client
Get MongoDB client.
05-agentic-rag/tools.py:31
↓ 1 callers
Function
get_pdf_files
Get all PDF files from the letters directory.
02-metadata-filtered/ingestion.py:222
↓ 1 callers
Function
get_pdf_files
Get all PDF files from the letters directory.
01-naive-rag/ingestion.py:34
↓ 1 callers
Function
get_vector_store
Connect to MongoDB vector store.
04-graph-rag/retrieval.py:81
↓ 1 callers
Function
get_vector_store
Connect to the MongoDB vector store.
02-metadata-filtered/evals/latency.py:114
↓ 1 callers
Function
get_vector_store
Connect to the MongoDB vector store.
02-metadata-filtered/evals/precision_delta.py:126
↓ 1 callers
Function
get_vector_store
Connect to the MongoDB vector store.
01-naive-rag/evals/groundedness.py:126
↓ 1 callers
Function
get_vector_store
Connect to the MongoDB vector store.
01-naive-rag/evals/precision.py:100
next →
1–100 of 175, ranked by callers