Skip to content

EidosL/synapse0.15-codex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

128 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GHBanner

🧠 Project Synapse

In a world of information overload, it's easy to lose track of valuable connections between your ideas and research. Project Synapse is a note-taking application that acts as your personal "second brain," using artificial intelligence to help you find hidden connections between your notes. It's designed to surface relevant information, spark new insights, and help you think more creatively.

✨ Features

  • 📝 Note-Taking: A simple and intuitive interface for creating, editing, and deleting notes. Your notes are saved automatically to a local database.
  • ☁️ AI-Powered Insights: Synapse uses a generative AI model to find "synaptic links" between your notes, revealing hidden connections and relationships that you might have missed.
  • 📂 Bulk Upload: Easily import your existing notes from .md, .txt, and .pdf files.
  • 🌐 Multilingual Support: The application is available in multiple languages, and can process notes in any language supported by the AI model.
  • 🔒 Privacy-Focused: All your notes and data are stored locally on your machine in a SQLite database file (synapse.db). No note content is sent to a third-party server, except for the chunks of text sent to the AI model for insight generation.

🚀 How to Use

  1. Set your API Key: Before you start, you need to provide your Gemini API key. The application will prompt you for it on the first run.
  2. Create a new note: Click the "New Note" button in the "Vault" tab to start writing. The editor supports markdown.
  3. Upload existing notes: Use the "Upload Files" button to add your existing notes in .md, .txt, or .pdf format. You can select multiple files at once.
  4. Find connections: After adding a few notes, click the "Find Connections" button (the icon with the arrows) on a note to see what synaptic links Synapse has discovered.
  5. Review your insights: New connections will appear in your "Inbox" tab. You can view the two connected notes side-by-side, and decide whether to keep or dismiss the insight.

🛠️ How it Works

Synapse uses a combination of techniques to find connections between your notes, all orchestrated by a Python backend:

  1. Semantic Chunking: When you add or update a note via the API, the backend breaks it down into smaller, semantically related chunks. This allows the application to understand the meaning and context of your notes, rather than just matching keywords.
  2. Embeddings: Each chunk is then converted into a numerical representation called an "embedding" using a sentence-transformers model. These embeddings are stored alongside your notes in the local database.
  3. Vector Store (FAISS): The embeddings are loaded into a FAISS index for fast and efficient similarity searches.
  4. Synaptic Links: When you ask Synapse to find connections for a note, the backend uses a hybrid search (lexical + vector) to find the most similar chunks from other notes. These connections are then synthesized into "synaptic links" by a generative AI model.

🏃‍♀️ Getting Started: Running Synapse Locally

This guide will walk you through setting up and running Project Synapse on your local machine.

1. Prerequisites

Before you begin, you'll need to have a few essential tools installed on your computer.

  • Git: Git is a version control system used to manage code. You'll need it to download the project files.
  • Node.js: Node.js is a JavaScript runtime environment that allows you to run JavaScript code outside of a web browser. It also includes npm (Node Package Manager), which you'll use to install the project's frontend dependencies.
  • Python: Python is a programming language used for the project's backend.

2. Clone the Repository

First, you need to download the project's source code. Open your terminal (on macOS or Linux) or Command Prompt/PowerShell (on Windows), navigate to the directory where you want to store the project, and run the following command:

git clone https://github.com/your-username/synapse.git
cd synapse

This will create a new folder named synapse containing all the project files.

3. Backend Setup

The backend is responsible for the application's core logic.

  1. Create a Virtual Environment (Recommended): It's a good practice to create a virtual environment to isolate the project's dependencies. This prevents conflicts with other Python projects on your system.

    # On macOS and Linux
    python3 -m venv venv
    source venv/bin/activate
    
    # On Windows
    python -m venv venv
    .\venv\Scripts\activate
  2. Install Dependencies: Install the required Python packages using pip.

    pip install -r requirements.txt

4. Frontend Setup

The frontend is the user interface of the application.

  1. Install Dependencies: Install the required JavaScript packages using npm.

    npm install

    This command reads the package.json file and downloads all the necessary libraries for the user interface.

5. Configuration

Synapse requires API keys for some of its features. You'll need to create a special file to store these keys securely.

  1. Create a .env.local file: In the root of the project directory, create a new file named .env.local.

  2. Add API Keys: Add the following lines to the .env.local file, replacing your_api_key with your actual keys.

    GEMINI_API_KEY=your_gemini_api_key
    SERPAPI_API_KEY=your_serpapi_key
    
    • GEMINI_API_KEY: You can get a Gemini API key from Google AI Studio.
    • SERPAPI_API_KEY: You can get a SerpAPI key from the SerpAPI website. This is used for the web search functionality.

6. Running the Application

Now you're ready to start the application! You'll need to run both the backend and frontend servers in separate terminal windows.

  1. Start the Backend Server: In your first terminal window (with the Python virtual environment activated), run the following command. The PYTHONPATH is required so that the server can find the src module.

    PYTHONPATH=. uvicorn server:app --reload

    The backend server will start on http://localhost:8000.

  2. Start the Frontend Server: In a second terminal window, run the following command:

    npm run dev

    The frontend development server will start on http://localhost:5173.

  3. Open the Application: You can now access the application by opening your web browser and navigating to http://localhost:5173.

🖼️ Application in Action

Synapse in action


⚠️ A Note on Browser Warnings

You may notice some warnings in your browser's developer console related to "third-party cookies" or "cross-site requests". These are expected and are not a security risk in this application. They appear because Project Synapse loads some of its core functionalities (like the AI models and an icon library) from specialized, high-performance services.

Modern browsers are increasing their privacy protections, and these warnings are part of a broader effort to phase out third-party cookies. The services Synapse uses are already adopting new standards. Your data remains private and is not being tracked or shared unexpectedly.

About

rag enhace

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors