"The goal isn't to remember everything. It's to never lose what matters."
NeuroWiki is an AI-powered, private knowledge base that transforms anything you read into structured, searchable, interconnected wiki pages — all scoped exclusively to your account.
| Feature | Description |
|---|---|
| 🔐 Private-by-design | Every user's data lives in a completely isolated tenant. User A cannot see User B's data — ever. |
| 🤖 AI ingestion | Paste a URL, upload a PDF/DOCX/TXT, or type raw text. The AI extracts key knowledge and writes structured wiki pages automatically. |
| 🕸 Knowledge graph | Pages link to each other via [[wikilinks]]. Explore your knowledge visually in the Graph view. |
| 🔍 Semantic search | Ask natural-language questions across your entire knowledge base. Answers are grounded only in your own content. |
| 📓 Diary | Write and store personal diary entries, separate from wiki pages. |
| 🗑 Delete your data | Hover any wiki card → red trash icon appears → confirm → permanently deleted. |
| 📤 Export | Download a full export of your wiki at any time. |
- Node.js 20+
- Google Cloud CLI (for deployment only)
git clone https://github.com/SyedArmanAli2003/NeuroWiKi.git
cd NeuroWiKinpm installCopy the example file and fill in your keys:
cp .env.example .env.localEdit .env.local:
# HydraDB — knowledge storage & semantic search
HYDRADB_API_KEY=sk_live_...
# Google Gemini — AI ingestion
GOOGLE_GENERATIVE_AI_API_KEY=AIza...
# NVIDIA LLaMA (fallback LLM)
NVIDIA_API_KEY=nvapi-...
NVIDIA_MODEL=meta/llama-3.3-70b-instruct
# NextAuth — session encryption
NEXTAUTH_SECRET=your-32-char-random-secret
NEXTAUTH_URL=http://localhost:3000
# Set to 0 to disable AI enrichment on ingest (faster, cheaper)
INGEST_ENRICH=0
⚠️ Never commit.env.local— it is gitignored by default.
npm run devVisit http://localhost:3000. You'll be shown the landing page. After 5 seconds, a sign-in prompt will appear.
NeuroWiki
├── app/ # Next.js App Router pages
│ ├── page.tsx # Landing page (public, 5s auth prompt)
│ ├── auth/signin # Sign-in page
│ ├── auth/signup # Sign-up page
│ ├── wiki/ # Wiki browser + [slug] detail
│ ├── search/ # Semantic search
│ ├── graph/ # Knowledge graph visualisation
│ ├── diary/ # Diary entries
│ ├── ingest/ # Add sources (URL / file / text)
│ └── api/ # REST API routes
│ ├── auth/ # NextAuth sign-in / sign-up
│ ├── wiki/ # List & delete wiki pages
│ ├── ingest/ # AI ingestion pipeline
│ ├── query/ # Semantic Q&A
│ └── ...
├── lib/
│ ├── auth-options.ts # Shared NextAuth config
│ ├── user-db.ts # SQLite users table (bcrypt passwords)
│ ├── db.ts # SQLite singleton (sources, logs, pages)
│ ├── hydra.ts # HydraDB client
│ └── hydra-fetch.ts # HydraDB list/fetch helpers
├── components/
│ └── layout/Topbar.tsx # Navbar with auth pill
├── middleware.ts # Route protection (public: /, /auth/*)
└── Dockerfile # Production container
NeuroWiki uses NextAuth.js with a CredentialsProvider backed by a local SQLite database.
- Passwords are hashed with bcrypt (cost factor 12) — never stored in plain text.
- Sessions use JWT stored in an HTTP-only cookie.
- All protected routes are guarded by
middleware.ts— unauthenticated requests are redirected to/auth/signin.
- Go to
/auth/signup - Enter your name, email, and a password (min 8 characters)
- A password strength meter gives live feedback
- On success you're automatically signed in and redirected to the dashboard
- Go to
/auth/signin - Enter your registered email and password
- On success you're redirected to the homepage
Each user gets their own HydraDB tenant (user-{userId}). This means:
- ✅ User A's ingested sources, wiki pages, and diary entries are invisible to User B
- ✅ AI search only queries the current user's knowledge base
- ✅ The delete endpoint validates the requesting user's ID before deleting
- ✅ The wiki list API returns only the current user's pages
On the /wiki page, hover over any knowledge card — a red trash icon appears in the top-right corner of the card. Click it, confirm the prompt, and the entry is permanently deleted from both HydraDB and the local SQLite metadata store.
gcloud run deploy neurowiki \
--source . \
--project YOUR_PROJECT_ID \
--region us-central1 \
--allow-unauthenticated \
--set-env-vars="NEXTAUTH_URL=https://YOUR_URL,NEXTAUTH_SECRET=...,HYDRADB_API_KEY=...,GOOGLE_GENERATIVE_AI_API_KEY=...,NVIDIA_API_KEY=...,NVIDIA_MODEL=meta/llama-3.3-70b-instruct,INGEST_ENRICH=0"
⚠️ Cloud Run ephemeral disk warning: SQLite files are wiped when a container restarts. This affects the localuserstable. For a persistent production deployment, migrate the user store to a managed database (e.g., Supabase PostgreSQL, Google Cloud SQL, or Firebase Auth).
https://neurowiki-483008448755.us-central1.run.app
| Variable | Required | Description |
|---|---|---|
NEXTAUTH_SECRET |
✅ | 32+ char random string for JWT signing |
NEXTAUTH_URL |
✅ | Full URL of your deployment |
HYDRADB_API_KEY |
✅ | HydraDB API key for knowledge storage |
GOOGLE_GENERATIVE_AI_API_KEY |
✅ | Google Gemini API key for AI ingestion |
NVIDIA_API_KEY |
✅ | NVIDIA API key (fallback LLM) |
NVIDIA_MODEL |
✅ | NVIDIA model name |
INGEST_ENRICH |
❌ | Set to 0 to skip enrichment (recommended) |
- Fork the repo
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes
- Push and open a Pull Request against
main
MIT © 2024 NeuroWiki. Your knowledge. Your control.