Skip to main content

Crate brainwires_rag

Crate brainwires_rag 

Source
👎Deprecated since 0.2.1:

use brainwires-cognition with features “rag”, “spectral”, “code-analysis” instead

Modules§

code_analysis
Code relationship extraction (definitions, references, call graphs). Code relationships module for definition/reference tracking and call graphs.
knowledge
Knowledge graph, entities, thoughts, BKS/PKS, brain client.
prelude
Prelude for convenient imports.
prompting
Adaptive prompting techniques, clustering, temperature optimization. Adaptive Prompting Techniques
rag
RAG error types.
spectral
Spectral graph methods: diverse retrieval, clustering, centrality, sparsification. MSS-inspired spectral subset selection for diverse RAG retrieval.

Structs§

AdvancedSearchRequest
Request to search with file type filters
BrainClient
Central orchestrator for all Open Brain storage operations.
CallEdge
An edge in the call graph representing a function/method call.
CallGraphNode
A node in the call graph
CaptureThoughtRequest
Request to capture a new thought.
CaptureThoughtResponse
Response after capturing a thought.
ClearRequest
Request to clear the index
ClearResponse
Response from clear operation
ClusterSummary
Summary of technique performance for a cluster
Config
Main configuration structure
ContradictionEvent
A potential contradiction detected when inserting a new fact.
Definition
A definition of a symbol in the codebase.
DeleteThoughtRequest
Request to delete a thought.
DeleteThoughtResponse
Response after deleting a thought.
Entity
A named entity extracted from conversation
EntityContext
Context gathered for an entity
EntityStore
Entity store for tracking entities across a conversation
EntityStoreStats
Statistics about the entity store.
ExtractionResult
Extraction result from a single message
FindDefinitionRequest
Request to find the definition of a symbol at a given location
FindDefinitionResponse
Response from find_definition
FindReferencesRequest
Request to find all references to a symbol
FindReferencesResponse
Response from find_references
GeneratedPrompt
Result of prompt generation
GetCallGraphRequest
Request to get call graph for a function
GetCallGraphResponse
Response from get_call_graph
GetThoughtRequest
Request to get a single thought by ID.
GetThoughtResponse
Response containing a full thought.
GitSearchResult
A single git search result
GraphEdge
An edge in the relationship graph.
GraphNode
A node in the relationship graph.
IndexRequest
Request to index a codebase
IndexResponse
Response from indexing operation
LanguageStats
Statistics for a single programming language in the index.
ListRecentRequest
Request to list recent thoughts.
ListRecentResponse
Response from listing recent thoughts.
MemoryStatsRequest
Request for memory statistics (no parameters).
MemoryStatsResponse
Response with memory statistics.
PromptGenerator
Generates optimized prompts based on task characteristics
PromptingLearningCoordinator
Coordinates learning and promotion of technique effectiveness
QueryRequest
Request to query the codebase
QueryResponse
Response from query operation
RagClient
Main client for interacting with the RAG system
Reference
A reference to a symbol from another location in the codebase.
RelationshipGraph
Relationship graph for entity context
SealProcessingResult
Result of SEAL query processing
SearchGitHistoryRequest
Request to search git history
SearchGitHistoryResponse
Response from git history search
SearchKnowledgeRequest
Request to search the knowledge store (PKS/BKS).
SearchKnowledgeResponse
Response from a knowledge search.
SearchMemoryRequest
Request to search memory.
SearchMemoryResponse
Response from a memory search.
SpectralReranker
Spectral reranker using greedy log-determinant maximization.
StatisticsRequest
Request to get statistics about the index
StatisticsResponse
Statistics about the indexed codebase
SymbolId
A unique identifier for a symbol in the codebase.
TaskCluster
A task cluster identified by semantic similarity (SEAL-enhanced)
TaskClusterManager
Manages task clustering
TechniqueLibrary
Library of all prompting techniques
TechniqueMetadata
Metadata for each technique (SEAL-enhanced)
TechniqueStats
Statistics for a technique in a specific cluster
TemperatureOptimizer
Manages adaptive temperature selection per task cluster
TemperaturePerformance
Tracks performance metrics for a specific temperature setting
Thought
A persistent thought stored in the Open Brain.

Enums§

ComplexityLevel
Complexity level for SEAL quality filtering
ContradictionKind
Why two stored facts were flagged as a potential contradiction.
EdgeType
Types of edges in the relationship graph.
EntityType
Types of entities tracked in the knowledge graph.
IndexingMode
Indexing mode used
PromptingTechnique
15 prompting techniques from the paper (Table 1)
RagError
Main error type for the RAG system
ReferenceKind
Kind of reference to a symbol
Relationship
Relationship between entities
SymbolKind
Kind of symbol in the codebase
TaskCharacteristic
Task characteristics for technique matching
TechniqueCategory
Prompting technique categories from the paper
ThoughtCategory
Category of a thought, used for filtering and organisation.
ThoughtSource
How a thought was captured.
Visibility
Visibility/access modifier for a symbol

Functions§

cosine_similarity
Compute cosine similarity between two vectors