LimQA is a compact, search-powered Q&A system inspired by Perplexity AI. It is designed to deliver concise, accurate answers to user queries by combining the strengths of a language model (LLM) with real-time web search capabilities. LimQA processes user questions, intelligently determines whether external search data is required, and presents a response with relevant citations, making it both informative and credible.
To get LimQA running locally, follow these steps:
- Node.js: Ensure that Node.js (version 18 or later) is installed.
- API Keys: get your api keys from Mistral and Tavily.
-
Clone the Repository:
git clone https://github.com/raman20/limqa.git cd limqa -
Install Dependencies
pnpm install
-
Setup Environment Variables create a
.envfile and ur api keysMISTRAL_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx TAVILY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
Run
pnpm dev
after this visit http://localhost:3000 and your local setup is ready.
LimQA is designed to be an intuitive, minimalistic Q&A system that delivers real-time answers with sources. Follow these steps to use LimQA effectively:
-
Ask a Question:
- Navigate to the main page at
https://limqa.vercel.appand enter your query in the input field. - Click Enter.
- Navigate to the main page at
-
Receiving Responses:
- LimQA will analyze your question and decide whether it requires external search results.
- For queries requiring external data, LimQA performs a real-time search and then summarizes the top results, displaying a concise answer with citations.
- For straightforward or conversational questions, LimQA may provide an answer directly from the language model without additional sources.
-
Interpreting Citations:
- When search results are used, citations are included to indicate the sources of the information.
- These citations link back to the original sources, providing transparency and credibility for each answer.
- Be Specific: For complex topics, providing specific terms or context can improve response accuracy.
- Use Clear Language: Simple, direct language helps LimQA understand your question better.
LimQA is intended for quick, informed answers rather than extensive research.
├── lib
│ ├── answer-agent.ts
│ ├── prompt.ts
│ ├── tools-schema.ts
│ └── tools.ts
├── pages
│ ├── _app.tsx
│ ├── api
│ │ └── ask.ts
│ └── index.tsx
├── styles
│ └── global.css
├── .env
└── package.json
└── tsconfig.json
└── README.mdThis directory contains utility functions and schemas used throughout the application.
answer-agent.ts: Implements theAnswerAgentfunction, which processes user queries and interacts with external tools for searching and retrieving content.prompt.ts: Contains the system prompt used to guide the behavior of the AI model.tools-schema.ts: Defines schemas for validating input parameters for the search and retrieve tools using Zod.tools.ts: Implements theSearchToolandRetrieveToolfunctions for searching the web and retrieving content from URLs.
This directory contains the application's pages and API routes.
_app.tsx: Custom App component for Next.js, which wraps all pages and includes global styles and analytics.index.tsx: The main page of the application, which includes the chat interface for user interaction.api/ask.ts: API route that handles incoming requests for user queries, validates them, and processes them using theAnswerAgent.
This directory contains global styles for the application.
global.css: Contains the CSS styles that apply to the entire application, including layout and component styles.
This file contains environment variables used in the application, such as API keys for external services.
This file contains metadata about the project, including dependencies, scripts, and version information.
