{"id":46576668,"url":"https://github.com/zebbern/knowledge-assistant","last_synced_at":"2026-03-07T10:04:44.400Z","repository":{"id":333735086,"uuid":"1138425068","full_name":"zebbern/knowledge-assistant","owner":"zebbern","description":"A lightweight, no-cost, chat agent that answers questions from custom knowledge files. No vector databases, no embeddings, no complex setup - drop in your md files and start chatting","archived":false,"fork":false,"pushed_at":"2026-01-20T19:45:18.000Z","size":154,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-21T03:58:05.515Z","etag":null,"topics":["agent","chat","chat-bot","free-ai-tools","llm","project-ai-chatbot"],"latest_commit_sha":null,"homepage":"https://tryassistant.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zebbern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-20T16:51:37.000Z","updated_at":"2026-01-20T20:04:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zebbern/knowledge-assistant","commit_stats":null,"previous_names":["zebbern/knowledge-assistant"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zebbern/knowledge-assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebbern%2Fknowledge-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebbern%2Fknowledge-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebbern%2Fknowledge-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebbern%2Fknowledge-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zebbern","download_url":"https://codeload.github.com/zebbern/knowledge-assistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebbern%2Fknowledge-assistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30212021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","chat","chat-bot","free-ai-tools","llm","project-ai-chatbot"],"created_at":"2026-03-07T10:04:42.960Z","updated_at":"2026-03-07T10:04:44.391Z","avatar_url":"https://github.com/zebbern.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n## Knowledge-Assistant\n\n#### A lightweight, free, file-based chat agent that answers questions from your custom knowledge files. No vector databases, no embeddings, no complex setup - just drop in your markdown files and start chatting.\n\n\u003ckbd\u003eenv variables needed: OPENROUTER_API_KEY, NEXT_PUBLIC_SITE_URL\u003c/kbd\u003e\n\n\u003cimg width=\"800\" height=\"400\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1f95191f-4118-4a71-9d5a-842154711408\" /\u003e\n\n\u003cimg width=\"400\" height=\"400\" alt=\"image\" src=\"https://github.com/user-attachments/assets/eed43d7b-1406-45f2-a5e9-3fab43dd76f2\" /\u003e\n\u003cimg width=\"400\" height=\"400\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f99bead4-f62a-4b5b-bdb0-c196d15beaee\" /\u003e\n\n\u003c/div\u003e\n\n## Why Lightweight?\n\nUnlike heavyweight RAG solutions that require:\n\n- Vector databases (Pinecone, Weaviate, Chroma)\n- Embedding models and preprocessing\n- Complex chunking strategies\n- Database hosting and maintenance\n\nKnowledge-Assistant takes a simpler approach:\n\n- **Just files** - Drop `.md` or `.txt` files in a folder\n- **No preprocessing** - Files are read at request time\n- **No database** - Context goes directly to the LLM\n- **Free models** - Uses OpenRouter's free tier (Llama, Mimo, DeepSeek)\n\nPerfect for: documentation sites, GitHub repos, personal knowledge bases, and projects where simplicity beats complexity.\n\n### Key Features\n\n- **Multiple Free Models** - Choose from Llama 3.3, Mimo, DeepSeek R1, Devstral, GLM\n- **Temperature Control** - Adjust creativity (0 = precise, 2 = creative)\n- **Custom System Prompts** - Add your own AI personality and instructions\n- **Streaming Responses** - Real-time token-by-token output\n- **Markdown Rendering** - Full markdown with syntax highlighting\n- **Mermaid Diagrams** - Live diagram rendering in chat\n- **Code Blocks** - Syntax-highlighted with copy functionality\n- **Persistent Sessions** - Conversations stored in localStorage\n- **Export Chat** - Download conversations as markdown\n\n---\n\nKnowledge AI loads markdown files from a `content/` directory and uses them as context for AI responses. This approach provides accurate, domain-specific answers without the complexity of vector databases or embeddings.\n\n```mermaid\nflowchart LR\n    subgraph Client\n        A[Chat Interface]\n    end\n\n    subgraph Server\n        B[Next.js API]\n        C[Knowledge Loader]\n        D[OpenRouter API]\n    end\n\n    subgraph Knowledge\n        E[content/*.md]\n    end\n\n    A --\u003e|User Message| B\n    B --\u003e C\n    C --\u003e|Read Files| E\n    C --\u003e|Context + Message| D\n    D --\u003e|Streaming Response| B\n    B --\u003e|SSE Stream| A\n```\n\n## Quick Start\n\n### Prerequisites\n\n- Node.js 18+\n- OpenRouter API key ([get one free](https://openrouter.ai))\n\n### Installation\n\n```bash\ncd knowledge-assistance\nnpm install\ncp .env.example .env.local\n```\n\nEdit `.env.local` with your API key:\n\n```env\nOPENROUTER_API_KEY=your_api_key_here\nNEXT_PUBLIC_SITE_URL=http://localhost:3000\n```\n\n### Running\n\n```bash\nnpm run dev       # Development\nnpm run build     # Production build\nnpm start         # Start production server\n```\n\nAccess the application at `http://localhost:3000`\n\n## Architecture\n\n```mermaid\ngraph TB\n    subgraph Frontend\n        UI[React Chat UI]\n        MD[Markdown Renderer]\n        MM[Mermaid Component]\n        CB[Code Block Component]\n    end\n\n    subgraph API_Layer[API Layer]\n        STREAM[Stream Endpoint]\n        CHAT[Chat Endpoint]\n    end\n\n    subgraph Knowledge_System[Knowledge System]\n        LOADER[File Loader]\n        CONTENT[Content Files]\n    end\n\n    subgraph External\n        OR[OpenRouter API]\n    end\n\n    UI --\u003e STREAM\n    STREAM --\u003e LOADER\n    LOADER --\u003e CONTENT\n    STREAM --\u003e OR\n    OR --\u003e UI\n    UI --\u003e MD\n    MD --\u003e MM\n    MD --\u003e CB\n```\n\n## Knowledge System\n\nAdd knowledge by placing markdown files in the `content/` directory:\n\n```\ncontent/\n  knowledge.md           # General domain knowledge\n  n8n-workflow-guide.md  # n8n workflow JSON reference\n  n8n-ai-nodes.md        # AI/LangChain node examples\n  n8n-patterns.md        # Common workflow patterns\n  mermaid-syntax.md      # Mermaid diagram reference\n```\n\nThe AI reads all `.md` and `.txt` files at request time and uses them as context for responses.\n\n### Knowledge File Structure\n\nEach knowledge file should be focused on a specific topic:\n\n```markdown\n# Topic Title\n\nBrief overview of the topic.\n\n## Section 1\n\nDetailed information with examples.\n\n## Section 2\n\nCode examples in fenced blocks.\n```\n\n## Project Structure\n\n```\nknowledge-assistance/\n  app/\n    api/\n      chat/\n        route.ts          # Non-streaming endpoint\n        stream/\n          route.ts        # Streaming endpoint\n    layout.tsx\n    page.tsx\n    globals.css\n  components/\n    chat.tsx              # Main chat interface\n    mermaid.tsx           # Mermaid and code block rendering\n    ui/                   # Shadcn UI components\n  content/                # Knowledge files\n  lib/\n    utils.ts\n```\n\n## API Endpoints\n\n### POST /api/chat/stream\n\nStreaming chat endpoint using Server-Sent Events.\n\n**Request:**\n\n```json\n{\n  \"message\": \"User message\",\n  \"messages\": [\n    { \"role\": \"user\", \"content\": \"Previous message\" },\n    { \"role\": \"assistant\", \"content\": \"Previous response\" }\n  ]\n}\n```\n\n**Response:** SSE stream with chunked content\n\n### POST /api/chat\n\nNon-streaming chat endpoint.\n\n**Request:** Same as streaming endpoint\n\n**Response:**\n\n```json\n{\n  \"response\": \"Complete AI response\"\n}\n```\n\n## Configuration\n\n### Model Selection\n\nThe default model can be changed in `app/api/chat/stream/route.ts`:\n\n```typescript\nmodel: \"xiaomi/mimo-v2-flash:free\", // or any OpenRouter model\n```\n\n### Token Limits\n\nAdjust response length:\n\n```typescript\nmax_tokens: 4096,\n```\n\n## Data Flow\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant Chat UI\n    participant API Route\n    participant Knowledge Loader\n    participant OpenRouter\n\n    User-\u003e\u003eChat UI: Send message\n    Chat UI-\u003e\u003eAPI Route: POST /api/chat/stream\n    API Route-\u003e\u003eKnowledge Loader: getKnowledge()\n    Knowledge Loader-\u003e\u003eKnowledge Loader: Read content/*.md\n    Knowledge Loader--\u003e\u003eAPI Route: Knowledge context\n    API Route-\u003e\u003eOpenRouter: Stream request\n    loop Streaming\n        OpenRouter--\u003e\u003eAPI Route: Token chunk\n        API Route--\u003e\u003eChat UI: SSE event\n        Chat UI--\u003e\u003eUser: Render token\n    end\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzebbern%2Fknowledge-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzebbern%2Fknowledge-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzebbern%2Fknowledge-assistant/lists"}