r/codereview • • Nov 01 '26

I’ve been building an open-source project called Grafito — a place to manage documents, connect knowledge.

Hey everyone!

I wanted to share a project I've been working on called Grafito. It's an open-source, self-hosted platform that started around document management, but has gradually grown into something a bit broader.

The idea is to bring documents, notes, collaboration, and AI together instead of having information scattered across different tools.

Here's what it currently supports:

  • Document management: Organize files and folders into nested portfolios and workspaces, with version history, trash, and S3-compatible storage.
  • Knowledge management: Create Markdown notes, link them using [[wiki links]], use tags and backlinks, and explore connections through a knowledge graph.
  • Collaboration: Share documents and portfolios with users or organizations, configure permissions, leave comments, mention people, and collaborate on content.
  • Office integration: Edit Office documents through Collabora, including collaborative editing.
  • PDF signatures: Add signature fields to PDFs, request signatures from other users, and support image-based signatures or personal digital certificates.
  • AI assistant: Connect cloud providers like OpenAI, Claude, Gemini, Grok, DeepSeek, and others, or use local models through Ollama and LM Studio. The assistant can search, read, create, and edit notes according to the user's permissions.
  • Authentication: Supports local accounts, LDAP, OAuth, and OpenID Connect.

It's self-hosted and can be deployed with Docker Compose. The goal is to give people and organizations more control over their information while making that information easier to connect, find, and actually use.

I'm still actively developing it, so there's plenty of room for improvement. I'd genuinely love to hear what you think:

  • Does this combination of document management, knowledge graphs, and AI make sense to you?
  • What features would you find useful in a platform like this?
  • Is there anything you think I'm approaching the wrong way?

You can check it out here:

https://github.com/Seerendo/grafito

This isn't just a release announcement — I'm sharing it because I'd like to get feedback from the community and hopefully have some people interested in exploring or contributing to it.

Thanks for taking a look!

5 Upvotes

10 comments sorted by

1

u/Financial_Farm4326 Nov 01 '26

the permission model for the AI assistant sounds like the trickiest part of this stack tbh. how are you making sure the context retrieval strictly respects folder and document ACLs without leaking data across workspaces?

1

u/Seerendo-01 Nov 01 '26

That's definitely one of the most important parts of the architecture.

My approach is to make permissions part of the retrieval process itself, rather than relying on the AI model to decide what it can or cannot access.

The idea is that every retrieval operation must respect the user's existing permissions on workspaces, portfolios, folders, and individual documents. The AI assistant should only receive context that the requesting user is already authorized to access.

In other words, access control needs to happen before the context reaches the model, not through a prompt telling the model what to ignore.

I'm still working on validating this thoroughly, especially around nested permissions, shared resources, and preventing cross-workspace data leakage. It's an area where I don't want to take shortcuts.

That's actually one of the reasons I decided to share Grafito with this community. I know there are many things I might overlook while developing it on my own, and I'd really appreciate as much feedback, criticism, and observations as possible. The goal is to identify these kinds of issues early, learn from other people's experience, and make the project better together.

1

u/Jazzlike_Place_1974 22d ago

for the PDF digital certificates, are you doing actual cryptographic signing with an audit trail or just flattening an image onto the document? that distinction usually makes or breaks it for business users.

1

u/Seerendo-01 21d ago

Yep, both actually! 😄 But we keep them separate because they're not the same thing.

For certificate signing, we do real cryptographic signing. The signer uploads their .p12/.pfx certificate and password, and Grafito uses them to create a PKCS#7 detached signature with the proper PDF ByteRange. Everything is handled in memory, so we don't store private keys, certificates, or passwords. We also use incremental updates, meaning multiple people can sign the same PDF without invalidating previous signatures. You can verify them directly in Acrobat or another PDF reader.

For image signatures, we just place the PNG/JPEG onto the PDF. It's purely visual, and we make that clear. We also don't allow image signatures once a PDF has been cryptographically signed, since that could invalidate existing signatures.

There's an audit trail too. We track who requested the signature, who signed (or declined), when it happened, and the SHA-256 hash of the exact document version involved.

That said, there's still some work to do on the cryptographic side. We don't support trusted timestamps (RFC 3161), LTV, or PAdES yet, and certificate chain/revocation validation is left to the PDF reader.

