Reach is a command-line tool designed to enhance academic research by integrating search capabilities from Google, arXiv, and Gemini to provide comprehensive information gathering, summarization, and knowledge graph generation.
- π Multi-source Search: Integrated search across Google, arXiv, and Gemini
- π Web Content Extraction: Automatically extracts relevant content from web pages
- π Summarization: Generates concise summaries of research content
- π Knowledge Graph Generation: Creates knowledge graphs to visualize relationships between concepts
- βοΈ Configurable: Customize search parameters, keywords, and categories
- π₯οΈ Terminal UI: Interactive terminal interface for query exploration and knowledge graph visualization
- π Graph Database: High-performance graph database for storing relationship-based data
- Rust (latest stable version)
- Python 3.12 or higher
- API keys:
- Google Search API key
- Google Custom Search Engine ID
- Gemini API key
- Clone the repository
git clone https://github.com/yourusername/reach.git
cd reach
- Set up Python environment
# Create virtual environment
python -m venv .venv
# Activate virtual environment (Windows)
.venv\Scripts\activate
# Activate virtual environment (Linux/macOS)
source .venv/bin/activate
# Install dependencies
pip install --upgrade pip
pip install -U crawl4ai
crawl4ai-setup
- Build the Rust project
cargo build --release
- Reach requires several API keys to function properly. You can configure these using the CLI:
# Launch the interactive configuration
cargo run -- config
# Or set each key individually
cargo run -- config --google-api-key YOUR_GOOGLE_API_KEY
cargo run -- config --search-engine-id YOUR_SEARCH_ENGINE_ID
cargo run -- config --gemini-api-key YOUR_GEMINI_API_KEY
- You can customize your arXiv search preferences:
# Launch the interactive configuration
cargo run -- arxiv-config
# Show current configuration
cargo run -- arxiv-config --show
The arXiv configuration allows you to set:
- Keywords to include in searches
- Keywords to exclude from searches
- Specific authors to focus on
- arXiv categories to search within
# Search with default parameters
cargo run -- search "Diffusion Models"
# Specify result limit
cargo run -- search "Flow based Diffusion Models" --max-results 5
cargo run -- summarize "What are Diffusion Models?"
cargo run -- knowledge-graph "What are Flow based Diffusion Models?"
# Launch the terminal user interface
cargo run -- tui
The terminal UI provides:
- Multiple session management
- Interactive conversation history
- Visual knowledge graph representation
- Two operational modes: Query and Search/Knowledge Graph Building
e
- Enter edit mode for text inputq
- Quit the applicationt
- Toggle between Query and Search modesn
- Create a new sessionh
- Show/hide helpLeft/Right
arrows - Navigate between sessionsUp/Down
arrows - Scroll through message historyEnter
- Submit input (when in edit mode)Esc
- Exit edit mode
ReachDB is a high-performance graph database implementation in Rust, designed for efficient storage and traversal of relationship-based data. It uses memory-mapped files for fast access to node and relationship records.
- Memory-mapped storage: Fast access to node and relationship data
- Bidirectional relationships: Each relationship connects source and target nodes
- User-defined relationship types: Custom relationship semantics through generics
- Efficient traversals: Iterators for relationship traversal
- Persistent storage: Data remains on disk between sessions
// Define relationship types
#[derive(Debug)]
enum RelationType {
IsA(u8),
HasA(u8),
DependsOn(u8)
}
// Implement the UserDefinedRelationType trait
impl UserDefinedRelationType for RelationType {
// ... implementation ...
}
// Open or create a new database
let mut db = Reachdb::<RelationType>::open("data", Some(10000), Some(10000))?;
// Add edges (automatically creates nodes if they don't exist)
db.add_edge("Person", "Human", "IS-A")?;
db.add_edge("Person", "Arms", "HAS-A")?;
ReachTUI is built using Ratatui and Crossterm to create a responsive terminal UI that allows users to interact with the Reach knowledge graph system through multiple sessions.
- Multiple session management: Work with different research topics in separate sessions
- Two operational modes: Query and Search/Knowledge Graph Building
- Interactive conversation history: View and navigate through past interactions
- Visual knowledge graph representation: See relationships between concepts
- Action tracking: Monitor actions performed during the research process
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Sessions β
ββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββ€
β β β
β ββββββββββββ βββββββββββββββββ β β
β β β β β β β
β β Actions β β Conversation β β Knowledge Graph β
β β β β β β β
β β β β β β β
β ββββββββββββ βββββββββββββββββ β β
β β β
ββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββ€
β Input Field β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The metadata module provides centralized access to important constants used throughout the Reach CLI application, including:
- Author information
- Version numbers
- Configuration file names
reach/
βββ src/
β βββ apis/ # API integrations (Google, Gemini, arXiv)
β βββ config/ # Configuration handling
β βββ metadata/ # Application metadata constants
β β βββ README.md # Metadata documentation
β βββ reachdb/ # Graph database implementation
β β βββ README.md # ReachDB documentation
β βββ rsearch/ # Research functionality
β β βββ knowledge_graph.rs # Knowledge graph generation
β β βββ utils.rs # Utility functions
β βββ reachtui/ # Terminal user interface components
β β βββ README.md # TUI documentation
β βββ scripts/ # Python scripts for web scraping
β βββ display/ # Output formatting
β βββ errors/ # Error handling
βββ .venv/ # Python virtual environment
βββ data/ # Output data storage
βββ summaries.json # Generated summaries
βββ knowledge_graph.json # Generated knowledge graphs
# Run all tests
cargo test
# Run tests that require configuration
cargo test --features requires_config
The project includes GitHub Actions workflows that:
- Build the project
- Set up the Python environment
- Install dependencies
- Run tests
[Specify your license here]
[Add contribution guidelines if applicable]
Created by Me kshitiz4kaushik@gmail.com
Current version: 1.0.0