Repository navigation
feat: add local note and graph context to AI agent - #54
Open
karmaboy1309 wants to merge 1 commit into
Open
karmaboy1309 wants to merge 1 commit into
karmaboy1309 wants to merge 1 commit into
Conversation
Phase 1 of README Aim flint-md#1: ground Ollama answers in local vault notes. Changes: - build_concise_system_prompt: now includes the user's custom system_prompt, passes the full vault memory context to the model, and enforces three explicit grounding rules so the model clearly states when the local notes do not contain the answer instead of hallucinating. - build_memory: bounds the MEMORY MAP section to only the selected relevant notes and their immediate 1-hop neighbors instead of dumping the entire vault connection graph, preventing context-limit overflows on large vaults. Closes part of flint-md#1 aim (local note + graph context Q&A)
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Filter graph connections to the selected map nodes to fully enforce the context bound.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds local vault grounding and bounded graph context to AI agent prompts.
Changes:
- Includes custom system prompts and grounding rules.
- Limits memory-map context to relevant notes and nearby connections.
- Uses bidirectional graph links.
| File | Summary |
|---|---|
agent/agent.py |
Updates prompt grounding and scoped graph context; graph edges still need filtering to prevent excessive context. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| for nid in sorted(map_nodes, key=lambda x: len(graph.get(x, set())), reverse=True): | ||
| if graph.get(nid) and nid in note_map: | ||
| conn_names = [note_map[cid]["title"] for cid in graph[nid] if cid in note_map] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Phase 1 of README Aim #1: ground Ollama answers in local vault notes.
Changes:
Closes part of #1 aim (local note + graph context Q&A)