So right now, I'd say it's solid for internal approvals and workflows where people can verify signatures in a PDF reader. For stronger long-term legal compliance, especially eIDAS/PAdES, we still have a few things to implement.

And yeah, I completely agree with your point. Just putting an image on a PDF and calling it a digital signature isn't really enough for business use cases.

2

u/[deleted] 29d ago

[removed] — view removed comment

1

u/Seerendo-01 28d ago

Thanks a lot for the detailed feedback and for starring the repo! I really appreciate your architectural perspective.

You brought up three very important points:

1. File-system-first and data portability

Currently, Grafito stores notes in Elasticsearch, while uploaded documents (PDF, DOCX, ODT, etc.) are managed separately.

I agree that avoiding database lock-in is important. I'm considering moving toward a clearer separation between the source of truth and the search/indexing layer, while also providing full Markdown exports with attachments, folder structures, and wiki links.

I don't necessarily want to make the filesystem the primary storage layer, since Grafito also handles multi-user permissions, collaboration, and document management. But users should absolutely be able to take their data elsewhere without depending on Grafito.

2. Offline-first

This is something I want to improve. Grafito is currently designed primarily around a self-hosted server, but local draft persistence, offline editing, and synchronization are areas I'd like to explore.

The biggest challenge will be handling synchronization conflicts properly, especially in collaborative environments.

3. AI permissions and prompt injection

This is probably the most critical point.

The goal is to enforce permissions at the backend/tool level rather than relying on the LLM to respect them. Retrieved documents should always be treated as untrusted data, and any action proposed by the model must be independently authorized before execution.

I also agree that indirect prompt injection deserves dedicated adversarial testing, particularly when local models can interact with documents and notes through tools.

A little update on the project's current state:

Grafito is currently going through a code refactoring and optimization phase. I'm taking note of every piece of feedback I receive, and several issues and suggestions raised in previous comments have already been reviewed and addressed.

Your observations are particularly specific and actionable, which I absolutely love! I'll definitely be working through them once the current refactoring phase is complete.

There's also something else I've been working on that I'd like to share.

As Grafito evolves, I'm realizing that its current knowledge graph approach, which mainly focuses on high-level relationships between documents and notes, may become too limited as the platform grows.

I want to go beyond simply connecting documents and start supporting richer knowledge representations, relationships, context, and eventually persistent memory for AI agents.

That's actually why I started developing a separate graph engine called Grafeno.

Much like Grafito itself, Grafeno started as an attempt to solve a very specific need within one of my own projects. But as I've continued developing it, its potential scope has grown enough that I think it deserves to be considered as a standalone project.

It's already available in my GitHub repositories under the name Grafeno: https://github.com/Seerendo/grafeno

I'm still running tests, refining its architecture, and working on optimizations. Once I've made enough progress and validated a few things, I'm planning to share it in a separate Reddit post to get feedback from the community as well.

Ultimately, I want Grafito to evolve beyond document management into a portable knowledge and memory platform, where notes, documents, relationships, and AI-generated context can be connected, reused, and potentially shared across different models and agents.

Again, thank you so much for taking the time to share such thoughtful and specific feedback. These are exactly the kinds of architectural discussions I was hoping to spark by sharing the project.

I'll definitely be tackling your suggestions after the ongoing refactoring work. I genuinely appreciate it! 😎

1

u/[deleted] Nov 01 '26

[removed] — view removed comment

1

u/Seerendo-01 Nov 01 '26

Oh, this is actually really good advice! I hadn't thought about approaching the review that way, but it makes a lot of sense.

I really like those two test cases, especially the prompt injection one. I'll definitely add them to my testing checklist. You're absolutely right about checking permissions at every tool call instead of trusting the model to follow instructions.

And yeah, that's exactly why I decided to share Grafito here. I'm building a lot of this on my own, so getting fresh eyes on it is incredibly helpful. I'd rather have people point out things I missed now than discover them the hard way later haha.

Really appreciate you taking the time to write this up!

0

u/[deleted] Nov 01 '26

[removed] — view removed comment

1

u/Seerendo-01 Nov 01 '26

Yes! I've been experimenting with different models, both local and cloud-based. One thing I've noticed is that local models can sometimes hallucinate when creating notes or suggesting links between them. It really depends on the model's size and capabilities.

I'm still exploring how to make those interactions more reliable, especially when it comes to understanding relationships between pieces of information rather than just generating text. That's actually one of the interesting challenges I'm trying to solve with Grafito.