Nalar AI Documentation
The Local-First AI agent tailored for educational and academic document analysis. A built-in Retrieval-Augmented Generation (RAG) loop that reads your documents, extracts insights, and provides exact citations without hallucinations.
What is Nalar AI?
Nalar AI is not just a standard chatbot wrapper. It is a specialized, autonomous AI platform designed for research and education. Rather than manually reading through hundreds of pages, you provide the documents to the AI and converse with it.
It lives entirely on your local machine or server. It doesn't rely on third-party cloud RAG providers to store your documents. Using advanced Text Chunking, Embeddings, and Vector Database Indexing, Nalar AI processes your data locally and uses standard APIs (like OpenAI or OpenRouter) strictly for inference.
- Local-First Architecture: Your documents and vector databases stay on your machine.
- Exact Citations: Every answer includes page-level citations pointing directly to the source document.
- Interactive Tools: Automatically generates quizzes and visual flowcharts from text.
Installation
To easily install the Nalar AI ecosystem (Frontend, Backend, and Database), we provide a global Command-Line Interface (CLI).
Install via NPM
Setup and Start
Run the following command in your terminal. The CLI will automatically download the required repositories, set up Python virtual environments, install dependencies, and start both the FastAPI backend and Next.js frontend concurrently.
Note: You need Git, Python 3, and Node.js (npm/pnpm) installed on your system before running the CLI.
Multi-Document Management
Nalar AI allows you to query multiple documents simultaneously.
- Supported Formats: `.pdf`, `.docx`, and `.txt`.
- Large File Handling: Upload up to 50MB per document. The advanced chunking algorithm ensures even massive files are parsed efficiently.
- Cross-Referencing: Select multiple documents in the chat interface. The AI will cross-reference contexts across all selected files (e.g., comparing methodologies between Journal A and Journal B).
Agentic Chat & RTK
The core interface features Real-Time Knowledge (RTK) allowing the AI to understand complex, multi-step analytical queries based strictly on the uploaded context.
Streaming Responses
Answers are streamed token-by-token for an instant UX. You can interrupt the generation at any time using the Stop button.
Accurate Citations
Claims are backed by citations mapped directly to the original file and page number, ensuring zero artificial hallucinations.
Auto-Quiz Generation
Test your understanding after reading. By clicking the "Generate Quiz" button, Nalar AI scans the entire document, extracts key facts, and automatically synthesizes a multiple-choice interactive quiz complete with an automated grading system.
Draw.io Integration (Visuals)
Having trouble visualizing architectures or workflows? Ask the AI to "create a flowchart based on this document."
The backend natively generates structured Draw.io XML logic, and the frontend renders it interactively inline using the `react-drawio` integration.
Ecosystem Repositories
Nalar AI utilizes a microservices architecture separated across distinct repositories for scalable development.
Password Reset
Because Nalar AI uses single-password authentication for local deployment, you can force-reset the password via the CLI if you get locked out.
Method 1: CLI Reset (Recommended)
Run this command in your terminal to overwrite the password:
Example: nalar-ai admin reset-password admin@nalar.ai NewPass123
Method 2: Full Database Reset
In case of severe corruption, you can completely wipe the SQLite database (this will delete all users and chat history):
Note: The system will recreate the default admin user automatically upon the next startup.