ContextKeeper:按記憶內容搜尋,而不只是按名稱搜尋
ContextKeeper: Find What You Remember, Not Just What You Named
ContextKeeper 是一款 AI 個人知識庫,讓用戶以自然語言描述記得的內容,從文件中找回相關資訊,而不必依賴檔名或精確搜尋詞。它支援文字型 PDF、Markdown 和 TXT,並會提供來源摘錄及相關性解釋;直接引文會與原始文件核對。項目以 Google Gemma 作為執行模型,遠端 AI 推理不可用時,確定性搜尋仍可運作。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
ContextKeeper — Your files remember, so you don't have to.
Have you ever remembered reading something useful in a document but forgotten the filename, where you saved it, or the exact words you need to search for?
That is the problem I built ContextKeeper to solve.
ContextKeeper is an AI-powered personal knowledge library that helps people retrieve forgotten information from their documents using natural-language recollections. Instead of relying entirely on filenames, manual tags, or exact search terms, users can describe what they remember and discover relevant documents.
For example, instead of searching for a filename, you could search for something like:
"That document where I read about handling API errors in a Node.js application."
ContextKeeper searches document content and available metadata, surfaces relevant source excerpts, and explains why a result may answer the query. Where it presents a direct quote, it verifies that the quoted text exists in the original source.
The application currently supports text-based PDFs, Markdown, and TXT documents, with document organization and folder-rescanning capabilities in the implemented workflow.
I wanted to explore a simple idea: what if finding information depended less on remembering where you put it and more on remembering what you read?
The people who benefit are developers, students, researchers, freelancers, and anyone whose collection of useful documents has become difficult to navigate.
Demo
Try ContextKeeper here:
The best way to evaluate it is to index a few documents containing information you may need later, then try searching for a remembered concept without using the exact filename.
Code
The source code is available for review and contribution. I am building ContextKeeper as an open-source project and documenting the decisions behind its retrieval pipeline, document processing, and AI integration.
How I Built It
I built ContextKeeper as a full-stack web application using React, TypeScript, Vite, and an Express backend.
Its document-processing workflow extracts text from supported files and preserves source information for retrieval and verification. The application uses IndexedDB for local browser persistence, with backend APIs handling document-processing operations and AI inference.
Building around Google Gemma
A central requirement of this project was using Google Gemma as the runtime model for document understanding, rather than simply adding an AI chatbot to an ordinary file manager.
Gemma supports document-understanding tasks such as generating summaries, extracting topics and useful metadata, and explaining why a retrieved document may be relevant.
The retrieval pipeline combines deterministic scoring across document content and metadata with candidate selection, source excerpts, and contextual explanations. This distinction matters: relevance ranking and source retrieval are separate from the model's explanation of a result.
I also wanted the application to fail gracefully. If remote AI inference becomes unavailable, deterministic retrieval can continue working rather than making the entire library unusable. AI-generated claims and direct source quotations must not be treated as interchangeable: quoted text needs to be checked against the source.
The project includes automated tests for recollection-based retrieval, partial-phrase queries, irrelevant searches, evidence verification, inference failures, document extraction, and folder-rescan behavior.
Design decisions
A few principles guided the implementation:
- Retrieve evidence, not just answers. Users should be able to inspect the source behind a result.
- Be honest about uncertainty. An irrelevant query should not produce fabricated matches.
- Keep the workflow useful when AI fails. Deterministic search should remain available when remote inference is unavailable.
- Respect original files. Removing a document from the ContextKeeper library should not delete its original file from the user's computer.
The current implementation is an evolving MVP. Its supported formats and retrieval behavior have defined limits, and I am continuing to validate the complete user experience.
Why Does Open Innovation Matter?
Open innovation matters because useful AI applications should not have to depend on a single closed model or a black-box workflow that developers cannot meaningfully inspect.
Building ContextKeeper around _Gemma _gave me an opportunity to explore how an open-weight model family can be integrated into a practical application with a defined purpose: personal document retrieval.
The interesting engineering work is not just calling a model. It is deciding where the model belongs in the system, which tasks should remain deterministic, how to validate generated outputs, and how to preserve useful functionality when inference fails.
This project also demonstrates why model integration should be evaluated as part of a complete system. A generated explanation is not enough if the application cannot retrieve the right document or show evidence for its answer.
Open innovation makes it possible for developers to experiment with these design choices, share implementations, inspect trade-offs, and build on one another's work.
For ContextKeeper, that means exploring AI-assisted retrieval as an understandable and testable product capability—not treating AI output as automatically correct.
My Agent Session
The Lazy Payoff
The goal is to reduce the effort between remembering information and finding its source.
Without ContextKeeper, a person might open several files, try different keywords, browse folders, or search repeatedly for a phrase they only partially remember. ContextKeeper is designed to reduce that friction by searching indexed content and metadata using recollections.
I have implemented and tested core retrieval and folder-rescan behaviors, but I have not established a reliable real-world time-saving measurement yet. I would rather measure that honestly than invent a percentage.
A useful next evaluation is to compare how long people take to find a known piece of information using ordinary filename or keyword search versus ContextKeeper's Recall Mode.
The ambition is simple: spend less time hunting for information and more time using it.
ContextKeeper is still evolving, and that is part of the point. I wanted to build something practical, test the retrieval and evidence pipeline, and explore how Gemma can support a focused, useful AI experience.
Your files remember, so you don't have to.
來源:DEV Community · dev.to